Re: [discuss] Re: Opteron bug

From: Richard B. Johnson
Date: Mon Jul 12 2004 - 14:01:25 EST


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.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/