From: Vincent Hanquez Subject: Re: [PATCH] %fs/%gs cleanup in mmu_context.h Date: Sat, 13 Aug 2005 01:23:24 +0200 Message-ID: <20050812232324.GB19354@snarc.org> References: <20050812230549.GI7901@shell0.pdx.osdl.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20050812230549.GI7901@shell0.pdx.osdl.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Chris Wright Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Fri, Aug 12, 2005 at 04:05:49PM -0700, Chris Wright wrote: > > diff -r ba46bd7f5cdf linux-2.6-xen-sparse/include/asm-xen/asm-i386/mmu_context.h > --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/mmu_context.h Fri Aug 12 15:59:34 2005 > +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/mmu_context.h Fri Aug 12 15:59:38 2005 > @@ -34,10 +34,10 @@ > * are always kernel segments while inside the kernel. Must > * happen before reload of cr3/ldt (i.e., not in __switch_to). > */ > - __asm__ __volatile__ ( "mov %%fs,%0 ; mov %%gs,%1" > - : "=m" (*(int *)¤t->thread.fs), > - "=m" (*(int *)¤t->thread.gs)); > - __asm__ __volatile__ ( "mov %0,%%fs ; mov %0,%%gs" > + asm volatile ( "movl %%fs,%0 ; movl %%gs,%1" > + : "=m" (current->thread.fs), > + "=m" (current->thread.gs)); > + asm volatile ( "movl %0,%%fs ; movl %0,%%gs" > : : "r" (0) ); > } > The first inline asm is wrong. latest binutils no longer accept instructions for moving between a segment register and a 32bit memory location. you should keep the "mov" instead of "movl". see: http://sourceware.org/ml/binutils/2005-03/msg00873.html > @@ -100,7 +100,7 @@ > } > > #define deactivate_mm(tsk, mm) \ > - asm("mov %0,%%fs ; mov %0,%%gs": :"r" (0)) > + asm("movl %0,%%fs ; movl %0,%%gs": :"r" (0)) This one clearing the segment register is fine. -- Vincent Hanquez