From: Ian Campbell Subject: Re: [PATCH v2 04/10] xen/arm: Store p2m type in each page of the guest Date: Tue, 10 Dec 2013 13:58:57 +0000 Message-ID: <1386683937.30568.23.camel@kazak.uk.xensource.com> References: <1386560047-17500-1-git-send-email-julien.grall@linaro.org> <1386560047-17500-5-git-send-email-julien.grall@linaro.org> <1386608007.7812.68.camel@kazak.uk.xensource.com> <52A67486.4020702@linaro.org> <1386668269.11925.12.camel@kazak.uk.xensource.com> <52A71C17.1070506@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VqNq2-0006T1-Ov for xen-devel@lists.xenproject.org; Tue, 10 Dec 2013 13:59:03 +0000 In-Reply-To: <52A71C17.1070506@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: xen-devel@lists.xenproject.org, tim@xen.org, stefano.stabellini@citrix.com, patches@linaro.org List-Id: xen-devel@lists.xenproject.org On Tue, 2013-12-10 at 13:50 +0000, Julien Grall wrote: > > On 12/10/2013 09:37 AM, Ian Campbell wrote: > > On Tue, 2013-12-10 at 01:55 +0000, Julien Grall wrote: > >> On 12/09/2013 04:53 PM, Ian Campbell wrote: > >>> On Mon, 2013-12-09 at 03:34 +0000, Julien Grall wrote: > >>>> + BUILD_BUG_ON(p2m_max_real_type > (2 << 4)); > >>> > >>> 2<<4 is 32. > >>> > >>> I think you want either 1<<4, 2^4 or just 16 (my preference is 16). And > >> > >> Right. > >> > >>> I think it should be >= since the valid values are 0..15 inclusive. > >> > >> No, because p2m_max_real_type won't be store in the p2m, so we can have > >> 16 values [0..15] and p2m_max_real_type will be the 17th (ie 16). > > > > If p2m_max_real_type will be the 17th (ie 16) then the check needs to be > > p2m_max_real_type >= 16. > > No because p2m_max_real_type = 16 is valid. > Which is invalid is foo = 16 and p2m_max_real_type = 17. Oh right, because it's actually the one after the last valid one. OK. Ian.