From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCU7L-0005Wd-Ac for qemu-devel@nongnu.org; Tue, 07 Jul 2015 10:45:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCU7G-0007OL-BZ for qemu-devel@nongnu.org; Tue, 07 Jul 2015 10:45:03 -0400 Received: from mail-wg0-x234.google.com ([2a00:1450:400c:c00::234]:35521) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCU7G-0007Nn-0Y for qemu-devel@nongnu.org; Tue, 07 Jul 2015 10:44:58 -0400 Received: by wgjx7 with SMTP id x7so170016824wgj.2 for ; Tue, 07 Jul 2015 07:44:57 -0700 (PDT) Sender: Richard Henderson References: <20150707133055.11808.93250.stgit@PASHA-ISP.def.inno> <20150707133142.11808.59059.stgit@PASHA-ISP.def.inno> From: Richard Henderson Message-ID: <559BE5E5.5090201@twiddle.net> Date: Tue, 7 Jul 2015 15:44:53 +0100 MIME-Version: 1.0 In-Reply-To: <20150707133142.11808.59059.stgit@PASHA-ISP.def.inno> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v6 08/10] target-i386: exception handling for seg_helper functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Dovgalyuk , qemu-devel@nongnu.org Cc: pbonzini@redhat.com, leon.alrae@imgtec.com, agraf@suse.de, aurelien@aurel32.net On 07/07/2015 02:31 PM, Pavel Dovgalyuk wrote: > @@ -2301,9 +2294,6 @@ static inline void gen_op_movl_seg_T0_vm(int seg_reg) > static void gen_movl_seg_T0(DisasContext *s, int seg_reg, target_ulong cur_eip) > { > if (s->pe && !s->vm86) { > - /* XXX: optimize by finding processor state dynamically */ > - gen_update_cc_op(s); > - gen_jmp_im(cur_eip); > tcg_gen_trunc_tl_i32(cpu_tmp2_i32, cpu_T[0]); > gen_helper_load_seg(cpu_env, tcg_const_i32(seg_reg), cpu_tmp2_i32); > /* abort translation because the addseg value may change or The cur_eip parameter is now unused. > do_lcall: > if (s->pe && !s->vm86) { > - gen_update_cc_op(s); > gen_jmp_im(pc_start - s->cs_base); > tcg_gen_trunc_tl_i32(cpu_tmp2_i32, cpu_T[0]); > gen_helper_lcall_protected(cpu_env, cpu_tmp2_i32, cpu_T[1], > @@ -4971,7 +4960,6 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s, > gen_op_ld_v(s, MO_16, cpu_T[0], cpu_A0); > do_ljmp: > if (s->pe && !s->vm86) { > - gen_update_cc_op(s); > gen_jmp_im(pc_start - s->cs_base); > tcg_gen_trunc_tl_i32(cpu_tmp2_i32, cpu_T[0]); > gen_helper_ljmp_protected(cpu_env, cpu_tmp2_i32, cpu_T[1], You should be able to change the "int next_eip_addend" parameter so that it's just "target_ulong next_eip", and then you don't ahve to do the gen_jmp_im to save the current eip. r~