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