From: Ian Campbell Subject: Re: [PATCH v5 05/10] xen/arm: p2m: Extend p2m_lookup parameters to retrieve the p2m type Date: Tue, 17 Dec 2013 11:12:56 +0000 Message-ID: <1387278776.27441.37.camel@kazak.uk.xensource.com> References: <1387215452-10951-1-git-send-email-julien.grall@linaro.org> <1387215452-10951-6-git-send-email-julien.grall@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 1VssaE-0007CX-De for xen-devel@lists.xenproject.org; Tue, 17 Dec 2013 11:13:02 +0000 In-Reply-To: <1387215452-10951-6-git-send-email-julien.grall@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 Mon, 2013-12-16 at 17:37 +0000, Julien Grall wrote: > @@ -102,7 +108,10 @@ paddr_t p2m_lookup(struct domain *d, paddr_t paddr) > > done: > if ( pte.p2m.valid ) > + { > maddr = (pte.bits & PADDR_MASK & PAGE_MASK) | (paddr & ~PAGE_MASK); > + *t = pte.p2m.type; This needs to either ASSERT(pte.p2m.type != p2m_invalid) or to explicitly return INVALID_PADDR if it finds p2m_invalid. (which one depends on whether p2m_invalid would be a coding bug here or not) Ian.