diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2012-10-03 07:17:50 -0400 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2012-11-29 07:59:13 -0500 |
commit | c2374bf57e7861039bb129ead538515502ef7860 (patch) | |
tree | 3b32e9891ec0b133e676c4cc5cf9617499310725 | |
parent | d71f513985c22f1050295d1a7e4327cf9fb060da (diff) |
xen: balloon: allow PVMMU interfaces to be compiled out
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.
In some similar situations (e.g. P2M) we have defined dummy functions
to avoid this, however I think we can/should draw the line at dummying
out actual hypercalls.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
-rw-r--r-- | arch/x86/xen/Kconfig | 1 | ||||
-rw-r--r-- | drivers/xen/Kconfig | 3 | ||||
-rw-r--r-- | drivers/xen/balloon.c | 5 |
3 files changed, 8 insertions, 1 deletions
diff --git a/arch/x86/xen/Kconfig b/arch/x86/xen/Kconfig index fdce49c7aff6..c31ee77e1ec1 100644 --- a/arch/x86/xen/Kconfig +++ b/arch/x86/xen/Kconfig | |||
@@ -6,6 +6,7 @@ config XEN | |||
6 | bool "Xen guest support" | 6 | bool "Xen guest support" |
7 | select PARAVIRT | 7 | select PARAVIRT |
8 | select PARAVIRT_CLOCK | 8 | select PARAVIRT_CLOCK |
9 | select XEN_HAVE_PVMMU | ||
9 | depends on X86_64 || (X86_32 && X86_PAE && !X86_VISWS) | 10 | depends on X86_64 || (X86_32 && X86_PAE && !X86_VISWS) |
10 | depends on X86_CMPXCHG && X86_TSC | 11 | depends on X86_CMPXCHG && X86_TSC |
11 | help | 12 | help |
diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig index 126d8ce591ce..cabfa97f4674 100644 --- a/drivers/xen/Kconfig +++ b/drivers/xen/Kconfig | |||
@@ -206,4 +206,7 @@ config XEN_MCE_LOG | |||
206 | Allow kernel fetching MCE error from Xen platform and | 206 | Allow kernel fetching MCE error from Xen platform and |
207 | converting it into Linux mcelog format for mcelog tools | 207 | converting it into Linux mcelog format for mcelog tools |
208 | 208 | ||
209 | config XEN_HAVE_PVMMU | ||
210 | bool | ||
211 | |||
209 | endmenu | 212 | endmenu |
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index d6886d90ccfd..a56776dbe095 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c | |||
@@ -359,6 +359,7 @@ static enum bp_state increase_reservation(unsigned long nr_pages) | |||
359 | 359 | ||
360 | set_phys_to_machine(pfn, frame_list[i]); | 360 | set_phys_to_machine(pfn, frame_list[i]); |
361 | 361 | ||
362 | #ifdef CONFIG_XEN_HAVE_PVMMU | ||
362 | /* Link back into the page tables if not highmem. */ | 363 | /* Link back into the page tables if not highmem. */ |
363 | if (xen_pv_domain() && !PageHighMem(page)) { | 364 | if (xen_pv_domain() && !PageHighMem(page)) { |
364 | int ret; | 365 | int ret; |
@@ -368,6 +369,7 @@ static enum bp_state increase_reservation(unsigned long nr_pages) | |||
368 | 0); | 369 | 0); |
369 | BUG_ON(ret); | 370 | BUG_ON(ret); |
370 | } | 371 | } |
372 | #endif | ||
371 | 373 | ||
372 | /* Relinquish the page back to the allocator. */ | 374 | /* Relinquish the page back to the allocator. */ |
373 | ClearPageReserved(page); | 375 | ClearPageReserved(page); |
@@ -416,13 +418,14 @@ static enum bp_state decrease_reservation(unsigned long nr_pages, gfp_t gfp) | |||
416 | 418 | ||
417 | scrub_page(page); | 419 | scrub_page(page); |
418 | 420 | ||
421 | #ifdef CONFIG_XEN_HAVE_PVMMU | ||
419 | if (xen_pv_domain() && !PageHighMem(page)) { | 422 | if (xen_pv_domain() && !PageHighMem(page)) { |
420 | ret = HYPERVISOR_update_va_mapping( | 423 | ret = HYPERVISOR_update_va_mapping( |
421 | (unsigned long)__va(pfn << PAGE_SHIFT), | 424 | (unsigned long)__va(pfn << PAGE_SHIFT), |
422 | __pte_ma(0), 0); | 425 | __pte_ma(0), 0); |
423 | BUG_ON(ret); | 426 | BUG_ON(ret); |
424 | } | 427 | } |
425 | 428 | #endif | |
426 | } | 429 | } |
427 | 430 | ||
428 | /* Ensure that ballooned highmem pages don't have kmaps. */ | 431 | /* Ensure that ballooned highmem pages don't have kmaps. */ |