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

[Xen-devel] [PATCH] xen/arm: bug report: mfn_valid checking


mfn_valid is comparing the mfn with max_page (i.e., maximum number 
of pages). When frametable_base_mfn is non-zero, it does not give 
right results. Should be comparing the mfn starting from the
frametable_base_mfn. Unless, mfn_valid does not check correctly,
and may lead to page fault in some places (especially, when
initializing heap at booting time).


Signed-off-by: Jaeyong Yoo <jaeyong.yoo@xxxxxxxxxxx>
 xen/include/asm-arm/mm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index 27284d0..c5b8367 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -189,7 +189,7 @@ static inline void __iomem *ioremap_wc(paddr_t start, 
size_t len)
 #define mfn_valid(mfn)        ({                                              \
-    unsigned long __m_f_n = (mfn);                                            \
+    unsigned long __m_f_n = (mfn - frametable_base_mfn);                      \
     likely(__m_f_n < max_page);                                               \

Xen-devel mailing list



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