From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH] xen: arm: remove hardcoded gnttab location from dom0 Date: Tue, 03 Dec 2013 15:20:37 +0000 Message-ID: <529DF6C5.2050703@linaro.org> References: <1386083062-30104-1-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1386083062-30104-1-git-send-email-ian.campbell@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: Ian Campbell Cc: stefano.stabellini@eu.citrix.com, tim@xen.org, Andre Przywara , xen-devel@lists.xen.org, Chen Baozi , Anup Patel , Pranavkumar Sawargaonkar List-Id: xen-devel@lists.xenproject.org On 12/03/2013 03:04 PM, Ian Campbell wrote: > The DT provided to guests (including dom0) includes a Xen node which, among > other things, describes an MMIO region which can be safely used for grant > table mappings (i.e. it is a hole in the physical address space). For domU we > provide a hardcoded values based on our hardcoded guest virtual machine > layout. However for dom0 we need to fit in with the underlying platform. > Leaving this hardcoded was an oversight which on some platforms could result > in the grant table overlaying RAM or MMIO regions which are in use by domain > 0. > > For the 4.4 release do as we did with the dom0 evtchn PPI and provide a hook > for the platform code to supply a suitable hardcoded address for the platform > (derived from reading the data sheet). Platforms which do not provide the hook > get the existing address as a default. > > After 4.4 we should switch to selecting a region of host RAM which is not RAM > in the guest address map. This should be more flexible and safer but the patch > was looking too complex for 4.4. > > Platform Gnttab Address > ======== ============== > exynos5.c 0xb0000000, confirmed with Julien. > sunxi.c 0x01d00000, confirmed in data sheet. > midway.c 0xff800000, confirmed with Andre, boot tested. > vexpress.c 0xb0000000, existing hardcoded value was selected for vexpress. > omap5.c 0xb0000000, no datasheet, looks safe in DTB. > xgene-storm.c 0x1f800000, reserved according to datasheet, boot tested. > > Signed-off-by: Ian Campbell > Cc: Julien.Grall@linaro.org > Cc: Stefano.Stabellini@eu.citrix.com > Cc: Andre Przywara > Cc: Chen Baozi > Cc: Pranavkumar Sawargaonkar > Cc: Anup Patel > --- > xen/arch/arm/domain_build.c | 7 +++++-- > xen/arch/arm/platform.c | 14 ++++++++++++++ > xen/arch/arm/platforms/midway.c | 3 +++ > xen/arch/arm/platforms/sunxi.c | 3 +++ > xen/arch/arm/platforms/xgene-storm.c | 3 +++ > xen/include/asm-arm/platform.h | 7 +++++++ > 6 files changed, 35 insertions(+), 2 deletions(-) > > diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c > index be39686..332e937 100644 > > /* > diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h > index 5900ee4..bda4e41 100644 > --- a/xen/include/asm-arm/platform.h > +++ b/xen/include/asm-arm/platform.h > @@ -41,6 +41,12 @@ struct platform_desc { > * The IRQ (PPI) to use to inject event channels to dom0. > */ > unsigned int dom0_evtchn_ppi; > + /* > + * The location of a region of physical address space which dom0 > + * can use for grant table mappings. If size is zero defaults to > + * 0xb0000000-0xb0020000. > + */ > + paddr_t dom0_gnttab_start, dom0_gnttab_size; The size looks the same everywhere, can we just hardcode the base address per platform? -- Julien Grall