From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCH] xen: arm: configure correct dom0_gnttab_start/size Date: Thu, 11 Sep 2014 17:51:58 +0100 Message-ID: <5411D32E.1020101@citrix.com> References: <1410448889-18731-1-git-send-email-ian.campbell@citrix.com> <5411C5AA.2020807@citrix.com> <1410451505.567.7.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1410451505.567.7.camel@kazak.uk.xensource.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: Ian Campbell , Andrew Cooper Cc: xen-devel@lists.xen.org, julien.grall@linaro.org, tim@xen.org, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On 11/09/14 17:05, Ian Campbell wrote: > 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). Linux x86 PVH dom0 and domU uses ballooned pages and they're vmap()'d in into a contiguous bit of virtual address space. Perhaps something similar could be considered for ARM in the future? This would be common code between ARM and x86 PVH. David