VEX is only forbidden in real and vm86 mode; 16-bit protected mode supports
it for some unfathomable reason.
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/tcg/decode-new.c.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-new.c.inc
index f662364c600..243df7e3735 100644
--- a/target/i386/tcg/decode-new.c.inc
+++ b/target/i386/tcg/decode-new.c.inc
@@ -2875,7 +2875,7 @@ static void disas_insn(DisasContext *s, CPUState *cpu)
* VEX prefixes cannot be used except in 32-bit mode.
* Otherwise the instruction is LES or LDS.
*/
- if (CODE32(s) && !VM86(s)) {
+ if (PE(s) && !VM86(s)) {
static const int pp_prefix[4] = {
0, PREFIX_DATA, PREFIX_REPZ, PREFIX_REPNZ
};
--
2.52.0
On 1/8/26 02:13, Paolo Bonzini wrote:
> VEX is only forbidden in real and vm86 mode; 16-bit protected mode supports
> it for some unfathomable reason.
>
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> target/i386/tcg/decode-new.c.inc | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-new.c.inc
> index f662364c600..243df7e3735 100644
> --- a/target/i386/tcg/decode-new.c.inc
> +++ b/target/i386/tcg/decode-new.c.inc
> @@ -2875,7 +2875,7 @@ static void disas_insn(DisasContext *s, CPUState *cpu)
> * VEX prefixes cannot be used except in 32-bit mode.
> * Otherwise the instruction is LES or LDS.
> */
> - if (CODE32(s) && !VM86(s)) {
> + if (PE(s) && !VM86(s)) {
> static const int pp_prefix[4] = {
> 0, PREFIX_DATA, PREFIX_REPZ, PREFIX_REPNZ
> };
With the comment updated as you say,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
On Wed, 7 Jan 2026, Paolo Bonzini wrote:
> VEX is only forbidden in real and vm86 mode; 16-bit protected mode supports
> it for some unfathomable reason.
>
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> target/i386/tcg/decode-new.c.inc | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-new.c.inc
> index f662364c600..243df7e3735 100644
> --- a/target/i386/tcg/decode-new.c.inc
> +++ b/target/i386/tcg/decode-new.c.inc
> @@ -2875,7 +2875,7 @@ static void disas_insn(DisasContext *s, CPUState *cpu)
> * VEX prefixes cannot be used except in 32-bit mode.
Does this comment need updating too?
Regards,
BALATON Zoltan
> * Otherwise the instruction is LES or LDS.
> */
> - if (CODE32(s) && !VM86(s)) {
> + if (PE(s) && !VM86(s)) {
> static const int pp_prefix[4] = {
> 0, PREFIX_DATA, PREFIX_REPZ, PREFIX_REPNZ
> };
>
On 1/7/26 16:57, BALATON Zoltan wrote:
> On Wed, 7 Jan 2026, Paolo Bonzini wrote:
>> VEX is only forbidden in real and vm86 mode; 16-bit protected mode
>> supports
>> it for some unfathomable reason.
>>
>> Cc: qemu-stable@nongnu.org
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>> target/i386/tcg/decode-new.c.inc | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/
>> decode-new.c.inc
>> index f662364c600..243df7e3735 100644
>> --- a/target/i386/tcg/decode-new.c.inc
>> +++ b/target/i386/tcg/decode-new.c.inc
>> @@ -2875,7 +2875,7 @@ static void disas_insn(DisasContext *s, CPUState
>> *cpu)
>> * VEX prefixes cannot be used except in 32-bit mode.
>
> Does this comment need updating too?
Good catch, it should be "Bits 6-7 of the first byte must be set except
in 64-bit mode".
Paolo
>
> Regards,
> BALATON Zoltan
>
>> * Otherwise the instruction is LES or LDS.
>> */
>> - if (CODE32(s) && !VM86(s)) {
>> + if (PE(s) && !VM86(s)) {
>> static const int pp_prefix[4] = {
>> 0, PREFIX_DATA, PREFIX_REPZ, PREFIX_REPNZ
>> };
>>
>
>
© 2016 - 2026 Red Hat, Inc.