Skip to contentSkip to conversation

x86/cpufeatures: Add macros for Intel's new fast rep string features

PATCH Superseded Jim Mattson 2 participants 3 messages Aug 31, 2022 – Sep 1, 2022

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 x86/cpufeatures: Add macros for Intel's new fast rep string features

KVM_GET_SUPPORTED_CPUID should reflect these host CPUID bits. The bits are already cached in word 12. Give the bits X86_FEATURE names, so that they can be easily referenced. Hide these bits from /proc/cpuinfo, since the host kernel makes no use of them at present.

---
v1 -> v2: Hide from /proc/cpuinfo [Dave Hansen]

 arch/x86/include/asm/cpufeatures.h | 3 +++
 1 file changed, 3 insertions(+)
arch/x86/include/asm/cpufeatures.h +3 -0
index ef4775c6db01..454f0faa8e90 100644
@@ -308,6 +308,9 @@
 /* Intel-defined CPU features, CPUID level 0x00000007:1 (EAX), word 12 */
 #define X86_FEATURE_AVX_VNNI		(12*32+ 4) /* AVX VNNI instructions */
 #define X86_FEATURE_AVX512_BF16		(12*32+ 5) /* AVX512 BFLOAT16 instructions */
+#define X86_FEATURE_FZRM		(12*32+10) /* "" Fast zero-length REP MOVSB */
+#define X86_FEATURE_FSRS		(12*32+11) /* "" Fast short REP STOSB */
+#define X86_FEATURE_FSRC		(12*32+12) /* "" Fast short REP {CMPSB,SCASB} */
 
 /* AMD-defined CPU features, CPUID level 0x80000008 (EBX), word 13 */
 #define X86_FEATURE_CLZERO		(13*32+ 0) /* CLZERO instruction */
Signature · 1 line
2.37.2.672.g94769d06f0-goog
#1 lore raw
Quoted 1 line · Jim Mattson

KVM_GET_SUPPORTED_CPUID should reflect these host CPUID bits. The bits

Why not provide the KVM support in the same patch/series?

Quoted 28 lines

are already cached in word 12. Give the bits X86_FEATURE names, so that they can be easily referenced. Hide these bits from /proc/cpuinfo, since the host kernel makes no use of them at present.

---
v1 -> v2: Hide from /proc/cpuinfo [Dave Hansen]

 arch/x86/include/asm/cpufeatures.h | 3 +++
 1 file changed, 3 insertions(+)
arch/x86/include/asm/cpufeatures.h +3 -0
index ef4775c6db01..454f0faa8e90 100644
@@ -308,6 +308,9 @@
 /* Intel-defined CPU features, CPUID level 0x00000007:1 (EAX), word 12 */
 #define X86_FEATURE_AVX_VNNI		(12*32+ 4) /* AVX VNNI instructions */
 #define X86_FEATURE_AVX512_BF16		(12*32+ 5) /* AVX512 BFLOAT16 instructions */
+#define X86_FEATURE_FZRM		(12*32+10) /* "" Fast zero-length REP MOVSB */
+#define X86_FEATURE_FSRS		(12*32+11) /* "" Fast short REP STOSB */
+#define X86_FEATURE_FSRC		(12*32+12) /* "" Fast short REP {CMPSB,SCASB} */
 
 /* AMD-defined CPU features, CPUID level 0x80000008 (EBX), word 13 */
 #define X86_FEATURE_CLZERO		(13*32+ 0) /* CLZERO instruction */
Signature · 1 line
2.37.2.672.g94769d06f0-goog
#2 lore raw
Quoted 6 lines · Sean Christopherson
Quoted 1 line · Jim Mattson

KVM_GET_SUPPORTED_CPUID should reflect these host CPUID bits. The bits

Why not provide the KVM support in the same patch/series?

Coming up.