|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v5 2/4] xen/arm: introduce a generic p2m walker and use it in p2m_lookup
On Tue, 10 Sep 2013, Ian Campbell wrote:
> This function is not actually all the p2m specific in the end, by using
> lpae_t.walk instead of lpae_t.pt (see dump_pt_walk) you could make it
> useful for e.g. hyp pagetable walks too. (e.g. dump_hyp_walk). In theory
> it could also be used for LPAE guest walks too, but we'd need a separate
> walker for non-LPAE guests.
I could move the function somewhere more generic but..
> If we wanted to replace dump_hyp_walk with this then calling the
> callback for each level would be required.
.. even though the difference is not likely to be big, still it would
slow down p2m_walker, that could even be called as often as twice per DMA
request.
Maybe it's best to keep it as it is?
> >
> > spin_lock(&p2m->lock);
> >
> > first = __map_domain_page(p2m->first_level);
> >
> > - pte = first[first_table_offset(paddr)];
> > - if ( !pte.p2m.valid || !pte.p2m.table )
> > - goto done;
> > + if ( !first ||
> > + !first[first_table_offset(paddr)].p2m.valid )
> > + goto err;
>
> Why is the first level handled specially outside the loop? What happens
> if order is such that we span multiple first level entries?
I think that the assumption in the original code was that the size
couldn't be larger than 1GB. It isn't the case anymore, I'll fix this.
> > - /* 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.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |