From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v2 2/9] xen: arm: Implement variable levels in dump_pt_walk Date: Mon, 08 Sep 2014 14:24:12 -0700 Message-ID: <540E1E7C.6030604@linaro.org> References: <4427aba8dad3155fca151a0b63bfdf78e3a91033.1409847257.git.ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: 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, vijay.kilari@gmail.com, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org Hi Ian, On 04/09/14 09:14, Ian Campbell wrote: > -void dump_pt_walk(lpae_t *first, paddr_t addr) > +void dump_pt_walk(lpae_t *root, paddr_t addr, > + unsigned int root_level) > { > - lpae_t *second = NULL, *third = NULL; > + static const char *level_strs[4] = { "0TH", "1ST", "2ND", "3RD" }; > + const unsigned int offsets[4] = { > + zeroeth_table_offset(addr), > + first_table_offset(addr), > + second_table_offset(addr), > + third_table_offset(addr) > + }; > + lpae_t pte, *mappings[4] = { 0, }; Xen never maps the next level when level == 3, shoudn't mappings[3] enough? [..] > + /* mappings[root_level] is provided by the caller so don't unmap that */ > + do > + { > + unmap_domain_page(mappings[level]); > + } > + while( level-- > root_level ); NIT: It looks like we commonly use the coding style do { } while ( ... ) Regards, -- Julien Grall