On 11/10/26 13:10, z Y wrote:
The first immediate operand of ENTER is the size of the dynamic storage
area and is unsigned. Decoding it as a signed immediate sign-extends
values with bit 15 set, moving the stack pointer in the wrong direction.
Decode it with I_unsigned and add a regression test covering 32-bit and
64-bit guests.
Tested with a minimal x86_64-linux-user build; the new test fails before
the change and passes after it.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/4643
Signed-off-by: Zixin Wang <[email protected]>
---
target/i386/tcg/decode-new.c.inc | 2 +-
tests/tcg/i386/meson.build | 1 +
tests/tcg/i386/test-i386-enter.c | 42 ++++++++++++++++++++++++++++++++
tests/tcg/x86_64/meson.build | 1 +
4 files changed, 45 insertions(+), 1 deletion(-)
create mode 100644 tests/tcg/i386/test-i386-enter.c
This change too looks like a good candidate for the stable qemu series.
I'm picking it up, please let me know if I shouldn't.
Thanks,
/mjt