[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] tcg/mips: Bugfix for crash whenrunningprogram w
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH] tcg/mips: Bugfix for crash whenrunningprogram with qemu-i386. |
Date: |
Sun, 9 Jul 2017 19:44:49 -1000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
On 07/09/2017 05:15 PM, address@hidden wrote:
It lies in the following code,
> if (TCG_TARGET_REG_BITS > TARGET_LONG_BITS) {
> tcg_out_ext32u(s, base, addr_regl);
> addr_regl = base; //problem is here.
> }
this section of code is to extend the addr_regl to 64bit, and use *base* as temp
intermedia. The real intention could be to extend addr_regl into base, and then
move base back to addr_regl for later use, but it wrongly assigning base to
addr_regl directly, which will cause crash for every use of tcg_out_qemu_st.
The intent is to zero-extend addr_regl into a temporary; base = A0, and at this
point is known to be unused. Afterward, whenever we talk about the low part of
the address, we want to use the temporary and not the original input.
For example, if addr_regl = S0, and guest_base = S1, then we want
dext a0, s0, 31, 0
dadd a0, s1, a0
instead of
dext a0, s0, 31, 0
mov s0, a0
dadd a0, s1, s0
My intention is to fix this bug, and intend to use TCG_TMP0 for temporary use
for addr_regl.
That is also fine; there's nothing magic about using base = A0 for the
temporary.
r~