RE: [PATCH] x86/entry/64: Fix native_load_gs_index() SWAPGS handling with IRQ state tracing enabled

From: David Laight
Date: Wed Nov 29 2017 - 11:51:11 EST


From: Andy Lutomirski
> Sent: 29 November 2017 16:23
> > I can't remember what happens when swapgs itself faults.
...
> SWAPGS never faults.

Ah yes, I remember, it only restores the offset.
For 32bit processes you need to do a 'pop %gs' to recover
the segment register itself - and that can fault.

SWAPGS is a PITA. The hardware designers should have tried to write
all the interrupt handling code.

David