From: Babu Moger <babu.moger@amd.com>
To: Jim Mattson <jmattson@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
"Yu, Fenghua" <fenghua.yu@intel.com>,
Tony Luck <tony.luck@intel.com>,
Wanpeng Li <wanpengli@tencent.com>,
kvm list <kvm@vger.kernel.org>,
Tom Lendacky <thomas.lendacky@amd.com>,
Peter Zijlstra <peterz@infradead.org>,
Sean Christopherson <seanjc@google.com>,
Joerg Roedel <joro@8bytes.org>,
the arch/x86 maintainers <x86@kernel.org>,
kyung.min.park@intel.com, LKML <linux-kernel@vger.kernel.org>,
Krish Sadhukhan <krish.sadhukhan@oracle.com>,
"H . Peter Anvin" <hpa@zytor.com>,
mgross@linux.intel.com, Vitaly Kuznetsov <vkuznets@redhat.com>,
kim.phillips@amd.com, wei.huang2@amd.com
Subject: Re: [PATCH 1/2] x86/cpufeatures: Add the Virtual SPEC_CTRL feature
Date: Tue, 22 Dec 2020 10:14:42 -0600 [thread overview]
Message-ID: <00fdc56a-5ac4-94a0-88b4-42e4cf46f083@amd.com> (raw)
In-Reply-To: <CALMp9eRzYoVqr0zm60+pkJbGF+t0ry8k7y=X=R1paDhUUPSVCw@mail.gmail.com>
On 12/9/20 5:11 PM, Jim Mattson wrote:
> On Wed, Dec 9, 2020 at 2:39 PM Babu Moger <babu.moger@amd.com> wrote:
>>
>>
>>
>> On 12/7/20 5:22 PM, Jim Mattson wrote:
>>> On Mon, Dec 7, 2020 at 2:38 PM Babu Moger <babu.moger@amd.com> wrote:
>>>>
>>>> Newer AMD processors have a feature to virtualize the use of the SPEC_CTRL
>>>> MSR. This feature is identified via CPUID 0x8000000A_EDX[20]. When present,
>>>> the SPEC_CTRL MSR is automatically virtualized and no longer requires
>>>> hypervisor intervention.
>>>>
>>>> Signed-off-by: Babu Moger <babu.moger@amd.com>
>>>> ---
>>>> arch/x86/include/asm/cpufeatures.h | 1 +
>>>> 1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h
>>>> index dad350d42ecf..d649ac5ed7c7 100644
>>>> --- a/arch/x86/include/asm/cpufeatures.h
>>>> +++ b/arch/x86/include/asm/cpufeatures.h
>>>> @@ -335,6 +335,7 @@
>>>> #define X86_FEATURE_AVIC (15*32+13) /* Virtual Interrupt Controller */
>>>> #define X86_FEATURE_V_VMSAVE_VMLOAD (15*32+15) /* Virtual VMSAVE VMLOAD */
>>>> #define X86_FEATURE_VGIF (15*32+16) /* Virtual GIF */
>>>> +#define X86_FEATURE_V_SPEC_CTRL (15*32+20) /* Virtual SPEC_CTRL */
>>>
>>> Shouldn't this bit be reported by KVM_GET_SUPPORTED_CPUID when it's
>>> enumerated on the host?
>>
>> Jim, I am not sure if this needs to be reported by
>> KVM_GET_SUPPORTED_CPUID. I dont see V_VMSAVE_VMLOAD or VGIF being reported
>> via KVM_GET_SUPPORTED_CPUID. Do you see the need for that?
>
> Every little bit helps. No, it isn't *needed*. But then again, this
> entire patchset isn't *needed*, is it?
>
Working on v2 of these patches. Saw this code comment(in
arch/x86/kvm/cpuid.c) on about exposing SVM features to the guest.
/*
* Hide all SVM features by default, SVM will set the cap bits for
* features it emulates and/or exposes for L1.
*/
kvm_cpu_cap_mask(CPUID_8000_000A_EDX, 0);
Should we go ahead with the changes here?
Thanks
Babu
next prev parent reply other threads:[~2020-12-22 16:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-07 22:37 [PATCH 0/2] x86: Add the feature Virtual SPEC_CTRL Babu Moger
2020-12-07 22:37 ` [PATCH 1/2] x86/cpufeatures: Add the Virtual SPEC_CTRL feature Babu Moger
2020-12-07 23:22 ` Jim Mattson
2020-12-09 22:39 ` Babu Moger
2020-12-09 23:11 ` Jim Mattson
2020-12-22 16:14 ` Babu Moger [this message]
2020-12-22 17:41 ` Sean Christopherson
2020-12-22 18:07 ` Babu Moger
2020-12-07 22:37 ` [PATCH 2/2] KVM: SVM: Add support for Virtual SPEC_CTRL Babu Moger
2020-12-07 23:06 ` Jim Mattson
2020-12-10 21:26 ` Babu Moger
2020-12-10 21:36 ` Jim Mattson
2020-12-10 22:57 ` Babu Moger
2020-12-22 16:14 ` Babu Moger
2020-12-07 23:13 ` Sean Christopherson
2020-12-10 21:31 ` Babu Moger
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=00fdc56a-5ac4-94a0-88b4-42e4cf46f083@amd.com \
--to=babu.moger@amd.com \
--cc=bp@alien8.de \
--cc=fenghua.yu@intel.com \
--cc=hpa@zytor.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kim.phillips@amd.com \
--cc=krish.sadhukhan@oracle.com \
--cc=kvm@vger.kernel.org \
--cc=kyung.min.park@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgross@linux.intel.com \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=seanjc@google.com \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--cc=tony.luck@intel.com \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
--cc=wei.huang2@amd.com \
--cc=x86@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).