diff options
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; |