From: Paolo Bonzini <pbonzini@redhat.com>
To: Babu Moger <babu.moger@amd.com>,
tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
x86@kernel.org
Cc: hpa@zytor.com, seanjc@google.com, vkuznets@redhat.com,
wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org,
tony.luck@intel.com, peterz@infradead.org,
kyung.min.park@intel.com, wei.huang2@amd.com, jgross@suse.com,
andrew.cooper3@citrix.com, linux-kernel@vger.kernel.org,
kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: x86: Expose Predictive Store Forwarding Disable
Date: Tue, 28 Sep 2021 18:04:04 +0200 [thread overview]
Message-ID: <d1b1e0da-29f0-c443-6c86-9549bbe1c79d@redhat.com> (raw)
In-Reply-To: <163244601049.30292.5855870305350227855.stgit@bmoger-ubuntu>
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:
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
next prev parent reply other threads:[~2021-09-28 16:04 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <163244601049.30292.5855870305350227855.stgit@bmoger-ubuntu>
2021-09-27 10:59 ` Borislav Petkov
2021-09-27 11:13 ` Paolo Bonzini
2021-09-27 12:06 ` Borislav Petkov
2021-09-27 12:14 ` Paolo Bonzini
2021-09-27 12:28 ` Borislav Petkov
2021-09-27 12:54 ` Paolo Bonzini
2021-09-27 13:38 ` Borislav Petkov
2021-09-27 15:47 ` Babu Moger
2021-09-27 15:48 ` Borislav Petkov
2021-09-28 16:04 ` Paolo Bonzini [this message]
2021-09-29 20:27 ` Babu Moger
2021-09-30 13:41 ` Paolo Bonzini
2021-09-30 14:12 ` Babu Moger
2022-08-23 21:26 ` Jim Mattson
2022-08-24 17:13 ` Paolo Bonzini
2022-08-24 17:16 ` Jim Mattson
2022-08-26 10:10 ` Paolo Bonzini
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=d1b1e0da-29f0-c443-6c86-9549bbe1c79d@redhat.com \
--to=pbonzini@redhat.com \
--cc=andrew.cooper3@citrix.com \
--cc=babu.moger@amd.com \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=jgross@suse.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=kyung.min.park@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=seanjc@google.com \
--cc=tglx@linutronix.de \
--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
all inboxes | Powered by JetHome®