OSDN Git Service

KVM: X86: Use vcpu->arch.walk_mmu for kvm_mmu_invlpg()
authorLai Jiangshan <laijs@linux.alibaba.com>
Wed, 24 Nov 2021 12:20:46 +0000 (20:20 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 26 Nov 2021 13:14:21 +0000 (08:14 -0500)
commit05b29633c7a956d5675f5fbba70db0d26aa5e73e
tree50834921a7ecf3b0d01dde1b44760f278892ed17
parent12ec33a705749e18d9588b0a0e69e02821371156
KVM: X86: Use vcpu->arch.walk_mmu for kvm_mmu_invlpg()

INVLPG operates on guest virtual address, which are represented by
vcpu->arch.walk_mmu.  In nested virtualization scenarios,
kvm_mmu_invlpg() was using the wrong MMU structure; if L2's invlpg were
emulated by L0 (in practice, it hardly happen) when nested two-dimensional
paging is enabled, the call to ->tlb_flush_gva() would be skipped and
the hardware TLB entry would not be invalidated.

Signed-off-by: Lai Jiangshan <laijs@linux.alibaba.com>
Message-Id: <20211124122055.64424-5-jiangshanlai@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c