altstack: Declare memory clobbers
altstack includes a couple of inline asm blocks with x86 push and pop
instructions. These instructions will access memory (the stack), but
that's not declared in inline asm statement. We seem to be getting away
with it, but in theory that could allow the compiler to re-order accesses
to local variables across the asm block. Since those blocks change the
location of the stack, that could be very bad.
Adding a "memory" clobber should prevent this (effectively making the asm
blocks a compiler memory barrier).
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Showing
Please register or sign in to comment