[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Fix to previous changeset: CLTS must be unconditional in



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 166322cd55df5d5e624bed730169a6bf7751ecea
# Parent  7d89f672aa49b0240bff86ad56992c888e4eca54
Fix to previous changeset: CLTS must be unconditional in
setup_fpu(), as the flag can be set in CR0 even if the VCPU
has already dirtied the FPU (this happens if a paravirtualised
guest has set CR0.TS).

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 7d89f672aa49 -r 166322cd55df xen/include/asm-x86/i387.h
--- a/xen/include/asm-x86/i387.h        Tue Feb 14 23:15:11 2006
+++ b/xen/include/asm-x86/i387.h        Tue Feb 14 23:37:15 2006
@@ -15,25 +15,26 @@
 #include <asm/processor.h>
 
 extern void init_fpu(void);
-extern void save_init_fpu(struct vcpu *tsk);
-extern void restore_fpu(struct vcpu *tsk);
+extern void save_init_fpu(struct vcpu *v);
+extern void restore_fpu(struct vcpu *v);
 
-#define unlazy_fpu(_tsk) do { \
-    if ( test_bit(_VCPUF_fpu_dirtied, &(_tsk)->vcpu_flags) ) \
-        save_init_fpu(_tsk); \
+#define unlazy_fpu(v) do {                                      \
+    if ( test_bit(_VCPUF_fpu_dirtied, &(v)->vcpu_flags) )       \
+        save_init_fpu(v);                                       \
 } while ( 0 )
 
-#define load_mxcsr( val ) do { \
-    unsigned long __mxcsr = ((unsigned long)(val) & 0xffbf); \
-    __asm__ __volatile__ ( "ldmxcsr %0" : : "m" (__mxcsr) ); \
+#define load_mxcsr(val) do {                                    \
+    unsigned long __mxcsr = ((unsigned long)(val) & 0xffbf);    \
+    __asm__ __volatile__ ( "ldmxcsr %0" : : "m" (__mxcsr) );    \
 } while ( 0 )
 
-/* Make domain the FPU owner */
 static inline void setup_fpu(struct vcpu *v)
 {
+    /* Avoid recursion. */
+    clts();
+
     if ( !test_and_set_bit(_VCPUF_fpu_dirtied, &v->vcpu_flags) )
     {
-        clts();
         if ( test_bit(_VCPUF_fpu_initialised, &v->vcpu_flags) )
             restore_fpu(v);
         else

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.