summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorDan Carpenter <dan@cryspen.com>2026-11-11 14:11:19 +0300
committerMarc Zyngier <maz@kernel.org>2026-11-11 20:36:02 +0000
commita7602ea542d4e5d1322973349f1d987cb9db3363 (patch)
tree5b5ad312b61d3df04307dabcf64f550e658c5e66 /tools/perf/scripts/python
parent93dc3df29b2a63271b294a1ad0740f7aee24fb59 (diff)
KVM: arm64: nv: Initialize hw_mmu to NULL for nested vCPUs
Before commit 6ded46b5a4fd ("KVM: arm64: nv: Keep reference on stage-2 MMU when scheduled out"), kvm_vcpu_load_hw_mmu() would set ->hw_mmu on every load. Now it only sets it when it is set to NULL. In kvm_vcpu_init_nested() the vcpu->arch.hw_mmu points to &kvm->arch.mmu from when it was set in kvm_arch_vcpu_create(). Normally what happens next is a two step process. KVM_ARM_VCPU_INIT calls kvm_reset_vcpu_core() and that sets the vcpu into hyp context (vEL2). Then KVM_RUN calls kvm_vcpu_load_hw_mmu() which doesn't do anything. But that is fine because we are in hyp context and the ->hw_mmu already is pointing to the correct place. However if, for example, we are restoring a vcpu that was saved in L2 context, then the VMM uses KVM_SET_ONE_REG to overwrite the vEL2 state that kvm_reset_vcpu_core() set up, and the vCPU is in L2 context when KVM_RUN loads it for the first time. Ideally, kvm_vcpu_load_hw_mmu() would set the hw_mm to point to L2's page tables but, since is non-NULL, it leaves it as is. At this point L2 can access L1's memory. Fix this bug by setting ->hw_mmu to NULL in kvm_vcpu_init_nested() so that kvm_vcpu_load_hw_mmu() always sets it correctly on the first load. Fixes: 6ded46b5a4fd ("KVM: arm64: nv: Keep reference on stage-2 MMU when scheduled out") Cc: stable@vger.kernel.org Signed-off-by: Dan Carpenter <dan@cryspen.com> Link: https://patch.msgid.link/d3571fb535e1832d2a067649f294b83d824d4350.1794395321.git.dan@cryspen.com [maz: added comment] Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions