Re: [PATCH] x86/ia32: Do not modify the DPL bits for a null selector

From: Dave Hansen
Date: Thu Jul 06 2023 - 11:28:47 EST


On 7/5/23 22:22, Xin Li wrote:
> When a null selector is to be loaded into a segment register,
> reload_segments() sets its DPL bits to 3. Later when an IRET
> instruction loads it, it zeros the segment register. The two
> operations offset each other to actually effect a nop.
>
> Fix it by not modifying the DPL bits for a null selector.

So in the end, this is an optimization attempt? Is there any other benefit?