Re: [PATCH v6 5/5] x86/gsseg: use the LKGS instruction if available for load_gs_index()

From: Borislav Petkov
Date: Mon Jul 01 2024 - 02:09:14 EST


On Sun, Jun 30, 2024 at 07:34:42PM -0700, H. Peter Anvin wrote:
> It is much like "movl %edi,%ds"...

You mean ...,%gs"... :-P

But yeah, that makes more sense.

Are we saying somewhere that when moving into a segreg, only the lower 16 bits
of the source operand are used?

Both docs say

8E /r MOV Sreg, r/m16 Move r/m16 to segment register.

and I read that strict as r16 so I'd expect a "mov %di,..." not a "mov
%edi,..."

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette