[PATCH v4 20/25] KVM: arm64: Return guest memory from EL2 via dedicated teardown memcache

Will Deacon will at kernel.org
Wed Oct 19 09:24:42 PDT 2022


On Wed, Oct 19, 2022 at 03:52:10PM +0000, Quentin Perret wrote:
> On Monday 17 Oct 2022 at 12:52:04 (+0100), Will Deacon wrote:
> >  struct kvm_protected_vm {
> >  	pkvm_handle_t handle;
> >  	struct mutex vm_lock;
> > -
> > -	struct {
> > -		void *pgd;
> > -		void *vm;
> > -		void *vcpus[KVM_MAX_VCPUS];
> > -	} hyp_donations;
> > +	struct kvm_hyp_memcache teardown_mc;
> >  };
> 
> Argh, I guess that somewhat invalidates my previous comment. Oh well :-)

Yup! There's a slight chicken-and-egg problem here, so we introduce
explicit tracking of the donations in the host to start with, but then
once we have the teardown memcache we can stop tracking things explicitly
and remove the temporary pointers.

Will



More information about the linux-arm-kernel mailing list