Re: [PATCH] Pass through SSSE3 capability

Dan Kenigsberg
2008-01-10T07:16:34Z

On Wed, Jan 09, 2008 at 07:46:04PM +0100, Alexander Graf wrote:
> 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
> ===================================================================
> --- kernel.orig/x86.c
> +++ 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);
>
>

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

diff --git a/kernel/external-module-compat.h b/kernel/external-module-compat.h
index 67b9cc4..0e2bc4c 100644
--- a/kernel/external-module-compat.h
+++ b/kernel/external-module-compat.h
@@ -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