From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: Question about mapping between domains Date: Tue, 14 Jul 2015 16:50:13 +0100 Message-ID: <1436889013.11153.5.camel@citrix.com> References: <1436448706-2687-1-git-send-email-oleksandr.dmytryshyn@globallogic.com> <1436778275.7019.32.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Oleksandr Dmytryshyn Cc: Keir Fraser , Tim Deegan , Ian Jackson , xen-devel , Stefano Stabellini , Jan Beulich List-Id: xen-devel@lists.xenproject.org On Tue, 2015-07-14 at 18:41 +0300, Oleksandr Dmytryshyn wrote: > On Tue, Jul 14, 2015 at 6:31 PM, Oleksandr Dmytryshyn > wrote: > > > > Hi, Ian. Thank You for the responce. > > > > Currently have 3 kernels: Thin Dom0 (privileged), DomD (privileged > > driver domain), > > DomU (not privileged) > > > > On Mon, Jul 13, 2015 at 12:04 PM, Ian Campbell wrote: > > > The way we deal with this elsewhere in the kernel is that we only ever > > > do grant mappings over ballooned out pages, which are allocated via > > > gnttab_alloc_pages. That way when they are unmapped the page is expected > > > to be entry and no backing mfn is lost. The page can then subsequently > > > be ballooned back in as normal. > > We can not use this case because our DRM driver has already allocated memory > > which will be mapped later. > > > > > There is an additional quirk for a 1:1 mapped dom0 which is that we > > > don't actually decrease reservation when ballooning, but keep the 1:1 > > > mfn in anticipation of ballooning it back in later. > > Could You please tell me a bit more information about this quirk. How this quirk > > can be enabled? > > > > > If you can't arrange to use already ballooned buffers for your DMA > > > buffer then you will need to manually balloon it out before and balloon > > > it back in later. > > This is my case. I'll try to to this. > Here is one question. > Could anybody tell me how to manually balloon a page in/out? Look at how the balloon driver does it, the hypercalls you want are XENMEM_(increase|decrease)_reservation. Ian.