From: Oleksandr Tyshchenko Date: Mon, 16 Apr 2018 12:11:09 +0000 (+0200) Subject: mm: fix emfn calculation in init_domheap_pages() X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~180 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=87c0718ce7f0fe80065c8f54d99774e0741780f2;p=xen.git 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 --- 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;