[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Bug 1310324] [NEW] Commit 0f842f8a introduces regressi
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [Bug 1310324] [NEW] Commit 0f842f8a introduces regression when using tcg-interpreter |
Date: |
Mon, 21 Apr 2014 09:28:43 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 |
On 04/21/2014 06:14 AM, Stefan Weil wrote:
> That commit changed the use of the GETPC macro. I just tried to debug
> the tci.c code and noticed that cputlb.c no longer works as expected:
Ouch, yes, I see that.
> This is not specific for the TCG interpreter, but I don't know how the
> normal TCG is affected.
I believe that normal TCG is not affected, because the value returned for the
return address is outside the code_buffer, so tb_find_pc returns NULL, so
cpu_restore_state does nothing. Whereas the interpreter continues to produce
the address of the last opcode executed.
To solve this, I believe you need to clear tci_tb_ptr on all exits from the
interpreter loop. That is, both on normal exit (return from tcg_qemu_tb_exec)
as well as exceptional exit (longjmp landing in cpu_exec; see the Reload env
after longjmp section).
Only setting tci_tb_ptr at the places it's needed, calls and qemu_ld/st calls,
is a good optimization of memory traffic, but is unrelated to this bug.
> I also noticed that other code like target-i386/seg_helper.c which
> includes exec/softmmu_template.h also results in undefined usage of the
> GETRA macro.
Huh? That's the normal backend expansion of its load/store helpers.
r~
- [Qemu-devel] [PATCH v2 000/124] VMState Simplification (Massive), Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 001/124] savevm: Ignore minimum_version_id_old if there is no load_state_old, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 004/124] savevm: Remove all the unneded version_minimum_id_old (arm), Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 002/124] savevm: Remove all the unneded version_minimum_id_old (usb), Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 005/124] savevm: Remove all the unneded version_minimum_id_old (x86), Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 003/124] savevm: Remove all the unneded version_minimum_id_old (ppc), Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 006/124] savevm: Remove all the unneded version_minimum_id_old (rest), Juan Quintela, 2014/04/21