diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-15 13:59:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-15 13:59:09 -0400 |
commit | 76ca07832842100b14a31ad8996dab7b0c28aa42 (patch) | |
tree | 496df81083fda9be38f8ff88cdc3ef59c2d72a8d /drivers/xen/balloon.c | |
parent | 27d2a8b97ebc4467e47722415b81ebe72d5f654f (diff) | |
parent | b056b6a0144de90707cd22cf7b4f60bf69c86d59 (diff) |
Merge branch 'for-linus' of git://xenbits.xen.org/people/sstabellini/linux-pvhvm
* 'for-linus' of git://xenbits.xen.org/people/sstabellini/linux-pvhvm:
xen: suspend: remove xen_hvm_suspend
xen: suspend: pull pre/post suspend hooks out into suspend_info
xen: suspend: move arch specific pre/post suspend hooks into generic hooks
xen: suspend: refactor non-arch specific pre/post suspend hooks
xen: suspend: add "arch" to pre/post suspend hooks
xen: suspend: pass extra hypercall argument via suspend_info struct
xen: suspend: refactor cancellation flag into a structure
xen: suspend: use HYPERVISOR_suspend for PVHVM case instead of open coding
xen: switch to new schedop hypercall by default.
xen: use new schedop interface for suspend
xen: do not respond to unknown xenstore control requests
xen: fix compile issue if XEN is enabled but XEN_PVHVM is disabled
xen: PV on HVM: support PV spinlocks and IPIs
xen: make the ballon driver work for hvm domains
xen-blkfront: handle Xen major numbers other than XENVBD
xen: do not use xen_info on HVM, set pv_info name to "Xen HVM"
xen: no need to delay xen_setup_shutdown_event for hvm guests anymore
Diffstat (limited to 'drivers/xen/balloon.c')
-rw-r--r-- | drivers/xen/balloon.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index b1661cd416b0..718050ace08f 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c | |||
@@ -232,7 +232,7 @@ static int increase_reservation(unsigned long nr_pages) | |||
232 | set_phys_to_machine(pfn, frame_list[i]); | 232 | set_phys_to_machine(pfn, frame_list[i]); |
233 | 233 | ||
234 | /* Link back into the page tables if not highmem. */ | 234 | /* Link back into the page tables if not highmem. */ |
235 | if (pfn < max_low_pfn) { | 235 | if (!xen_hvm_domain() && pfn < max_low_pfn) { |
236 | int ret; | 236 | int ret; |
237 | ret = HYPERVISOR_update_va_mapping( | 237 | ret = HYPERVISOR_update_va_mapping( |
238 | (unsigned long)__va(pfn << PAGE_SHIFT), | 238 | (unsigned long)__va(pfn << PAGE_SHIFT), |
@@ -280,7 +280,7 @@ static int decrease_reservation(unsigned long nr_pages) | |||
280 | 280 | ||
281 | scrub_page(page); | 281 | scrub_page(page); |
282 | 282 | ||
283 | if (!PageHighMem(page)) { | 283 | if (!xen_hvm_domain() && !PageHighMem(page)) { |
284 | ret = HYPERVISOR_update_va_mapping( | 284 | ret = HYPERVISOR_update_va_mapping( |
285 | (unsigned long)__va(pfn << PAGE_SHIFT), | 285 | (unsigned long)__va(pfn << PAGE_SHIFT), |
286 | __pte_ma(0), 0); | 286 | __pte_ma(0), 0); |
@@ -392,15 +392,19 @@ static struct notifier_block xenstore_notifier; | |||
392 | 392 | ||
393 | static int __init balloon_init(void) | 393 | static int __init balloon_init(void) |
394 | { | 394 | { |
395 | unsigned long pfn, extra_pfn_end; | 395 | unsigned long pfn, nr_pages, extra_pfn_end; |
396 | struct page *page; | 396 | struct page *page; |
397 | 397 | ||
398 | if (!xen_pv_domain()) | 398 | if (!xen_domain()) |
399 | return -ENODEV; | 399 | return -ENODEV; |
400 | 400 | ||
401 | pr_info("xen_balloon: Initialising balloon driver.\n"); | 401 | pr_info("xen_balloon: Initialising balloon driver.\n"); |
402 | 402 | ||
403 | balloon_stats.current_pages = min(xen_start_info->nr_pages, max_pfn); | 403 | if (xen_pv_domain()) |
404 | nr_pages = xen_start_info->nr_pages; | ||
405 | else | ||
406 | nr_pages = max_pfn; | ||
407 | balloon_stats.current_pages = min(nr_pages, max_pfn); | ||
404 | balloon_stats.target_pages = balloon_stats.current_pages; | 408 | balloon_stats.target_pages = balloon_stats.current_pages; |
405 | balloon_stats.balloon_low = 0; | 409 | balloon_stats.balloon_low = 0; |
406 | balloon_stats.balloon_high = 0; | 410 | balloon_stats.balloon_high = 0; |