From: Ian Campbell Subject: Re: [PATCH] xen: arm: configure correct dom0_gnttab_start/size Date: Thu, 11 Sep 2014 17:05:05 +0100 Message-ID: <1410451505.567.7.camel@kazak.uk.xensource.com> References: <1410448889-18731-1-git-send-email-ian.campbell@citrix.com> <5411C5AA.2020807@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5411C5AA.2020807@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: Andrew Cooper Cc: julien.grall@linaro.org, tim@xen.org, stefano.stabellini@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Thu, 2014-09-11 at 16:54 +0100, Andrew Cooper wrote: > Why it is hard coded at all? (x86 appears to manage fine.) Without it > being variably-located, there will always be a risk of collisions like this. For x86 PV (and shadow?) you can establish a mapping of the gnttab from a virtual address directly to the machine address without needing a p2m entry, via whichever hypercall it is which does that. For HAP (and shadow?) you need a p2m mapping to get at the grant table, so somewhere has to be found in the physical address space where it can go. In theory a guest kernel could try and find some io space which it isn't using but to help them out we give them a hint. For x86 HVM the IOBAR of the platform device as a handy place to put the hint, for ARM domU we have a defined region in our address map which we use and communicate via device tree. But for ARM dom0 the physical address space layout follows the host, figuring out a free bit of space is a bit tricky so each platform is currently required (except some don't and there is a broken default) to say where is a safe place to use (i.e. a person has to read the datasheet and figure it out). Ideally we would in the future walk the device tree and try and find a hole in the address space, but that isn't implemented yet (for x86 PVHVM Linux or ARM AFAICT, I heard a rumour that the windows PV drivers were moving away from the platform device IOBAR somehow). Ian.