提交 4dfe22f5 编写于 作者: D Daniel Kiper 提交者: Konrad Rzeszutek Wilk

xen/balloon: Simplify HVM integration

Simplify HVM integration proposed by Stefano Stabellini
in 53d5522c.
Acked-by: NIan Campbell <ian.campbell@citrix.com>
Acked-by: NDaniel De Graaf <dgdegra@tycho.nsa.gov>
Signed-off-by: NDaniel Kiper <dkiper@net-space.pl>
Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
上级 a7f3c8f1
...@@ -246,7 +246,7 @@ static enum bp_state increase_reservation(unsigned long nr_pages) ...@@ -246,7 +246,7 @@ static enum bp_state increase_reservation(unsigned long nr_pages)
set_phys_to_machine(pfn, frame_list[i]); set_phys_to_machine(pfn, frame_list[i]);
/* Link back into the page tables if not highmem. */ /* Link back into the page tables if not highmem. */
if (!xen_hvm_domain() && !PageHighMem(page)) { if (xen_pv_domain() && !PageHighMem(page)) {
int ret; int ret;
ret = HYPERVISOR_update_va_mapping( ret = HYPERVISOR_update_va_mapping(
(unsigned long)__va(pfn << PAGE_SHIFT), (unsigned long)__va(pfn << PAGE_SHIFT),
...@@ -293,7 +293,7 @@ static enum bp_state decrease_reservation(unsigned long nr_pages, gfp_t gfp) ...@@ -293,7 +293,7 @@ static enum bp_state decrease_reservation(unsigned long nr_pages, gfp_t gfp)
scrub_page(page); scrub_page(page);
if (!xen_hvm_domain() && !PageHighMem(page)) { if (xen_pv_domain() && !PageHighMem(page)) {
ret = HYPERVISOR_update_va_mapping( ret = HYPERVISOR_update_va_mapping(
(unsigned long)__va(pfn << PAGE_SHIFT), (unsigned long)__va(pfn << PAGE_SHIFT),
__pte_ma(0), 0); __pte_ma(0), 0);
...@@ -429,7 +429,7 @@ EXPORT_SYMBOL(free_xenballooned_pages); ...@@ -429,7 +429,7 @@ EXPORT_SYMBOL(free_xenballooned_pages);
static int __init balloon_init(void) static int __init balloon_init(void)
{ {
unsigned long pfn, nr_pages, extra_pfn_end; unsigned long pfn, extra_pfn_end;
struct page *page; struct page *page;
if (!xen_domain()) if (!xen_domain())
...@@ -437,11 +437,7 @@ static int __init balloon_init(void) ...@@ -437,11 +437,7 @@ static int __init balloon_init(void)
pr_info("xen/balloon: Initialising balloon driver.\n"); pr_info("xen/balloon: Initialising balloon driver.\n");
if (xen_pv_domain()) balloon_stats.current_pages = xen_pv_domain() ? min(xen_start_info->nr_pages, max_pfn) : max_pfn;
nr_pages = xen_start_info->nr_pages;
else
nr_pages = max_pfn;
balloon_stats.current_pages = min(nr_pages, max_pfn);
balloon_stats.target_pages = balloon_stats.current_pages; balloon_stats.target_pages = balloon_stats.current_pages;
balloon_stats.balloon_low = 0; balloon_stats.balloon_low = 0;
balloon_stats.balloon_high = 0; balloon_stats.balloon_high = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册