From: Maxim Levitsky <mlevitsk@redhat.com>
To: Sean Christopherson <seanjc@google.com>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Stefan Sterz <s.sterz@proxmox.com>
Subject: Re: [PATCH 2/2] KVM: nSVM: Advertise support for flush-by-ASID
Date: Mon, 20 Nov 2023 13:42:23 +0200 [thread overview]
Message-ID: <4eaec4f20dd463ae46418ebf460de43b15789950.camel@redhat.com> (raw)
In-Reply-To: <20231018194104.1896415-3-seanjc@google.com>
On Wed, 2023-10-18 at 12:41 -0700, Sean Christopherson wrote:
> Advertise support for FLUSHBYASID when nested SVM is enabled, as KVM can
> always emulate flushing TLB entries for a vmcb12 ASID, e.g. by running L2
> with a new, fresh ASID in vmcb02. Some modern hypervisors, e.g. VMWare
> Workstation 17, require FLUSHBYASID support and will refuse to run if it's
> not present.
>
> Punt on proper support, as "Honor L1's request to flush an ASID on nested
> VMRUN" is one of the TODO items in the (incomplete) list of issues that
> need to be addressed in order for KVM to NOT do a full TLB flush on every
> nested SVM transition (see nested_svm_transition_tlb_flush()).
>
> Reported-by: Stefan Sterz <s.sterz@proxmox.com>
> Closes: https://lkml.kernel.org/r/b9915c9c-4cf6-051a-2d91-44cc6380f455%40proxmox.com
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> arch/x86/kvm/svm/svm.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
> index 1785de7dc98b..9cf7eef161ff 100644
> --- a/arch/x86/kvm/svm/svm.c
> +++ b/arch/x86/kvm/svm/svm.c
> @@ -5083,6 +5083,7 @@ static __init void svm_set_cpu_caps(void)
> if (nested) {
> kvm_cpu_cap_set(X86_FEATURE_SVM);
> kvm_cpu_cap_set(X86_FEATURE_VMCBCLEAN);
> + kvm_cpu_cap_set(X86_FEATURE_FLUSHBYASID);
>
> if (nrips)
> kvm_cpu_cap_set(X86_FEATURE_NRIPS);
Nitpick: if you think that this is worth it,
maybe we can add a comment here on why we can 'support' the flushbyasid feature?
in addition to the commit message.
Other than that:
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Best regards,
Maxim Levitsky
next prev parent reply other threads:[~2023-11-20 11:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-18 19:41 [PATCH 0/2] KVM: nSVM: TLB_CONTROL / FLUSHBYASID "fixes" Sean Christopherson
2023-10-18 19:41 ` [PATCH 1/2] Revert "nSVM: Check for reserved encodings of TLB_CONTROL in nested VMCB" Sean Christopherson
2023-11-20 11:41 ` Maxim Levitsky
2023-10-18 19:41 ` [PATCH 2/2] KVM: nSVM: Advertise support for flush-by-ASID Sean Christopherson
2023-11-20 11:42 ` Maxim Levitsky [this message]
2023-10-19 13:12 ` [PATCH 0/2] KVM: nSVM: TLB_CONTROL / FLUSHBYASID "fixes" Stefan Sterz
2023-12-01 1:52 ` Sean Christopherson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4eaec4f20dd463ae46418ebf460de43b15789950.camel@redhat.com \
--to=mlevitsk@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=s.sterz@proxmox.com \
--cc=seanjc@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox