]> xenbits.xensource.com Git - xen.git/commitdiff
mm: fix emfn calculation in init_domheap_pages()
authorOleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Mon, 16 Apr 2018 12:11:09 +0000 (14:11 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 16 Apr 2018 12:11:09 +0000 (14:11 +0200)
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 <oleksandr_tyshchenko@epam.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/common/page_alloc.c

index 186b39a6c85b7b72c4369809d0918022fe4d0da5..20ee1e489770b59024caee85ed0b18ba1a4e3b8a 100644 (file)
@@ -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;