From: Ian Campbell Subject: Re: [PATCH v5 3/4] xen: implement guest_physmap_pin_range and guest_physmap_unpin_range Date: Tue, 10 Sep 2013 10:33:55 +0100 Message-ID: <1378805635.21748.55.camel@kazak.uk.xensource.com> References: <1378742763-24299-3-git-send-email-stefano.stabellini@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1378742763-24299-3-git-send-email-stefano.stabellini@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: xen-devel@lists.xensource.com, tim@xen.org List-Id: xen-devel@lists.xenproject.org On Mon, 2013-09-09 at 17:06 +0100, Stefano Stabellini wrote: > > +static int pin_one_pte(lpae_t *ptep, void *arg, int level) > +{ > + lpae_t pte = *ptep; > + ASSERT(level == 3); > + > + if ( pte.p2m.avail & P2M_DMA_PIN ) > + return -EBUSY; > + pte.p2m.avail |= P2M_DMA_PIN; > + write_pte(ptep, pte); > + return 0; > +} > + > +int guest_physmap_pin_range(struct domain *d, > + xen_pfn_t gpfn, > + unsigned int order) > +{ > + return p2m_walker(d, gpfn << PAGE_SHIFT, order, > + pin_one_pte, NULL); Did we not also discuss accounting and limits on the amount of memory a guest can lock down?