From: Ian Campbell Subject: Re: [PATCH 08/14] xen: balloon: allow PVMMU interfaces to be compiled out Date: Fri, 5 Oct 2012 14:33:02 +0100 Message-ID: <1349443982.20946.100.camel@zakaz.uk.xensource.com> References: <1349363496.866.49.camel@zakaz.uk.xensource.com> <1349363515-26190-8-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: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: "xen-devel@lists.xen.org" , Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org On Fri, 2012-10-05 at 14:19 +0100, Stefano Stabellini wrote: > On Thu, 4 Oct 2012, Ian Campbell wrote: > > The ARM platform has no concept of PVMMU and therefor no > > HYPERVISOR_update_va_mapping et al. Allow this code to be compiled out > > when not required. > > > > Signed-off-by: Ian Campbell > > I am unsure whether it is worth a new symbol and two ifdef's ARM doesn't compile without it, since HYPERVISOR_update_va_mapping doesn't exist. Do you have a preferable alternative? I'm not sure how much more of this sort of thing there will be as we enable more features on the ARM port. > > > > arch/x86/xen/Kconfig | 1 + > > drivers/xen/Kconfig | 3 +++ > > drivers/xen/balloon.c | 4 ++++ > > 3 files changed, 8 insertions(+), 0 deletions(-) > > > > diff --git a/arch/x86/xen/Kconfig b/arch/x86/xen/Kconfig > > index fdce49c..c31ee77 100644 > > --- a/arch/x86/xen/Kconfig > > +++ b/arch/x86/xen/Kconfig > > @@ -6,6 +6,7 @@ config XEN > > bool "Xen guest support" > > select PARAVIRT > > select PARAVIRT_CLOCK > > + select XEN_HAVE_PVMMU > > depends on X86_64 || (X86_32 && X86_PAE && !X86_VISWS) > > depends on X86_CMPXCHG && X86_TSC > > help > > diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig > > index d4dffcd..9c00652 100644 > > --- a/drivers/xen/Kconfig > > +++ b/drivers/xen/Kconfig > > @@ -204,4 +204,7 @@ config XEN_MCE_LOG > > Allow kernel fetching MCE error from Xen platform and > > converting it into Linux mcelog format for mcelog tools > > > > +config XEN_HAVE_PVMMU > > + bool > > + > > endmenu > > diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c > > index 1b56ae0..cfe47dae 100644 > > --- a/drivers/xen/balloon.c > > +++ b/drivers/xen/balloon.c > > @@ -360,6 +360,7 @@ static enum bp_state increase_reservation(unsigned long nr_pages) > > if (!xen_feature(XENFEAT_auto_translated_physmap)) > > set_phys_to_machine(pfn, frame_list[i]); > > > > +#ifdef CONFIG_XEN_HAVE_PVMMU > > /* Link back into the page tables if not highmem. */ > > if (xen_pv_domain() && !PageHighMem(page) && > > !xen_feature(XENFEAT_auto_translated_physmap)) { > > @@ -371,6 +372,7 @@ static enum bp_state increase_reservation(unsigned long nr_pages) > > 0); > > BUG_ON(ret); > > } > > +#endif > > > > /* Relinquish the page back to the allocator. */ > > ClearPageReserved(page); > > @@ -419,6 +421,7 @@ static enum bp_state decrease_reservation(unsigned long nr_pages, gfp_t gfp) > > > > scrub_page(page); > > > > +#ifdef CONFIG_XEN_HAVE_PVMMU > > if (xen_pv_domain() && !PageHighMem(page) && > > !xen_feature(XENFEAT_auto_translated_physmap)) { > > ret = HYPERVISOR_update_va_mapping( > > @@ -426,6 +429,7 @@ static enum bp_state decrease_reservation(unsigned long nr_pages, gfp_t gfp) > > __pte_ma(0), 0); > > BUG_ON(ret); > > } > > +#endif > > } > > > > /* Ensure that ballooned highmem pages don't have kmaps. */ > > -- > > 1.7.2.5 > >