All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch] Allowing PV-OPS kernel to detect whether XSAVE is supported
@ 2010-11-09  6:22 Haitao Shan
  2010-11-09 10:43 ` Ian Campbell
  2010-11-09 19:55 ` Jeremy Fitzhardinge
  0 siblings, 2 replies; 13+ messages in thread
From: Haitao Shan @ 2010-11-09  6:22 UTC (permalink / raw)
  To: Jeremy Fitzhardinge; +Cc: xen-devel, Keir Fraser

[-- Attachment #1: Type: text/plain, Size: 238 bytes --]

Hi, Jeremy,

This patch allows pv-ops kernel to detect whether XSAVE is supported
(before masking it unconditionally through xen_cpuid).
Can you please have review? Thanks!

Signed-off-by: Shan Haitao <haitao.shan@intel.com>

Shan Haitao

[-- Attachment #2: xsave_pvops_kernel.patch --]
[-- Type: application/octet-stream, Size: 688 bytes --]

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index fd3803e..03bfaf7 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -252,6 +252,13 @@ static __init void xen_init_cpuid_mask(void)
 			  (1 << X86_FEATURE_MCA)  |  /* disable MCA */
 			  (1 << X86_FEATURE_APIC) |  /* disable local APIC */
 			  (1 << X86_FEATURE_ACPI));  /* disable ACPI */
+	ax = 1;
+	xen_cpuid(&ax, &bx, &cx, &dx);
+
+	/* Xen will set CR4.OSXSAVE if supported and not disabled by force */
+	if ( cx & (1 << (X86_FEATURE_XSAVE % 32)) &&
+		cx & (1 << (X86_FEATURE_OSXSAVE % 32)) )
+		return;
 
 	cpuid_leaf1_ecx_mask &= ~(1 << (X86_FEATURE_XSAVE % 32)); /* disable XSAVE */
 }

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-11-19 18:17 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-09  6:22 [Patch] Allowing PV-OPS kernel to detect whether XSAVE is supported Haitao Shan
2010-11-09 10:43 ` Ian Campbell
2010-11-09 10:51   ` Jan Beulich
2010-11-09 10:54     ` Ian Campbell
2010-11-09 11:26       ` Jan Beulich
2010-11-09 15:12       ` Haitao Shan
2010-11-09 19:55 ` Jeremy Fitzhardinge
2010-11-10  0:15   ` Haitao Shan
2010-11-10  0:18     ` Haitao Shan
2010-11-10  0:41     ` Jeremy Fitzhardinge
2010-11-10  1:45       ` Haitao Shan
2010-11-10  2:15         ` Jeremy Fitzhardinge
2010-11-19 18:17           ` Ian Jackson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.