[PATCH v5 11/38] KVM: arm64: Split teardown hypercall into two phases
Mark Brown
broonie at kernel.org
Tue Mar 31 12:15:40 PDT 2026
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
...
1839 23:03:59.850178 <4>[ 17.697247] Call trace:
1840 23:03:59.853079 <4>[ 17.699940] __pkvm_pgtable_stage2_unshare+0xbc/0xfc (P)
1841 23:03:59.865729 <4>[ 17.705500] pkvm_pgtable_stage2_destroy_range+0x90/0x214
1842 23:03:59.866226 <4>[ 17.711145] kvm_stage2_destroy+0x74/0xd0
1843 23:03:59.869119 <4>[ 17.715403] kvm_free_stage2_pgd+0x5c/0xc0
1844 23:03:59.881700 <4>[ 17.719746] kvm_uninit_stage2_mmu+0x1c/0x34
1845 23:03:59.882197 <4>[ 17.724262] kvm_arch_flush_shadow_all+0x6c/0x84
1846 23:03:59.885123 <4>[ 17.729127] kvm_mmu_notifier_release+0x30/0x84
1847 23:03:59.897681 <4>[ 17.733905] __mmu_notifier_release+0x74/0x264
1848 23:03:59.898181 <4>[ 17.738596] exit_mmap+0x260/0x268
1849 23:03:59.898513 <4>[ 17.742247] __mmput+0x38/0x120
1850 23:03:59.898817 <4>[ 17.745637] mmput+0x50/0x5c
1851 23:03:59.901098 <4>[ 17.748766] do_exit+0x220/0x8f4
A bisect points at this patch:
git bisect start
# status: waiting for both good and bad commits
# bad: [cf7c3c02fdd0dfccf4d6611714273dcb538af2cb] Add linux-next specific files for 20260330
git bisect bad cf7c3c02fdd0dfccf4d6611714273dcb538af2cb
# status: waiting for good commit(s), bad commit known
# good: [a010730e610019b6d010ec43ce737cb59a37809d] Merge branch 'for-linux-next-fixes' of https://gitlab.freedesktop.org/drm/misc/kernel.git
git bisect good a010730e610019b6d010ec43ce737cb59a37809d
# good: [5c552968883f4b10da9a1baeefd38a28afe993cd] Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git
git bisect good 5c552968883f4b10da9a1baeefd38a28afe993cd
# good: [de8f4e3b3d9aec5d4fdd5113ff09a6904b8a9f91] Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git
git bisect good de8f4e3b3d9aec5d4fdd5113ff09a6904b8a9f91
# bad: [7b3de9ac54f51bf09357802f02f0672de8bd49c0] Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git
git bisect bad 7b3de9ac54f51bf09357802f02f0672de8bd49c0
# good: [6778bd8a07f6f11414325ba6fe6d263f6b6994c9] Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
git bisect good 6778bd8a07f6f11414325ba6fe6d263f6b6994c9
# good: [1cb1ca5899ab60d85e21ccf38da645a875fcf242] Merge branch 'edac-for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/ras/ras.git
git bisect good 1cb1ca5899ab60d85e21ccf38da645a875fcf242
# bad: [4476dfd35bb0428c406fa68ce0d2125960535150] Merge branch 'next' of https://github.com/kvm-x86/linux.git
git bisect bad 4476dfd35bb0428c406fa68ce0d2125960535150
# good: [8f3483cd04d6ee6579594417d4a19394de63463a] Merge branch 'selftests'
git bisect good 8f3483cd04d6ee6579594417d4a19394de63463a
# bad: [5ad2ff071b5980f072a85c8114649218971c586e] Merge branch kvm-arm64/pkvm-protected-guest into kvmarm-master/next
git bisect bad 5ad2ff071b5980f072a85c8114649218971c586e
# bad: [9ff714a09222128da16900fc7c15dea65692fc26] KVM: arm64: Inject SIGSEGV on illegal accesses
git bisect bad 9ff714a09222128da16900fc7c15dea65692fc26
# good: [f0877a1455cc6a93be14e4da741ce26ac0d6ca6d] KVM: arm64: Prevent unsupported memslot operations on protected VMs
git bisect good f0877a1455cc6a93be14e4da741ce26ac0d6ca6d
# bad: [ea03466e806fea942841a41cfaab8db8c851aa71] KVM: arm64: Handle aborts from protected VMs
git bisect bad ea03466e806fea942841a41cfaab8db8c851aa71
# bad: [6c58f914eb9c4ce5225d03183ae1290d72b5f639] KVM: arm64: Split teardown hypercall into two phases
git bisect bad 6c58f914eb9c4ce5225d03183ae1290d72b5f639
# good: [73c55be08932a348f8b0a44f561c33eaa2cf1ad2] KVM: arm64: Ignore -EAGAIN when mapping in pages for the pKVM host
git bisect good 73c55be08932a348f8b0a44f561c33eaa2cf1ad2
# first bad commit: [6c58f914eb9c4ce5225d03183ae1290d72b5f639] KVM: arm64: Split teardown hypercall into two phases
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20260331/5f535807/attachment.sig>
More information about the linux-arm-kernel
mailing list