Message ID | 20140123152414.GA18378@dhcp-200-207.str.redhat.com |
---|---|
State | New |
Headers | show |
On 01/23/2014 07:24 AM, Kevin Wolf wrote: >> > @@ -6508,12 +6498,11 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s, >> > else >> > ot = dflag ? MO_32 : MO_16; >> > val = cpu_ldub_code(env, s->pc++); >> > - gen_op_movl_T0_im(val); >> > gen_check_io(s, ot, pc_start - s->cs_base, >> > SVM_IOIO_TYPE_MASK | svm_is_rep(prefixes)); > This removal is wrong. gen_check_io() uses cpu_T[0] internally in order > to check the I/O bitmap. Now I get a #GP even for legitimate cases. > > The following patch (which is essentially a partial revert) makes it > work for me again. Should I send it as a proper patch or would you > prefer to clean up gen_check_io()? I guess some more explicit passing of > the port number couldn't hurt there, but I'm not familiar with TCG and > who knows what I would break while doing this... Oops. How did that happen? Please just send this as a proper patch and we'll worry about cleanup of gen_check_io later. You can add my Reviewed-by: Richard Henderson <rth@twiddle.net> when you send it. Via qemu-trivial? r~
diff --git a/target-i386/translate.c b/target-i386/translate.c index b0f2279..5dd2450 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -6284,6 +6284,7 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s, case 0xe5: ot = mo_b_d32(b, dflag); val = cpu_ldub_code(env, s->pc++); + tcg_gen_movi_tl(cpu_T[0], val); gen_check_io(s, ot, pc_start - s->cs_base, SVM_IOIO_TYPE_MASK | svm_is_rep(prefixes)); if (use_icount) @@ -6300,6 +6301,7 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s, case 0xe7: ot = mo_b_d32(b, dflag); val = cpu_ldub_code(env, s->pc++); + tcg_gen_movi_tl(cpu_T[0], val); gen_check_io(s, ot, pc_start - s->cs_base, svm_is_rep(prefixes)); gen_op_mov_v_reg(ot, cpu_T[1], R_EAX);