On Thu, Dec 11, 2025 at 4:47 PM Richard Henderson
<[email protected]> wrote:
>
> On 12/10/25 07:16, Paolo Bonzini wrote:
> > VSIB instructions (VEX class 12) must not have an address prefix.
> > Checking s->aflag == MO_16 is not enough because in 64-bit mode
> > the address prefix changes aflag to MO_32. Add a specific check
> > bit instead.
> >
> > Cc: [email protected]
> > Signed-off-by: Paolo Bonzini <[email protected]>
> > ---
> > target/i386/tcg/decode-new.h | 3 +++
> > target/i386/tcg/decode-new.c.inc | 27 +++++++++++++--------------
> > 2 files changed, 16 insertions(+), 14 deletions(-)
>
> Where do you see this? I think this is wrong.
Yes, I was confused by the comment and by QEMU's incorrect decoding logic:
if (CODE32(s) && !VM86(s)) {
which should be changed to
if (PE(s) && !VM86(s)) {
And by the way, this also means that we need either separate helpers
for 32- and 64-bit addresses, or a mask argument.
Paolo
> In particular,
>
> Table 2-27. Type 12 Class Exception Conditions
> - If address size attribute is 16 bit.
>
> and
>
> 2.3.12 Vector SIB (VSIB) Memory Addressing
> In 16-bit protected mode, VSIB memory addressing is permitted if address size
> attribute is
> overridden to 32 bits.
>
> Therefore, in 16-bit mode, one *must* use the address prefix.
>
>
>
> r~
>