Re: [PATCH] x86: Create clflush() inline, remove hardcoded wbinvd

2007-07-22 Thread H. Peter Anvin
Andi Kleen wrote: > On Sun, Jul 22, 2007 at 11:05:24AM -0700, H. Peter Anvin wrote: >> Andi Kleen wrote: The main reason is that everyone seems to invoke it either incorrectly >>> Where is it incorrect? >> Using "r" or "m" (as opposed as "+m") gives gcc the wrong dependency >> information, an

Re: [PATCH] x86: Create clflush() inline, remove hardcoded wbinvd

2007-07-22 Thread Andi Kleen
On Sun, Jul 22, 2007 at 11:05:24AM -0700, H. Peter Anvin wrote: > Andi Kleen wrote: > >> The main reason is that everyone seems to invoke it either incorrectly > > Where is it incorrect? > > Using "r" or "m" (as opposed as "+m") gives gcc the wrong dependency > information, and it could, at least

Re: [PATCH] x86: Create clflush() inline, remove hardcoded wbinvd

2007-07-22 Thread H. Peter Anvin
Andi Kleen wrote: >> The main reason is that everyone seems to invoke it either incorrectly > Where is it incorrect? Using "r" or "m" (as opposed as "+m") gives gcc the wrong dependency information, and it could, at least in theory, cause memory references to be moved around it -- especially when

Re: [PATCH] x86: Create clflush() inline, remove hardcoded wbinvd

2007-07-22 Thread Andi Kleen
On Fri, Jul 20, 2007 at 02:33:46PM -0700, H. Peter Anvin wrote: > Andi Kleen wrote: > > On Fri, Jul 20, 2007 at 02:19:58PM -0700, H. Peter Anvin wrote: > >> Create an inline function for clflush(), with the proper arguments, > >> and use it instead of hard-coding the instruction. > >> > >> This als

Re: [PATCH] x86: Create clflush() inline, remove hardcoded wbinvd

2007-07-21 Thread Muli Ben-Yehuda
On Sat, Jul 21, 2007 at 03:09:41PM -0700, H. Peter Anvin wrote: > Muli Ben-Yehuda wrote: > > > > Ok, let's try again: > > > > You're changing this (pageattr.c) > > > > asm volatile("clflush (%0)" :: "r" (adr + i)); > > > > into this: > > > > asm volatile("clflush %0

Re: [PATCH] x86: Create clflush() inline, remove hardcoded wbinvd

2007-07-21 Thread H. Peter Anvin
H. Peter Anvin wrote: > Muli Ben-Yehuda wrote: >> Ok, let's try again: >> >> You're changing this (pageattr.c) >> >> asm volatile("clflush (%0)" :: "r" (adr + i)); >> >> into this: >> >> asm volatile("clflush %0" : "+m" (*(char __force*)(adr + i))); >> >> The original o

Re: [PATCH] x86: Create clflush() inline, remove hardcoded wbinvd

2007-07-21 Thread H. Peter Anvin
Muli Ben-Yehuda wrote: > > Ok, let's try again: > > You're changing this (pageattr.c) > > asm volatile("clflush (%0)" :: "r" (adr + i)); > > into this: > > asm volatile("clflush %0" : "+m" (*(char __force*)(adr + i))); > > The original one calls clflush with (adr

Re: [PATCH] x86: Create clflush() inline, remove hardcoded wbinvd

2007-07-21 Thread Muli Ben-Yehuda
On Sat, Jul 21, 2007 at 01:18:54PM -0700, H. Peter Anvin wrote: > Muli Ben-Yehuda wrote: > > > > So it looks like we have a purely syntactic patch that does something > > different than the original code in one of the above places. What am I > > missing? > > > > +static inline void clflush(volat

Re: [PATCH] x86: Create clflush() inline, remove hardcoded wbinvd

2007-07-21 Thread H. Peter Anvin
Muli Ben-Yehuda wrote: > > So it looks like we have a purely syntactic patch that does something > different than the original code in one of the above places. What am I > missing? > +static inline void clflush(volatile void *__p) +{ + asm volatile("clflush %0" : "+m" (*(char __force *)__p

Re: [PATCH] x86: Create clflush() inline, remove hardcoded wbinvd

2007-07-21 Thread Muli Ben-Yehuda
On Sat, Jul 21, 2007 at 12:52:26PM -0700, H. Peter Anvin wrote: > Muli Ben-Yehuda wrote: > > > > Mostly looks good, but see below. > > > >> diff --git a/drivers/char/agp/efficeon-agp.c > >> b/drivers/char/agp/efficeon-agp.c > >> index df8da72..41f46df 100644 > >> --- a/drivers/char/agp/efficeon-ag

Re: [PATCH] x86: Create clflush() inline, remove hardcoded wbinvd

2007-07-21 Thread H. Peter Anvin
Muli Ben-Yehuda wrote: > > Mostly looks good, but see below. > >> diff --git a/drivers/char/agp/efficeon-agp.c >> b/drivers/char/agp/efficeon-agp.c >> index df8da72..41f46df 100644 >> --- a/drivers/char/agp/efficeon-agp.c >> +++ b/drivers/char/agp/efficeon-agp.c >> @@ -221,7 +221,7 @@ static int

Re: [PATCH] x86: Create clflush() inline, remove hardcoded wbinvd

2007-07-21 Thread Muli Ben-Yehuda
On Fri, Jul 20, 2007 at 02:19:58PM -0700, H. Peter Anvin wrote: > Create an inline function for clflush(), with the proper arguments, > and use it instead of hard-coding the instruction. > > This also removes one instance of hard-coded wbinvd, based on a patch > by Bauder de Oliveira Costa. > > C

Re: [PATCH] x86: Create clflush() inline, remove hardcoded wbinvd

2007-07-20 Thread H. Peter Anvin
Glauber de Oliveira Costa wrote: > On Fri, 2007-07-20 at 14:19 -0700, H. Peter Anvin wrote: >> Create an inline function for clflush(), with the proper arguments, >> and use it instead of hard-coding the instruction. >> >> This also removes one instance of hard-coded wbinvd, based on a patch >> by

Re: [PATCH] x86: Create clflush() inline, remove hardcoded wbinvd

2007-07-20 Thread Glauber de Oliveira Costa
On Fri, 2007-07-20 at 14:19 -0700, H. Peter Anvin wrote: > Create an inline function for clflush(), with the proper arguments, > and use it instead of hard-coding the instruction. > > This also removes one instance of hard-coded wbinvd, based on a patch > by Bauder de Oliveira Costa. Hey, Who's th

Re: [PATCH] x86: Create clflush() inline, remove hardcoded wbinvd

2007-07-20 Thread H. Peter Anvin
Andi Kleen wrote: > On Fri, Jul 20, 2007 at 02:19:58PM -0700, H. Peter Anvin wrote: >> Create an inline function for clflush(), with the proper arguments, >> and use it instead of hard-coding the instruction. >> >> This also removes one instance of hard-coded wbinvd, based on a patch >> by Bauder d

Re: [PATCH] x86: Create clflush() inline, remove hardcoded wbinvd

2007-07-20 Thread Andi Kleen
On Fri, Jul 20, 2007 at 02:19:58PM -0700, H. Peter Anvin wrote: > Create an inline function for clflush(), with the proper arguments, > and use it instead of hard-coding the instruction. > > This also removes one instance of hard-coded wbinvd, based on a patch > by Bauder de Oliveira Costa. I don