From: Jeremy Fitzhardinge Date: Wed, 25 Jun 2008 04:18:58 +0000 (-0400) Subject: x86: add memory clobber to save/loadsegment X-Git-Tag: v2.6.27-rc1~1106^2~185 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=d338c73c39a6ed0d07fe3bb07c7f12fff0dd237d;p=linux-2.6-omap-h63xx.git x86: add memory clobber to save/loadsegment Add "memory" clobbers to savesegment and loadsegment, since they can affect memory accesses and we never want the compiler to reorder them with respect to memory references. Signed-off-by: Jeremy Fitzhardinge Cc: xen-devel Cc: Stephen Tweedie Cc: Eduardo Habkost Cc: Mark McLoughlin Signed-off-by: Ingo Molnar --- diff --git a/include/asm-x86/system.h b/include/asm-x86/system.h index bacfceedf1d..f686aa6abfe 100644 --- a/include/asm-x86/system.h +++ b/include/asm-x86/system.h @@ -153,14 +153,14 @@ extern void load_gs_index(unsigned); "jmp 2b\n" \ ".previous\n" \ _ASM_EXTABLE(1b,3b) \ - : :"r" (value), "r" (0)) + : :"r" (value), "r" (0) : "memory") /* * Save a segment register away */ #define savesegment(seg, value) \ - asm volatile("mov %%" #seg ",%0":"=rm" (value)) + asm("mov %%" #seg ",%0":"=rm" (value) : : "memory") static inline unsigned long get_limit(unsigned long segment) {