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

Re: [Xen-devel] PV Shim ballooning

On 11/02/2020 16:01, Roger Pau Monné wrote:
> On Tue, Feb 11, 2020 at 01:39:42PM +0000, Andrew Cooper wrote:
>> Shim can't decrease reservation (HVM with L0 Xen) on any frame who's
>> reference count didn't drop to 0 from the PV guests' call, and there is
>> nothing presently to check this condition.
> But shim will only balloon out free domheap pages (as it gets them
> from alloc_domheap_pages), and those shouldn't have any reference by
> the guest?

Correct, however all the guests that we test in XenRT behave properly.
I'm not aware of any guest that keeps references after calling

>> Short of a PGC bit and extra shim logic in free_domheap_page(), I can't
>> see any way to reconcile the behaviour, except to change the semantics
>> of decrease reservation for PV guests.  In practice, this would be far
>> more sensible behaviour, but we have no idea if existing PV guests would
>> manage.
> Hm, I guess we could add some hook to free_domheap_page in order to
> remove them from the physmap once the guest frees them?
> How does Xen know which pages freed by a PV guest should be ballooned
> out?

It doesn't currently.

> Is that done solely based on the fact that those pages don't have any
> reference?


> That doesn't seem like a viable option unless we add a new bit to the
> page struct in order to signal that those pages should be ballooned
> out once freed, as you suggest.

Agree. But as I said I'm not aware of any guest that violates the
invariant of decrease_reservation() being the last call.


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.