Port-xen archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pmap cleanup approach.

On Sat, Feb 16, 2019 at 06:20:56PM +0530, Cherry G.Mathew wrote:
> Manuel Bouyer <bouyer%antioche.eu.org@localhost> writes:
> > On Sat, Feb 16, 2019 at 03:23:35PM +0530, Cherry G.Mathew wrote:
> >> [...]
> >> 
> >> Finally, as an experiment for later (once PVHVM is stable) I want to
> >> experiment with removing the idea of 'p2m/m2p' tables in their entirety
> >> and use the power of our uvm_hotplug(9) infrastructure to directly
> >> manage 'machine frames', however fragmented they are.
> >
> > Not only the memory space may be fragmented, but it's dynamic.
> > This means that an in-use segment could be split in 2, (or more likely 3)
> > segments. I don't see this functionality in uvm_hotplug(9).
> >
> uvm_hotplug(9) can manage RAM extents upto page size granularity and do
> dynamic insert/remove - what it can't do is to figure out all
> dependencies such as mapping/swap related updates.
> Does xen pull the rug from underneath us with the p2m/m2p tables ? ie;
> would the tables be updated by the hypervisor when this dynamic action
> happens rather than via a fault or other callback ?

AFAIK no, it'll happens after a grant, or

What I mean is: you have a segment from e.g. 0x1000000 to 0x2000000,
with contigous machine addresses.
You give page 0x1522000 to Xen, which gives you back anoter page,
with a different machine address. No you have to split the 0x1000000 to
0x2000000 to 3 different segments, 0x1000000 to 0x1521000,
0x1522000 to 0x1522000, and 0x1523000 to 0x2000000. But other pages
in the initial segments may be busy, so you can't just remove the segment.

Can hvm_hotplug handle this ?

Also, when I initially worked on dom0 support, I noticed that
PA and MA where (intentionally I guess) in reverse order. That it,
if you have e.g. PA addresses 0x1000, 0x2000, 0x3000, ... the matching
MA would be 0x1a000, 0x19000, 0x18000, ...
If this is still true, you'll have one segment per page in uvm_hotplug(9).

BTW, if you drop p2m and m2p, how will you get the MA for a given PA ?

Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference

Home | Main Index | Thread Index | Old Index