Skip to contentSkip to conversation

Pass through SSSE3 capability

PATCH In review Alexander Graf 3 participants 3 messages Jan 9, 2008 – Jan 10, 2008 2 messages not in the archive KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Pass through SSSE3 capability

Darwin requires SSSE3 in 64-bit mode, so KVM needs to reveal the appropriate CPUID flag. I could not find a proper define in the kernel headers, so I just added the specific bit number.

x86.c +1 -1
Index: kernel/x86.c
===================================================================
@@ -898,7 +903,7 @@ static void do_cpuid_ent(struct kvm_cpui
 		bit(X86_FEATURE_3DNOWEXT) |
 		bit(X86_FEATURE_3DNOW);
 	const u32 kvm_supported_word3_x86_features =
-		bit(X86_FEATURE_XMM3) | bit(X86_FEATURE_CX16);
+		bit(X86_FEATURE_XMM3) | bit(X86_FEATURE_CX16) | bit(9) /* SSSE3 */;
 	const u32 kvm_supported_word6_x86_features =
 		bit(X86_FEATURE_LAHF_LM) | bit(X86_FEATURE_CMP_LEGACY);
 

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 10 lines · Alexander Graf

Darwin requires SSSE3 in 64-bit mode, so KVM needs to reveal the appropriate CPUID flag. I could not find a proper define in the kernel headers, so I just added the specific bit number.

Index: kernel/x86.c
===================================================================

x86.c static void do_cpuid_ent(struct kvm_cpui · line 909

Quoted 8 lines
x86.c +1 -1
@@ -898,7 +903,7 @@ static void do_cpuid_ent(struct kvm_cpui
 		bit(X86_FEATURE_3DNOWEXT) |
 		bit(X86_FEATURE_3DNOW);
 	const u32 kvm_supported_word3_x86_features =
-		bit(X86_FEATURE_XMM3) | bit(X86_FEATURE_CX16);
+		bit(X86_FEATURE_XMM3) | bit(X86_FEATURE_CX16) | bit(9) /* SSSE3 */;
 	const u32 kvm_supported_word6_x86_features =
 		bit(X86_FEATURE_LAHF_LM) | bit(X86_FEATURE_CMP_LEGACY);
 

I bet that one day this will be added to asm-x86/cpufeature_32.h, so maybe adding the following would be nicer.

kernel/external-module-compat.h +3 -1
index 67b9cc4..0e2bc4c 100644
@@ -566,6 +566,9 @@ static inline void blahblah(void)
 #ifndef X86_FEATURE_NX
 #define X86_FEATURE_NX (1*32+20)
 #endif
+#ifndef X86_FEATURE_SSSE3
+#define X86_FEATURE_SSSE3 (4*32+9)
+#endif
 
 
-------------------------------------------------------------------------

Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

A message that is not in the archive (sent off-list or not yet received): 20080110071634.GA19223-iWbx9bcAnq+Hk9JtIoIkgNBPR1lH4CV8@public.gmane.org

#4 lore raw
Quoted 18 lines · Dan Kenigsberg
Quoted 16 lines · Alexander Graf

Darwin requires SSSE3 in 64-bit mode, so KVM needs to reveal the appropriate CPUID flag. I could not find a proper define in the kernel headers, so I just added the specific bit number.

Index: kernel/x86.c
===================================================================

x86.c +1 -1
@@ -898,7 +903,7 @@ static void do_cpuid_ent(struct kvm_cpui
 		bit(X86_FEATURE_3DNOWEXT) |
 		bit(X86_FEATURE_3DNOW);
 	const u32 kvm_supported_word3_x86_features =
-		bit(X86_FEATURE_XMM3) | bit(X86_FEATURE_CX16);
+		bit(X86_FEATURE_XMM3) | bit(X86_FEATURE_CX16) | bit(9) /* SSSE3 */;
Quoted 9 lines

x86.c static void do_cpuid_ent(struct kvm_cpui · line 909

Quoted 5 lines
x86.c +0 -0
 	const u32 kvm_supported_word6_x86_features =
 		bit(X86_FEATURE_LAHF_LM) | bit(X86_FEATURE_CMP_LEGACY);
 

I bet that one day this will be added to asm-x86/cpufeature_32.h, so maybe adding the following would be nicer.

I agree. Do I need to send a new patch including this as the patch is really small?

kernel/external-module-compat.h static inline void blahblah(void) · line 572

Quoted 12 lines
kernel/external-module-compat.h +3 -0
index 67b9cc4..0e2bc4c 100644
@@ -566,6 +566,9 @@ static inline void blahblah(void)
 #ifndef X86_FEATURE_NX
 #define X86_FEATURE_NX (1*32+20)
 #endif
+#ifndef X86_FEATURE_SSSE3
+#define X86_FEATURE_SSSE3 (4*32+9)
+#endif
 

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace