[PATCH] Signed-off-by: guoguangyao <guoguangyao18@mails.ucas.ac.cn>

guoguangyao posted 1 patch 11 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20231221093805.309502-1-guoguangyao18@mails.ucas.ac.cn
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Eduardo Habkost <eduardo@habkost.net>
target/i386/tcg/translate.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] Signed-off-by: guoguangyao <guoguangyao18@mails.ucas.ac.cn>
Posted by guoguangyao 11 months, 1 week ago
target/i386: Eip error in x86_64-softmmu

When closing PCREL, qemu-system-x86_64 run into error.
Eip modification here leads to the result.

Fixes: b5e0d5d22fbf("target/i386: Fix 32-bit wrapping of pc/eip computation")

 Changes to be committed:
	modified:   target/i386/tcg/translate.c
---
 target/i386/tcg/translate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index 037bc47e7c..3dc7781a41 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -566,9 +566,9 @@ static void gen_update_eip_next(DisasContext *s)
     if (tb_cflags(s->base.tb) & CF_PCREL) {
         tcg_gen_addi_tl(cpu_eip, cpu_eip, s->pc - s->pc_save);
     } else if (CODE64(s)) {
-        tcg_gen_movi_tl(cpu_eip, s->base.pc_next);
+        tcg_gen_movi_tl(cpu_eip, s->pc);
     } else {
-        tcg_gen_movi_tl(cpu_eip, (uint32_t)(s->base.pc_next - s->cs_base));
+        tcg_gen_movi_tl(cpu_eip, (uint32_t)(s->pc - s->cs_base));
     }
     s->pc_save = s->pc;
 }
-- 
2.34.1