From 87c0718ce7f0fe80065c8f54d99774e0741780f2 Mon Sep 17 00:00:00 2001 From: Oleksandr Tyshchenko Date: Mon, 16 Apr 2018 14:11:09 +0200 Subject: [PATCH] mm: fix emfn calculation in init_domheap_pages() The "end" address must be rounded down before shifting, otherwise we will insert wrong page range to a heap if address isn't page aligned. It seems that a copy-paste mistake took place in the following commit: 0c12972e34b20a26f2b42044b98bf12db7ed62b6 xen/mm: Switch some of page_alloc.c to typesafe MFN Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Jan Beulich Release-acked-by: Juergen Gross --- xen/common/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 186b39a6c8..20ee1e4897 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -2166,7 +2166,7 @@ void init_domheap_pages(paddr_t ps, paddr_t pe) ASSERT(!in_irq()); smfn = maddr_to_mfn(round_pgup(ps)); - emfn = maddr_to_mfn(round_pgup(pe)); + emfn = maddr_to_mfn(round_pgdown(pe)); if ( mfn_x(emfn) <= mfn_x(smfn) ) return; -- 2.39.5