]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: X86: Fix tlb flush for tdp in kvm_invalidate_pcid()
authorLai Jiangshan <laijs@linux.alibaba.com>
Tue, 19 Oct 2021 11:01:51 +0000 (19:01 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Dec 2021 08:32:34 +0000 (09:32 +0100)
commit2d6f060858e0010bee55ca708da7f10481db69c1
tree6fded8d603339251a23314e3b307617bbed089fd
parent49fd4d424cb605b22e4919888f5236948e5b156d
KVM: X86: Fix tlb flush for tdp in kvm_invalidate_pcid()

[ Upstream commit 6e39f15faf4552e2d3e1cb7cc1f0fbfbdadf0988 ]

The KVM doesn't know whether any TLB for a specific pcid is cached in
the CPU when tdp is enabled.  So it is better to flush all the guest
TLB when invalidating any single PCID context.

The case is very rare or even impossible since KVM generally doesn't
intercept CR3 write or INVPCID instructions when tdp is enabled, so the
fix is mostly for the sake of overall robustness.

Signed-off-by: Lai Jiangshan <laijs@linux.alibaba.com>
Message-Id: <20211019110154.4091-2-jiangshanlai@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/kvm/x86.c