OSDN Git Service

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)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 22 Oct 2021 09:19:30 +0000 (05:19 -0400)
commite45e9e3998f0001079b09555db5bb3b4257f6746
treefac0246c387d6d408504e6eefddb53fe57447e4b
parenta91a7c7096005113d8e749fd8dfdd3e1eecee263
KVM: X86: Fix tlb flush for tdp in kvm_invalidate_pcid()

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>
arch/x86/kvm/x86.c