]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/i386: Do not re-compute new pc with CF_PCREL
authorRichard Henderson <richard.henderson@linaro.org>
Mon, 1 Jan 2024 23:06:17 +0000 (10:06 +1100)
committerMichael Tokarev <mjt@tls.msk.ru>
Sat, 20 Jan 2024 14:41:47 +0000 (17:41 +0300)
commit6abbb26bbc8a7779876b70e184a2123f34531f0b
treea1dc9f000fe2ece1d33dcbb5b032699066cc7f89
parent15e207b9ed89c843639f8674f318b50569869de7
target/i386: Do not re-compute new pc with CF_PCREL

With PCREL, we have a page-relative view of EIP, and an
approximation of PC = EIP+CSBASE that is good enough to
detect page crossings.  If we try to recompute PC after
masking EIP, we will mess up that approximation and write
a corrupt value to EIP.

We already handled masking properly for PCREL, so the
fix in b5e0d5d2 was only needed for the !PCREL path.

Cc: qemu-stable@nongnu.org
Fixes: b5e0d5d22fbf ("target/i386: Fix 32-bit wrapping of pc/eip computation")
Reported-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240101230617.129349-1-richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit a58506b748b8988a95f4fa1a2420ac5c17038b30)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
target/i386/tcg/translate.c