RE: Do we need to do anything about "dead µops?"

From: David Laight
Date: Tue May 04 2021 - 09:06:15 EST


From: Josh Poimboeuf
> Sent: 04 May 2021 04:16
...
> I was actually thinking more along the lines of
>
> val = 0;
>
> if (user_supplied_idx < ARRAY_SIZE) // trained to speculatively be 'true'
> val = boring_non_secret_array[user_supplied_idx];
>
> if (val & 1)
> do_something();
>
> In other words, the victim code wouldn't be accessing the secret
> intentionally. So there's no reason for it to avoid doing
> data-dependent branches.

Isn't that one of the very boring standard spectre cases?

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)