public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] xsave: restore xcr0 during resume
@ 2008-08-27 21:57 Suresh Siddha
  2008-08-27 22:23 ` H. Peter Anvin
  2008-08-30 21:57 ` Pavel Machek
  0 siblings, 2 replies; 3+ messages in thread
From: Suresh Siddha @ 2008-08-27 21:57 UTC (permalink / raw)
  To: hpa, tglx, mingo; +Cc: linux-kernel, venkatesh.pallipadi

Add the missing XCR0(XFEATURE_ENABLED_MASK) restore during resume.

Reported-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
---

diff --git a/arch/x86/power/cpu_32.c b/arch/x86/power/cpu_32.c
index d3e083d..274d060 100644
--- a/arch/x86/power/cpu_32.c
+++ b/arch/x86/power/cpu_32.c
@@ -11,6 +11,7 @@
 #include <linux/suspend.h>
 #include <asm/mtrr.h>
 #include <asm/mce.h>
+#include <asm/xcr.h>
 
 static struct saved_context saved_context;
 
@@ -126,6 +127,12 @@ static void __restore_processor_state(struct saved_context *ctxt)
 	if (boot_cpu_has(X86_FEATURE_SEP))
 		enable_sep_cpu();
 
+	/*
+	 * restore XCR0 for xsave capable cpu's.
+	 */
+	if (cpu_has_xsave)
+		xsetbv(XCR_XFEATURE_ENABLED_MASK, pcntxt_mask);
+
 	fix_processor_context();
 	do_fpu_end();
 	mtrr_ap_init();
diff --git a/arch/x86/power/cpu_64.c b/arch/x86/power/cpu_64.c
index 66bdfb5..e3b6cf7 100644
--- a/arch/x86/power/cpu_64.c
+++ b/arch/x86/power/cpu_64.c
@@ -14,6 +14,7 @@
 #include <asm/page.h>
 #include <asm/pgtable.h>
 #include <asm/mtrr.h>
+#include <asm/xcr.h>
 
 static void fix_processor_context(void);
 
@@ -122,6 +123,12 @@ static void __restore_processor_state(struct saved_context *ctxt)
 	wrmsrl(MSR_GS_BASE, ctxt->gs_base);
 	wrmsrl(MSR_KERNEL_GS_BASE, ctxt->gs_kernel_base);
 
+	/*
+	 * restore XCR0 for xsave capable cpu's.
+	 */
+	if (cpu_has_xsave)
+		xsetbv(XCR_XFEATURE_ENABLED_MASK, pcntxt_mask);
+
 	fix_processor_context();
 
 	do_fpu_end();

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

* Re: [patch] xsave: restore xcr0 during resume
  2008-08-27 21:57 [patch] xsave: restore xcr0 during resume Suresh Siddha
@ 2008-08-27 22:23 ` H. Peter Anvin
  2008-08-30 21:57 ` Pavel Machek
  1 sibling, 0 replies; 3+ messages in thread
From: H. Peter Anvin @ 2008-08-27 22:23 UTC (permalink / raw)
  To: Suresh Siddha; +Cc: tglx, mingo, linux-kernel, venkatesh.pallipadi

Suresh Siddha wrote:
> Add the missing XCR0(XFEATURE_ENABLED_MASK) restore during resume.
> 
> Reported-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
> Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>

Applied to tip:x86/xsave, thanks.

	-hpa

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

* Re: [patch] xsave: restore xcr0 during resume
  2008-08-27 21:57 [patch] xsave: restore xcr0 during resume Suresh Siddha
  2008-08-27 22:23 ` H. Peter Anvin
@ 2008-08-30 21:57 ` Pavel Machek
  1 sibling, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2008-08-30 21:57 UTC (permalink / raw)
  To: Suresh Siddha; +Cc: hpa, tglx, mingo, linux-kernel, venkatesh.pallipadi

On Wed 2008-08-27 14:57:36, Suresh Siddha wrote:
> Add the missing XCR0(XFEATURE_ENABLED_MASK) restore during resume.
> 
> Reported-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
> Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>

ACK.

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

end of thread, other threads:[~2008-08-31 19:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-27 21:57 [patch] xsave: restore xcr0 during resume Suresh Siddha
2008-08-27 22:23 ` H. Peter Anvin
2008-08-30 21:57 ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox