[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v1] xen: Fix emfn calculation in init_domheap_pages()

From: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>

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:
xen/mm: Switch some of page_alloc.c to typesafe MFN

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
CC: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CC: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
CC: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
CC: Jan Beulich <jbeulich@xxxxxxxx>
CC: Julien Grall <julien.grall@xxxxxxx>
CC: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
CC: Tim Deegan <tim@xxxxxxx>
CC: Wei Liu <wei.liu2@xxxxxxxxxx>
CC: xen-devel@xxxxxxxxxxxxx
 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 186b39a..20ee1e4 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)
     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) )

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.