[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <44cef2e9-2ba1-82c6-60bf-c3fe4b5ed9ff@amd.com>
Date: Wed, 29 Sep 2021 15:27:13 -0500
From: Babu Moger <babu.moger@....com>
To: Paolo Bonzini <pbonzini@...hat.com>, tglx@...utronix.de,
mingo@...hat.com, bp@...en8.de, x86@...nel.org
Cc: hpa@...or.com, seanjc@...gle.com, vkuznets@...hat.com,
wanpengli@...cent.com, jmattson@...gle.com, joro@...tes.org,
tony.luck@...el.com, peterz@...radead.org,
kyung.min.park@...el.com, wei.huang2@....com, jgross@...e.com,
andrew.cooper3@...rix.com, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org
Subject: Re: [PATCH] KVM: x86: Expose Predictive Store Forwarding Disable
On 9/28/21 11:04 AM, Paolo Bonzini wrote:
> On 24/09/21 03:15, Babu Moger wrote:
>> arch/x86/include/asm/cpufeatures.h | 1 +
>> arch/x86/kvm/cpuid.c | 2 +-
>> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> Queued, with a private #define instead of the one in cpufeatures.h:
Thanks Paolo. Don't we need change in guest_has_spec_ctrl_msr?
>
> diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
> index fe03bd978761..343a01a05058 100644
> --- a/arch/x86/kvm/cpuid.c
> +++ b/arch/x86/kvm/cpuid.c
> @@ -53,9 +53,16 @@ static u32 xstate_required_size(u64 xstate_bv, bool
> compacted)
> return ret;
> }
>
> +/*
> + * This one is tied to SSB in the user API, and not
> + * visible in /proc/cpuinfo.
> + */
> +#define KVM_X86_FEATURE_PSFD (13*32+28) /* Predictive Store
> Forwarding Disable */
> +
> #define F feature_bit
> #define SF(name) (boot_cpu_has(X86_FEATURE_##name) ? F(name) : 0)
>
> +
> static inline struct kvm_cpuid_entry2 *cpuid_entry2_find(
> struct kvm_cpuid_entry2 *entries, int nent, u32 function, u32 index)
> {
> @@ -500,7 +507,8 @@ void kvm_set_cpu_caps(void)
> kvm_cpu_cap_mask(CPUID_8000_0008_EBX,
> F(CLZERO) | F(XSAVEERPTR) |
> F(WBNOINVD) | F(AMD_IBPB) | F(AMD_IBRS) | F(AMD_SSBD) |
> F(VIRT_SSBD) |
> - F(AMD_SSB_NO) | F(AMD_STIBP) | F(AMD_STIBP_ALWAYS_ON)
> + F(AMD_SSB_NO) | F(AMD_STIBP) | F(AMD_STIBP_ALWAYS_ON) |
> + __feature_bit(KVM_X86_FEATURE_PSFD)
> );
>
> /*
>
> Paolo
>
--
Thanks
Babu Moger
Powered by blists - more mailing lists