lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 28 Sep 2021 18:04:04 +0200
From:   Paolo Bonzini <pbonzini@...hat.com>
To:     Babu Moger <babu.moger@....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 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ