From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Fitzhardinge Subject: [PATCH] xen: mask XSAVE in cpuid since we don't allow guests to use it Date: Sat, 07 Mar 2009 21:31:21 -0800 Message-ID: <49B35829.1010403@goop.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Boris Derzhavets , Xen-devel , "Marc - A. Dahlhaus [ Administration | Westermann GmbH ]" List-Id: xen-devel@lists.xenproject.org Mask X86_FEATURE_XSAVE in cpuid leaf 1, ecx, as we don't allow guests to use it (by setting cr4.OSXSAVE). This prevents crashes in pvops dom0 kernels, as new versions of Linux try to use this feature. (This patch deals with dom0 cpuid; I'm not sure where the right place to set up the default mask for domU is.) Signed-off-by: Jeremy Fitzhardinge diff -r 7f573cb76db4 xen/arch/x86/traps.c --- a/xen/arch/x86/traps.c Tue Mar 03 13:22:28 2009 +0000 +++ b/xen/arch/x86/traps.c Sat Mar 07 17:02:03 2009 -0800 @@ -757,6 +757,7 @@ __clear_bit(X86_FEATURE_XTPR % 32, &c); __clear_bit(X86_FEATURE_PDCM % 32, &c); __clear_bit(X86_FEATURE_DCA % 32, &c); + __clear_bit(X86_FEATURE_XSAVE % 32, &c); if ( !cpu_has_apic ) __clear_bit(X86_FEATURE_X2APIC % 32, &c); __set_bit(X86_FEATURE_HYPERVISOR % 32, &c); diff -r 7f573cb76db4 xen/include/asm-x86/cpufeature.h --- a/xen/include/asm-x86/cpufeature.h Tue Mar 03 13:22:28 2009 +0000 +++ b/xen/include/asm-x86/cpufeature.h Sat Mar 07 17:02:03 2009 -0800 @@ -95,6 +95,7 @@ #define X86_FEATURE_SSE4_2 (4*32+20) /* Streaming SIMD Extensions 4.2 */ #define X86_FEATURE_X2APIC (4*32+21) /* Extended xAPIC */ #define X86_FEATURE_POPCNT (4*32+23) /* POPCNT instruction */ +#define X86_FEATURE_XSAVE (4*32+26) /* XSAVE/XRSTOR/XSETBV/XGETBV */ #define X86_FEATURE_HYPERVISOR (4*32+31) /* Running under some hypervisor */ /* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */