All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC] x86/resume: take care of fully eager FPU around system suspend
@ 2018-06-17  8:56 Jan Beulich
  2018-06-18  8:45 ` Andrew Cooper
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2018-06-17  8:56 UTC (permalink / raw)
  To: xen-devel; +Cc: Juergen Gross, andrew.cooper3

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

Just like in the HVM emulation and EFI runtime call cases we must not
set CR0.TS here in fully eager mode. Note that idle vCPU-s never have
->arch.fully_eager_fpu set (for their initialization not going through
vcpu_init_fpu()), so we won't hit the respective ASSERT() in
vcpu_restore_fpu_eager(). 

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
RFC: Not even compile tested, as I'm writing this from home. Also please
         excuse the formatting (hence the attachment) - our mail web frontend
      doesn't allow anything better.

--- a/xen/arch/x86/acpi/suspend.c
+++ b/xen/arch/x86/acpi/suspend.c
@@ -92,8 +92,11 @@ void restore_rest_processor_state(void)
         write_debugreg(7, curr->arch.debugreg[7]);
     }
 
-    /* Reload FPU state on next FPU use. */
-    stts();
+    /* Reload FPU state immediately or on next FPU use. */
+    if ( curr->arch.fully_eager_fpu )
+        vcpu_restore_fpu_eager(curr);
+    else
+        stts();
 
     if (cpu_has_pat)
         wrmsrl(MSR_IA32_CR_PAT, host_pat);


[-- Attachment #2: x86-resume-eager-FPU.patch --]
[-- Type: text/plain, Size: 984 bytes --]

x86/resume: take care of fully eager FPU around system suspend

Just like in the HVM emulation and EFI runtime call cases we must not
set CR0.TS here in fully eager mode. Note that idle vCPU-s never have
->arch.fully_eager_fpu set (for their initialization not going through
vcpu_init_fpu()), so we won't hit the respective ASSERT() in
vcpu_restore_fpu_eager(). 

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
RFC: Not even compile tested, as I'm writing this from home.

--- a/xen/arch/x86/acpi/suspend.c
+++ b/xen/arch/x86/acpi/suspend.c
@@ -92,8 +92,11 @@ void restore_rest_processor_state(void)
         write_debugreg(7, curr->arch.debugreg[7]);
     }
 
-    /* Reload FPU state on next FPU use. */
-    stts();
+    /* Reload FPU state immediately or on next FPU use. */
+    if ( curr->arch.fully_eager_fpu )
+        vcpu_restore_fpu_eager(curr);
+    else
+        stts();
 
     if (cpu_has_pat)
         wrmsrl(MSR_IA32_CR_PAT, host_pat);

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

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

end of thread, other threads:[~2018-06-21  6:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-17  8:56 [PATCH RFC] x86/resume: take care of fully eager FPU around system suspend Jan Beulich
2018-06-18  8:45 ` Andrew Cooper
2018-06-21  6:46   ` Jan Beulich

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.