From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v4 6/8] xen: arm: add some helpers for assessing p2m pte Date: Tue, 01 Jul 2014 14:17:09 +0100 Message-ID: <53B2B4D5.5070902@linaro.org> References: <1404202883.1829.125.camel@dagon.hellion.org.uk> <1404203222-30111-6-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: <1404203222-30111-6-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 Hi Ian, On 07/01/2014 09:26 AM, Ian Campbell wrote: > Not terribly helpful right now, since they aren't widely used, but makes future > patches easier to read. > > p2m_mapping is unused for the time-being and is therefore commented out > (otherwise the compiler complains about an unused function). > > Signed-off-by: Ian Campbell > --- > v3: Use static functions. s/p2m_entry/p2m_mapping/ as its a better name. > v2: clarify common on p2m_{table,entry} > --- > xen/arch/arm/p2m.c | 30 +++++++++++++++++++++++------- > 1 file changed, 23 insertions(+), 7 deletions(-) > > diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c > index 8a6d295..b51dc1b 100644 > --- a/xen/arch/arm/p2m.c > +++ b/xen/arch/arm/p2m.c > @@ -14,6 +14,22 @@ > #define P2M_FIRST_ORDER 1 > #define P2M_FIRST_ENTRIES (LPAE_ENTRIES< > +static bool_t p2m_valid(lpae_t pte) { > + return pte.p2m.valid; > +} NIT: The { has to be on another line. > +/* These two can only be used on L0..L2 ptes because L3 mappings set > + * the table bit and therefore these would return the opposite to what > + * you would expect. */ > +static bool_t p2m_table(lpae_t pte) > +{ > + return p2m_valid(pte) && pte.p2m.table; > +} > +#if 0 > +static bool_t p2m_mapping(lpae_t pte) { Same here. > + return p2m_valid(pte) && !pte.p2m.table; > +} > +#endif > + With theses small changes: Acked-by: Julien Grall Regards, -- Julien Grall