x86: add memory clobber in switch_to()
authorVegard Nossum <vegard.nossum@gmail.com>
Sun, 14 Sep 2008 17:03:53 +0000 (19:03 +0200)
committerIngo Molnar <mingo@elte.hu>
Mon, 13 Oct 2008 08:21:12 +0000 (10:21 +0200)
Segment registers are reloaded, so we should add a memory clobber. The
generated assembly code is identical in my tests, but this doesn't mean
it is necessarily true for all configurations/compilers.

x86_64 already has the memory clobber.

Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
include/asm-x86/system.h

index 34505dd7b24de4ad67b968f93b3fc24156700206..b20c894660f95ee1d056d86a238e2bb116cb673c 100644 (file)
@@ -64,7 +64,10 @@ do {                                                                 \
                                                                        \
                       /* regparm parameters for __switch_to(): */      \
                       [prev]     "a" (prev),                           \
-                      [next]     "d" (next));                          \
+                      [next]     "d" (next)                            \
+                                                                       \
+                    : /* reloaded segment registers */                 \
+                       "memory");                                      \
 } while (0)
 
 /*