From: Jeremy Fitzhardinge Subject: [PATCH 02 of 36] x86: add memory clobber to save/loadsegment Date: Wed, 25 Jun 2008 00:18:58 -0400 Message-ID: <2289309bb2cdf23bf825.1214367538@localhost> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ingo Molnar Cc: Mark McLoughlin , xen-devel , Eduardo Habkost , Stephen Tweedie , x86@kernel.org, LKML List-Id: xen-devel@lists.xenproject.org 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 --- include/asm-x86/system.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/asm-x86/system.h b/include/asm-x86/system.h --- a/include/asm-x86/system.h +++ b/include/asm-x86/system.h @@ -157,14 +157,14 @@ "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) {