From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH 5/6] xen: arm: add some helpers for assessing p2m pte Date: Tue, 10 Jun 2014 12:37:52 +0100 Message-ID: <5396EE10.8060804@linaro.org> References: <1402394127.29980.52.camel@kazak.uk.xensource.com> <1402394278-9850-5-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1402394278-9850-5-git-send-email-ian.campbell@citrix.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: Ian Campbell , xen-devel@lists.xen.org Cc: tim@xen.org, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On 06/10/2014 10:57 AM, Ian Campbell wrote: > mask = SECOND_MASK; > second = map_domain_page(pte.p2m.base); > pte = second[second_table_offset(paddr)]; > - if ( !pte.p2m.valid || !pte.p2m.table ) > + if ( !p2m_table(pte) ) > goto done; > > mask = THIRD_MASK; > @@ -156,11 +161,11 @@ paddr_t p2m_lookup(struct domain *d, paddr_t paddr, p2m_type_t *t) > pte = third[third_table_offset(paddr)]; > > /* This bit must be one in the level 3 entry */ > - if ( !pte.p2m.table ) > + if ( !p2m_table(pte) ) > pte.bits = 0; > > done: > - if ( pte.p2m.valid ) > + if ( p2m_valid(pte) ) Regardless the current check, I think this should be p2m_entry(pte) to help code comprehension. Indeed, the can only get the address if the pte is pointed to a memory block. Regards, -- Julien Grall