From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40206) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCUUh-0000Py-Rs for qemu-devel@nongnu.org; Tue, 07 Jul 2015 11:09:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCUUd-0005uP-S1 for qemu-devel@nongnu.org; Tue, 07 Jul 2015 11:09:11 -0400 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:32985) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCUUd-0005uA-L2 for qemu-devel@nongnu.org; Tue, 07 Jul 2015 11:09:07 -0400 Received: by wiwl6 with SMTP id l6so317754935wiw.0 for ; Tue, 07 Jul 2015 08:09:07 -0700 (PDT) Sender: Richard Henderson References: <20150707133055.11808.93250.stgit@PASHA-ISP.def.inno> <20150707133147.11808.6525.stgit@PASHA-ISP.def.inno> From: Richard Henderson Message-ID: <559BEB87.1060004@twiddle.net> Date: Tue, 7 Jul 2015 16:08:55 +0100 MIME-Version: 1.0 In-Reply-To: <20150707133147.11808.6525.stgit@PASHA-ISP.def.inno> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v6 09/10] target-i386: exception handling for other 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: > diff --git a/target-i386/misc_helper.c b/target-i386/misc_helper.c > index 52c5d65..c8e7ee9 100644 > --- a/target-i386/misc_helper.c > +++ b/target-i386/misc_helper.c > @@ -220,7 +220,7 @@ void helper_rdtsc(CPUX86State *env) > uint64_t val; > > if ((env->cr[4] & CR4_TSD_MASK) && ((env->hflags & HF_CPL_MASK) != 0)) { > - raise_exception(env, EXCP0D_GPF); > + raise_exception_ra(env, EXCP0D_GPF, GETPC()); > } > cpu_svm_check_intercept_param(env, SVM_EXIT_RDTSC, 0); > > @@ -238,13 +238,13 @@ void helper_rdtscp(CPUX86State *env) > void helper_rdpmc(CPUX86State *env) > { > if ((env->cr[4] & CR4_PCE_MASK) && ((env->hflags & HF_CPL_MASK) != 0)) { > - raise_exception(env, EXCP0D_GPF); > + raise_exception_ra(env, EXCP0D_GPF, GETPC()); > } > cpu_svm_check_intercept_param(env, SVM_EXIT_RDPMC, 0); > > /* currently unimplemented */ > qemu_log_mask(LOG_UNIMP, "x86: unimplemented rdpmc\n"); > - raise_exception_err(env, EXCP06_ILLOP, 0); > + raise_exception_err_ra(env, EXCP06_ILLOP, 0, GETPC()); > } > > #if defined(CONFIG_USER_ONLY) > @@ -589,7 +589,7 @@ void helper_hlt(CPUX86State *env, int next_eip_addend) > void helper_monitor(CPUX86State *env, target_ulong ptr) > { > if ((uint32_t)env->regs[R_ECX] != 0) { > - raise_exception(env, EXCP0D_GPF); > + raise_exception_ra(env, EXCP0D_GPF, GETPC()); > } > /* XXX: store address? */ > cpu_svm_check_intercept_param(env, SVM_EXIT_MONITOR, 0); Likewise. > @@ -601,7 +601,7 @@ void helper_mwait(CPUX86State *env, int next_eip_addend) > X86CPU *cpu; > > if ((uint32_t)env->regs[R_ECX] != 0) { > - raise_exception(env, EXCP0D_GPF); > + raise_exception_ra(env, EXCP0D_GPF, GETPC()); > } > cpu_svm_check_intercept_param(env, SVM_EXIT_MWAIT, 0); > env->eip += next_eip_addend; Similar to lcall/ljmp, this can be switched to not use an addend. > diff --git a/target-i386/svm_helper.c b/target-i386/svm_helper.c > index f1fabf5..cc8c2ec 100644 > --- a/target-i386/svm_helper.c > +++ b/target-i386/svm_helper.c > @@ -354,7 +354,7 @@ void helper_vmrun(CPUX86State *env, int aflag, int next_eip_addend) > void helper_vmmcall(CPUX86State *env) > { > cpu_svm_check_intercept_param(env, SVM_EXIT_VMMCALL, 0); > - raise_exception(env, EXCP06_ILLOP); > + raise_exception_ra(env, EXCP06_ILLOP, GETPC()); > } > > void helper_vmload(CPUX86State *env, int aflag) > @@ -457,7 +457,7 @@ void helper_skinit(CPUX86State *env) > { > cpu_svm_check_intercept_param(env, SVM_EXIT_SKINIT, 0); > /* XXX: not implemented */ > - raise_exception(env, EXCP06_ILLOP); > + raise_exception_ra(env, EXCP06_ILLOP, GETPC()); > } Either these are missing a change to translate.c, or they're pointless changes. Probably the later. r~