Re: [PATCH v2 1/6] x86/bugs: Add asm helpers for executing VERW

Pawan Gupta
2023-10-25T15:09:26Z

On Wed, Oct 25, 2023 at 08:56:10AM +0200, Peter Zijlstra wrote:
> > config3: 32-bit mode, pre-boot objdump
> >
> > entry_SYSENTER_32:
> > ...
> > c8e: 58 pop %eax
> > c8f: 90 nop
> > c90: 90 nop
> > c91: 90 nop
> > c92: 90 nop
> > c93: 90 nop
> > c94: 90 nop
> > c95: 90 nop
> > c96: fb sti
> > c97: 0f 35 sysexit
> >
>
> If you look at arch/x86/include/asm/nops.h, you'll find (for 32bit):
>
> * 7: leal 0x0(%esi,%eiz,1),%esi
>
> Which reads as:
>
> load-effective-address of %esi[0] into %esi

Wow, never imagined that this would be one of the magician's trick. I
will go read on why is it better than NOPL.