From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v5 2/4] xen/arm: introduce a generic p2m walker and use it in p2m_lookup Date: Tue, 10 Sep 2013 19:38:55 +0100 Message-ID: <1378838335.3057.43.camel@dagon.hellion.org.uk> References: <1378742763-24299-2-git-send-email-stefano.stabellini@eu.citrix.com> <1378805207.21748.48.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" 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: Stefano Stabellini Cc: xen-devel@lists.xensource.com, tim@xen.org List-Id: xen-devel@lists.xenproject.org On Tue, 2013-09-10 at 19:00 +0100, Stefano Stabellini wrote: > > > - /* This bit must be one in the level 3 entry */ > > > - if ( !pte.p2m.table ) > > > - pte.bits = 0; > > > + if ( cur_first_offset != first_table_offset(paddr) ) > > > + { > > > + if (second) unmap_domain_page(second); > > > + second = map_domain_page(first[first_table_offset(paddr)].p2m.base); > > > + cur_first_offset = first_table_offset(paddr); > > > + } > > > + level++; > > > + if ( !second || > > > > ASSERT(second) seems reasonable here, I think, since it would indicate > > we had screwed up the p2m pretty badly. > > I think it's possible: what if a memory range is simply missing from the > p2m? The second level pagetable pages could be missing too. Then the level above it shouldn't have the valid bit set. Ian.