> Instead of barrier(), this works with gcc-3.2.3 up to gcc-4.4.3
> for the purpose of making the memset() not disappear:
>
> {
> struct s { char c[n]; };
> asm("" : : "m"(*(struct s *)p));
> }
>
> Every byte in the [p,p+n[ range must be used. If you only u
Mikael Pettersson writes:
> Andi Kleen writes:
> > roel kluin writes:
> >
> > >> And it's wrong because the reason the memset() is there seems to be
> > >> to clear out key information that might exist kernel stack so that
> > >> it's more difficult for rogue code to get at things.
>
Andi Kleen writes:
> roel kluin writes:
>
> >> And it's wrong because the reason the memset() is there seems to be
> >> to clear out key information that might exist kernel stack so that
> >> it's more difficult for rogue code to get at things.
> >
> > If the memset is optimized away then
roel kluin writes:
>> And it's wrong because the reason the memset() is there seems to be
>> to clear out key information that might exist kernel stack so that
>> it's more difficult for rogue code to get at things.
>
> If the memset is optimized away then the clear out does not occur. Do you
> k