[PATCH v5 11/38] KVM: arm64: Split teardown hypercall into two phases

Will Deacon will at kernel.org
Tue Mar 31 12:24:32 PDT 2026


On Tue, Mar 31, 2026 at 08:15:40PM +0100, Mark Brown wrote:
> On Mon, Mar 30, 2026 at 03:48:12PM +0100, Will Deacon wrote:
> > In preparation for reclaiming protected guest VM pages from the host
> > during teardown, split the current 'pkvm_teardown_vm' hypercall into
> > separate 'start' and 'finalise' calls.
> > 
> > The 'pkvm_start_teardown_vm' hypercall puts the VM into a new 'is_dying'
> > state, which is a point of no return past which no vCPU of the pVM is
> > allowed to run any more.  Once in this new state,
> > 'pkvm_finalize_teardown_vm' can be used to reclaim meta-data and
> > page-table pages from the VM. A subsequent patch will add support for
> > reclaiming the individual guest memory pages.
> 
> We've started seeing WARN_ON()s generated in -next on N1DSP when running
> kvm-unit-tests under pKVM:
> 
> 1821 23:03:59.721620  <4>[   17.558270] ------------[ cut here ]------------
> 1822 23:03:59.725053  <4>[   17.558274] WARNING: arch/arm64/kvm/pkvm.c:373 at __pkvm_pgtable_stage2_unshare+0xbc/0xfc, CPU#3: qemu-system-aar/390

Aha! That's probably the thing I tried to fix today. Please can you try
these patches on top?

https://lore.kernel.org/r/20260331155056.28220-1-will@kernel.org

Thanks,

Will



More information about the linux-arm-kernel mailing list