From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v2] xen/arm: add lower-bound check in mfn_valid Date: Mon, 26 Aug 2013 15:45:04 +0100 Message-ID: <521B69F0.505@linaro.org> References: <1377248921-18252-1-git-send-email-jaeyong.yoo@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1377248921-18252-1-git-send-email-jaeyong.yoo@samsung.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jaeyong Yoo Cc: Ian Campbell , Andre Przywara , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 08/23/2013 10:08 AM, Jaeyong Yoo wrote: > mfn_valid only checks the upper-bound of mfn (max_page). > Add the lower-bound check of mfn (frametable_base_mfn). Thanks! This patch fixes Xen boot on different boards (Arndale and I guess Midway) after the patch "xen: arm: reduce the size of the xen heap to max 1/8 RAM size". > Signed-off-by: Jaeyong Yoo Acked-by: Julien Grall > --- > 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..97c2ee0 100644 > --- a/xen/include/asm-arm/mm.h > +++ b/xen/include/asm-arm/mm.h > @@ -190,7 +190,7 @@ static inline void __iomem *ioremap_wc(paddr_t start, size_t len) > > #define mfn_valid(mfn) ({ \ > unsigned long __m_f_n = (mfn); \ > - likely(__m_f_n < max_page); \ > + likely(__m_f_n >= frametable_base_mfn && __m_f_n < max_page); \ > }) > > #define max_pdx max_page > -- Julien Grall