From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752640Ab2INNVd (ORCPT ); Fri, 14 Sep 2012 09:21:33 -0400 Received: from acsinet15.oracle.com ([141.146.126.227]:44049 "EHLO acsinet15.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750742Ab2INNVb (ORCPT ); Fri, 14 Sep 2012 09:21:31 -0400 Date: Fri, 14 Sep 2012 09:10:33 -0400 From: Konrad Rzeszutek Wilk To: Stefano Stabellini Cc: arnd@arndb.de, linux@arm.linux.org.uk, catalin.marinas@arm.com, linaro-dev@lists.linaro.org, linux-arm-kernel@lists.infradead.org, tim@xen.org, Ian.Campbell@citrix.com, xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 14/24] xen/arm: initialize grant_table on ARM Message-ID: <20120914131033.GM25249@phenom.dumpdata.com> References: <1347621207-11294-14-git-send-email-stefano.stabellini@eu.citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1347621207-11294-14-git-send-email-stefano.stabellini@eu.citrix.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: ucsinet22.oracle.com [156.151.31.94] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 14, 2012 at 12:13:16PM +0100, Stefano Stabellini wrote: > Initialize the grant table mapping at the address specified at index 0 > in the DT under the /xen node. > After the grant table is initialized, call xenbus_probe (if not dom0). So we don't really care about the grant's size then? The DT xen.txt talks about it.. > > Changes in v2: > > - introduce GRANT_TABLE_PHYSADDR; > - remove unneeded initialization of boot_max_nr_grant_frames. > > Signed-off-by: Stefano Stabellini > --- > arch/arm/xen/enlighten.c | 14 ++++++++++++++ > 1 files changed, 14 insertions(+), 0 deletions(-) > > diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c > index c2a47a7..036a4d8 100644 > --- a/arch/arm/xen/enlighten.c > +++ b/arch/arm/xen/enlighten.c > @@ -1,8 +1,12 @@ > #include > +#include > +#include > #include > #include > +#include > #include > #include > +#include > #include > #include > #include > @@ -42,6 +46,7 @@ EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_range); > * see Documentation/devicetree/bindings/arm/xen.txt for the > * documentation of the Xen Device Tree format. > */ > +#define GRANT_TABLE_PHYSADDR 0 > static int __init xen_guest_init(void) > { > struct xen_add_to_physmap xatp; > @@ -51,6 +56,7 @@ static int __init xen_guest_init(void) > const char *s = NULL; > const char *version = NULL; > const char *xen_prefix = "xen,xen-"; > + struct resource res; > > node = of_find_compatible_node(NULL, NULL, "xen,xen"); > if (!node) { > @@ -65,6 +71,9 @@ static int __init xen_guest_init(void) > pr_debug("Xen version not found\n"); > return 0; > } > + if (of_address_to_resource(node, GRANT_TABLE_PHYSADDR, &res)) > + return 0; > + xen_hvm_resume_frames = res.start >> PAGE_SHIFT; > xen_domain_type = XEN_HVM_DOMAIN; > > xen_setup_features(); > @@ -98,6 +107,11 @@ static int __init xen_guest_init(void) > * is required to use VCPUOP_register_vcpu_info to place vcpu info > * for secondary CPUs as they are brought up. */ > per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0]; > + > + gnttab_init(); > + if (!xen_initial_domain()) > + xenbus_probe(NULL); > + > return 0; > } > core_initcall(xen_guest_init); > -- > 1.7.2.5