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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Dec 2021 08:03:22 +0000 (09:03 +0100)
commitd4af6d9749512b6f706d7815a06c8efbe61898c9
treeeee125d6fd8a1d886b8f49f93189dc6c5b329fec
parentc71b5f37b5ff1a673b2e4a91d1b34ea027546e23
KVM: X86: Use vcpu->arch.walk_mmu for kvm_mmu_invlpg()

commit 05b29633c7a956d5675f5fbba70db0d26aa5e73e upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/mmu/mmu.c