]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/i386: fix size of EBP writeback in gen_enter()
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Thu, 6 Jun 2024 09:53:19 +0000 (10:53 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Tue, 11 Jun 2024 07:02:16 +0000 (10:02 +0300)
commitdb0a21257e58ef65fef75eb15a3673777a3c59f8
treee2a411cd4b4b2269ad0a949c490c2911f281a03d
parent60b4f3aff4e39be04f5d73c65a7e8ef838475c9f
target/i386: fix size of EBP writeback in gen_enter()

The calculation of FrameTemp is done using the size indicated by mo_pushpop()
before being written back to EBP, but the final writeback to EBP is done using
the size indicated by mo_stacksize().

In the case where mo_pushpop() is MO_32 and mo_stacksize() is MO_16 then the
final writeback to EBP is done using MO_16 which can leave junk in the top
16-bits of EBP after executing ENTER.

Change the writeback of EBP to use the same size indicated by mo_pushpop() to
ensure that the full value is written back.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2198
Message-ID: <20240606095319.229650-5-mark.cave-ayland@ilande.co.uk>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 3973615e7fbaeef1deeaa067577e373781ced70a)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
target/i386/tcg/translate.c