aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen
diff options
context:
space:
mode:
authorDaniel Kiper <dkiper@net-space.pl>2011-03-28 05:33:18 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-03-30 11:54:39 -0400
commit4dfe22f5f24345511c378272189b7504d67767fb (patch)
tree1201f70e51b645b15803d79517418d76747205f1 /drivers/xen
parenta7f3c8f1da1050ad778c3a3930f07c63a5ec570b (diff)
xen/balloon: Simplify HVM integration
Simplify HVM integration proposed by Stefano Stabellini in 53d5522cad291a0e93a385e0594b6aea6b54a071. Acked-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Signed-off-by: Daniel Kiper <dkiper@net-space.pl> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/balloon.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index 61665b2601bf..42a0ba0e71b8 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -246,7 +246,7 @@ static enum bp_state increase_reservation(unsigned long nr_pages)
246 set_phys_to_machine(pfn, frame_list[i]); 246 set_phys_to_machine(pfn, frame_list[i]);
247 247
248 /* Link back into the page tables if not highmem. */ 248 /* Link back into the page tables if not highmem. */
249 if (!xen_hvm_domain() && !PageHighMem(page)) { 249 if (xen_pv_domain() && !PageHighMem(page)) {
250 int ret; 250 int ret;
251 ret = HYPERVISOR_update_va_mapping( 251 ret = HYPERVISOR_update_va_mapping(
252 (unsigned long)__va(pfn << PAGE_SHIFT), 252 (unsigned long)__va(pfn << PAGE_SHIFT),
@@ -293,7 +293,7 @@ static enum bp_state decrease_reservation(unsigned long nr_pages, gfp_t gfp)
293 293
294 scrub_page(page); 294 scrub_page(page);
295 295
296 if (!xen_hvm_domain() && !PageHighMem(page)) { 296 if (xen_pv_domain() && !PageHighMem(page)) {
297 ret = HYPERVISOR_update_va_mapping( 297 ret = HYPERVISOR_update_va_mapping(
298 (unsigned long)__va(pfn << PAGE_SHIFT), 298 (unsigned long)__va(pfn << PAGE_SHIFT),
299 __pte_ma(0), 0); 299 __pte_ma(0), 0);
@@ -429,7 +429,7 @@ EXPORT_SYMBOL(free_xenballooned_pages);
429 429
430static int __init balloon_init(void) 430static int __init balloon_init(void)
431{ 431{
432 unsigned long pfn, nr_pages, extra_pfn_end; 432 unsigned long pfn, extra_pfn_end;
433 struct page *page; 433 struct page *page;
434 434
435 if (!xen_domain()) 435 if (!xen_domain())
@@ -437,11 +437,7 @@ static int __init balloon_init(void)
437 437
438 pr_info("xen/balloon: Initialising balloon driver.\n"); 438 pr_info("xen/balloon: Initialising balloon driver.\n");
439 439
440 if (xen_pv_domain()) 440 balloon_stats.current_pages = xen_pv_domain() ? min(xen_start_info->nr_pages, max_pfn) : max_pfn;
441 nr_pages = xen_start_info->nr_pages;
442 else
443 nr_pages = max_pfn;
444 balloon_stats.current_pages = min(nr_pages, max_pfn);
445 balloon_stats.target_pages = balloon_stats.current_pages; 441 balloon_stats.target_pages = balloon_stats.current_pages;
446 balloon_stats.balloon_low = 0; 442 balloon_stats.balloon_low = 0;
447 balloon_stats.balloon_high = 0; 443 balloon_stats.balloon_high = 0;