[PATCH] x86/APX: GETSEC cannot be used with REX2

Cui, Lili lili.cui@intel.com
Sun Jan 26 02:37:35 GMT 2025



> -----Original Message-----
> From: Jan Beulich <jbeulich@suse.com>
> Sent: Friday, January 24, 2025 7:12 PM
> To: Binutils <binutils@sourceware.org>
> Cc: Cui, Lili <lili.cui@intel.com>; H.J. Lu <hjl.tools@gmail.com>
> Subject: [PATCH] x86/APX: GETSEC cannot be used with REX2
> 
> It lives in a "forbidden" row, yet its disassembler table entry was lacking a
> respective marker.
> 
> --- a/opcodes/i386-dis.c
> +++ b/opcodes/i386-dis.c
> @@ -2305,7 +2305,7 @@ static const struct dis386 dis386_twobyt
>    { "sysenter",		{ SEP }, PREFIX_REX2_ILLEGAL },
>    { "sysexit%LQ",	{ SEP }, PREFIX_REX2_ILLEGAL },
>    { Bad_Opcode },
> -  { "getsec",		{ XX }, 0 },
> +  { "getsec",		{ XX }, PREFIX_REX2_ILLEGAL },

Yes, it seems I forgot to add PREFIX_REX2_ILLEGAL for these instructions.

• All opcodes listed below are reserved under REX2 and triggers #UD when prefixed with REX2:
– Legacy map 0:
* All opcodes in the row 0x4*
* All opcodes in the row 0x7*
* All opcodes in the row 0xA*
· Exception: 0xA1 prefixed by REX2 is used to encode the JMPABS instruction
(Section 3.1.3.3)
* All opcodes in the row 0xE*
– Legacy map 1:
* All opcodes in row 0x3*
* All opcodes in row 0x8*

Lili.

>    /* 38 */
>    { THREE_BYTE_TABLE (THREE_BYTE_0F38) },
>    { Bad_Opcode },



More information about the Binutils mailing list