* Opteron bug
@ 2004-06-19 20:29 R. J. Wysocki
2004-06-20 13:22 ` Andi Kleen
0 siblings, 1 reply; 8+ messages in thread
From: R. J. Wysocki @ 2004-06-19 20:29 UTC (permalink / raw)
To: linux-kernel; +Cc: ak, discuss
Hi,
I hope everyone interested in the development for Opteron is aware of the bug
described here:
http://www.3dchips.net/content/story.php?id=3927
Yours,
rjw
--
Rafael J. Wysocki,
SiSK
[tel. (+48) 605 053 693]
----------------------------
For a successful technology, reality must take precedence over public
relations, for nature cannot be fooled.
-- Richard P. Feynman
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Opteron bug
2004-06-20 13:22 ` Andi Kleen
@ 2004-06-20 11:47 ` R. J. Wysocki
2004-06-20 12:02 ` Jakub Jelinek
2004-06-20 13:49 ` Andi Kleen
2004-07-12 17:34 ` [discuss] " H. Peter Anvin
1 sibling, 2 replies; 8+ messages in thread
From: R. J. Wysocki @ 2004-06-20 11:47 UTC (permalink / raw)
To: Andi Kleen; +Cc: linux-kernel, discuss
On Sunday 20 of June 2004 15:22, Andi Kleen wrote:
> On Sat, 19 Jun 2004 22:29:14 +0200
>
> "R. J. Wysocki" <rjwysocki@sisk.pl> wrote:
> > Hi,
> >
> > I hope everyone interested in the development for Opteron is aware of the
> > bug described here:
> >
> > http://www.3dchips.net/content/story.php?id=3927
>
> The kernel never uses backwards REP prefixes.
So it doesn't matter. :-)
Well, is there any case in which the gcc can produce such stuff?
rjw
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Opteron bug
2004-06-20 11:47 ` R. J. Wysocki
@ 2004-06-20 12:02 ` Jakub Jelinek
[not found] ` <200406210254.53124.vda@port.imtp.ilyichevsk.odessa.ua>
2004-06-20 13:49 ` Andi Kleen
1 sibling, 1 reply; 8+ messages in thread
From: Jakub Jelinek @ 2004-06-20 12:02 UTC (permalink / raw)
To: R. J. Wysocki; +Cc: Andi Kleen, linux-kernel, discuss
On Sun, Jun 20, 2004 at 01:47:17PM +0200, R. J. Wysocki wrote:
> Well, is there any case in which the gcc can produce such stuff?
GCC doesn't ever generate std instruction (only cld), though users
can use it in inline assembly or assembly source file.
AFAIK x86_64 glibc doesn't use it at all either.
Jakub
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Opteron bug
2004-06-19 20:29 Opteron bug R. J. Wysocki
@ 2004-06-20 13:22 ` Andi Kleen
2004-06-20 11:47 ` R. J. Wysocki
2004-07-12 17:34 ` [discuss] " H. Peter Anvin
0 siblings, 2 replies; 8+ messages in thread
From: Andi Kleen @ 2004-06-20 13:22 UTC (permalink / raw)
To: R. J. Wysocki; +Cc: linux-kernel, discuss
On Sat, 19 Jun 2004 22:29:14 +0200
"R. J. Wysocki" <rjwysocki@sisk.pl> wrote:
> Hi,
>
> I hope everyone interested in the development for Opteron is aware of the bug
> described here:
>
> http://www.3dchips.net/content/story.php?id=3927
The kernel never uses backwards REP prefixes.
-Andi
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Opteron bug
2004-06-20 11:47 ` R. J. Wysocki
2004-06-20 12:02 ` Jakub Jelinek
@ 2004-06-20 13:49 ` Andi Kleen
1 sibling, 0 replies; 8+ messages in thread
From: Andi Kleen @ 2004-06-20 13:49 UTC (permalink / raw)
To: R. J. Wysocki; +Cc: linux-kernel, discuss
On Sun, 20 Jun 2004 13:47:17 +0200
"R. J. Wysocki" <rjwysocki@sisk.pl> wrote:
> On Sunday 20 of June 2004 15:22, Andi Kleen wrote:
> > On Sat, 19 Jun 2004 22:29:14 +0200
> >
> > "R. J. Wysocki" <rjwysocki@sisk.pl> wrote:
> > > Hi,
> > >
> > > I hope everyone interested in the development for Opteron is aware of the
> > > bug described here:
> > >
> > > http://www.3dchips.net/content/story.php?id=3927
> >
> > The kernel never uses backwards REP prefixes.
>
> So it doesn't matter. :-)
Some user space program could still use it.
You'll have to live with that. CPUs like all other complex
systems have bugs.
> Well, is there any case in which the gcc can produce such stuff?
With inline assembly only I guess.
-Andi
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Opteron bug
[not found] ` <200406210254.53124.vda@port.imtp.ilyichevsk.odessa.ua>
@ 2004-06-21 5:29 ` Jakub Jelinek
0 siblings, 0 replies; 8+ messages in thread
From: Jakub Jelinek @ 2004-06-21 5:29 UTC (permalink / raw)
To: Denis Vlasenko; +Cc: R. J. Wysocki, Andi Kleen, linux-kernel, discuss
On Mon, Jun 21, 2004 at 02:54:53AM +0300, Denis Vlasenko wrote:
> On Sunday 20 June 2004 15:02, Jakub Jelinek wrote:
> > On Sun, Jun 20, 2004 at 01:47:17PM +0200, R. J. Wysocki wrote:
> > > Well, is there any case in which the gcc can produce such stuff?
> >
> > GCC doesn't ever generate std instruction (only cld), though users
> > can use it in inline assembly or assembly source file.
> > AFAIK x86_64 glibc doesn't use it at all either.
>
> glibc-2.3/sysdeps/i386/memcopy.h:
>
> #define BYTE_COPY_BWD(dst_ep, src_ep, nbytes) \
> do \
> { \
> int __d0; \
> asm volatile(/* Set the direction flag, so copying goes backwards. */ \
> "std\n" \
> /* Copy bytes. */ \
> "rep\n" \
> "movsb\n" \
> /* Clear the dir flag. Convention says it should be 0. */ \
> "cld" : \
> "=D" (dst_ep), "=S" (src_ep), "=c" (__d0) : \
> "0" (dst_ep - 1), "1" (src_ep - 1), "2" (nbytes) : \
> "memory"); \
> dst_ep += 1; \
> src_ep += 1; \
> } while (0)
>
> WORD_COPY_BWD also does this
I know, but I said x86_64 glibc, which doesn't do this.
Jakub
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [discuss] Re: Opteron bug
2004-06-20 13:22 ` Andi Kleen
2004-06-20 11:47 ` R. J. Wysocki
@ 2004-07-12 17:34 ` H. Peter Anvin
2004-07-12 18:57 ` Richard B. Johnson
1 sibling, 1 reply; 8+ messages in thread
From: H. Peter Anvin @ 2004-07-12 17:34 UTC (permalink / raw)
To: Andi Kleen; +Cc: R. J. Wysocki, linux-kernel, discuss
Andi Kleen wrote:
>
> The kernel never uses backwards REP prefixes.
>
Not even for memmove()?
-hpa
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [discuss] Re: Opteron bug
2004-07-12 17:34 ` [discuss] " H. Peter Anvin
@ 2004-07-12 18:57 ` Richard B. Johnson
0 siblings, 0 replies; 8+ messages in thread
From: Richard B. Johnson @ 2004-07-12 18:57 UTC (permalink / raw)
To: H. Peter Anvin; +Cc: Andi Kleen, R. J. Wysocki, linux-kernel, discuss
On Mon, 12 Jul 2004, H. Peter Anvin wrote:
> Andi Kleen wrote:
> >
> > The kernel never uses backwards REP prefixes.
> >
>
> Not even for memmove()?
>
> -hpa
>
One can't assume that 'cld' is not required because a user can
execute 'std'. Such a user, calling a kernel function in its
context, could really make a mess by executing 'std' before.
You definitely need a 'cld' inside any copy_to/from_user code.
memmove(), can copy overlapping buffers. It does this by
copying backwards when necessary. If it uses ix86 string
primatives, it executes 'std' for the backwards repeat counts.
Cheers,
Dick Johnson
Penguin : Linux version 2.4.26 on an i686 machine (5570.56 BogoMips).
Note 96.31% of all statistics are fiction.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2004-07-12 18:58 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-19 20:29 Opteron bug R. J. Wysocki
2004-06-20 13:22 ` Andi Kleen
2004-06-20 11:47 ` R. J. Wysocki
2004-06-20 12:02 ` Jakub Jelinek
[not found] ` <200406210254.53124.vda@port.imtp.ilyichevsk.odessa.ua>
2004-06-21 5:29 ` Jakub Jelinek
2004-06-20 13:49 ` Andi Kleen
2004-07-12 17:34 ` [discuss] " H. Peter Anvin
2004-07-12 18:57 ` Richard B. Johnson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox