]> git.proxmox.com Git - pve-kernel.git/blame - patches/kernel/0014-KVM-nSVM-Advertise-support-for-flush-by-ASID.patch
rebase patches on top of Ubuntu-6.2.0-39.40
[pve-kernel.git] / patches / kernel / 0014-KVM-nSVM-Advertise-support-for-flush-by-ASID.patch
CommitLineData
9a2449d7 1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
3202de98
SS
2From: Sean Christopherson <seanjc@google.com>
3Date: Wed, 18 Oct 2023 12:41:04 -0700
9a2449d7 4Subject: [PATCH] KVM: nSVM: Advertise support for flush-by-ASID
3202de98
SS
5
6Advertise support for FLUSHBYASID when nested SVM is enabled, as KVM can
7always emulate flushing TLB entries for a vmcb12 ASID, e.g. by running L2
8with a new, fresh ASID in vmcb02. Some modern hypervisors, e.g. VMWare
9Workstation 17, require FLUSHBYASID support and will refuse to run if it's
10not present.
11
12Punt on proper support, as "Honor L1's request to flush an ASID on nested
13VMRUN" is one of the TODO items in the (incomplete) list of issues that
14need to be addressed in order for KVM to NOT do a full TLB flush on every
15nested SVM transition (see nested_svm_transition_tlb_flush()).
16
17Reported-by: Stefan Sterz <s.sterz@proxmox.com>
18Closes: https://lkml.kernel.org/r/b9915c9c-4cf6-051a-2d91-44cc6380f455%40proxmox.com
19Signed-off-by: Sean Christopherson <seanjc@google.com>
20Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
21---
22 arch/x86/kvm/svm/svm.c | 1 +
23 1 file changed, 1 insertion(+)
24
25diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
ddd91a3b 26index cf31babfbbb9..99a7e93b2edf 100644
3202de98
SS
27--- a/arch/x86/kvm/svm/svm.c
28+++ b/arch/x86/kvm/svm/svm.c
ddd91a3b 29@@ -4920,6 +4920,7 @@ static __init void svm_set_cpu_caps(void)
3202de98
SS
30 if (nested) {
31 kvm_cpu_cap_set(X86_FEATURE_SVM);
32 kvm_cpu_cap_set(X86_FEATURE_VMCBCLEAN);
33+ kvm_cpu_cap_set(X86_FEATURE_FLUSHBYASID);
9a2449d7 34
3202de98
SS
35 if (nrips)
36 kvm_cpu_cap_set(X86_FEATURE_NRIPS);