Message ID | 20210514151342.384376-37-richard.henderson@linaro.org |
---|---|
State | Superseded |
Headers | show |
Series | target/i386 translate cleanups | expand |
On 14/05/21 17:13, Richard Henderson wrote: > The param argument to helper_svm_check_intercept_param is always 0; > eliminate it and rename to helper_svm_check_intercept. Fold > gen_sve_check_intercept_param into gen_svm_check_intercept. ^^^ Too much ARM lately. :) Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> > Signed-off-by: Richard Henderson <richard.henderson@linaro.org> > --- > target/i386/helper.h | 2 +- > target/i386/tcg/sysemu/svm_helper.c | 5 ++--- > target/i386/tcg/translate.c | 16 ++++------------ > 3 files changed, 7 insertions(+), 16 deletions(-) > > diff --git a/target/i386/helper.h b/target/i386/helper.h > index f794d1c7c7..86484a4ec4 100644 > --- a/target/i386/helper.h > +++ b/target/i386/helper.h > @@ -107,7 +107,7 @@ DEF_HELPER_2(inl, tl, env, i32) > > #ifndef CONFIG_USER_ONLY > DEF_HELPER_FLAGS_4(bpt_io, TCG_CALL_NO_WG, void, env, i32, i32, tl) > -DEF_HELPER_3(svm_check_intercept_param, void, env, i32, i64) > +DEF_HELPER_2(svm_check_intercept, void, env, i32) > DEF_HELPER_4(svm_check_io, void, env, i32, i32, i32) > DEF_HELPER_3(vmrun, void, env, int, int) > DEF_HELPER_1(vmmcall, void, env) > diff --git a/target/i386/tcg/sysemu/svm_helper.c b/target/i386/tcg/sysemu/svm_helper.c > index 79c73d67af..b431016e72 100644 > --- a/target/i386/tcg/sysemu/svm_helper.c > +++ b/target/i386/tcg/sysemu/svm_helper.c > @@ -506,10 +506,9 @@ void cpu_svm_check_intercept_param(CPUX86State *env, uint32_t type, > } > } > > -void helper_svm_check_intercept_param(CPUX86State *env, uint32_t type, > - uint64_t param) > +void helper_svm_check_intercept(CPUX86State *env, uint32_t type) > { > - cpu_svm_check_intercept_param(env, type, param, GETPC()); > + cpu_svm_check_intercept_param(env, type, 0, GETPC()); > } > > void helper_svm_check_io(CPUX86State *env, uint32_t port, uint32_t param, > diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c > index 8a02c5a373..12ef2cf064 100644 > --- a/target/i386/tcg/translate.c > +++ b/target/i386/tcg/translate.c > @@ -197,7 +197,7 @@ STUB_HELPER(clgi, TCGv_env env) > STUB_HELPER(invlpga, TCGv_env env, TCGv_i32 aflag) > STUB_HELPER(set_dr, TCGv_env env, TCGv_i32 reg, TCGv val) > STUB_HELPER(stgi, TCGv_env env) > -STUB_HELPER(svm_check_intercept_param, TCGv_env env, TCGv_i32 t, TCGv_i64 p) > +STUB_HELPER(svm_check_intercept, TCGv_env env, TCGv_i32 type) > STUB_HELPER(svm_check_io, TCGv_env env, TCGv_i32 port, TCGv_i32 p, TCGv_i32 a) > STUB_HELPER(vmload, TCGv_env env, TCGv_i32 aflag) > STUB_HELPER(vmmcall, TCGv_env env) > @@ -2423,9 +2423,8 @@ static inline int svm_is_rep(int prefixes) > return ((prefixes & (PREFIX_REPZ | PREFIX_REPNZ)) ? 8 : 0); > } > > -static inline void > -gen_svm_check_intercept_param(DisasContext *s, target_ulong pc_start, > - uint32_t type, uint64_t param) > +static void gen_svm_check_intercept(DisasContext *s, target_ulong pc_start, > + uint32_t type) > { > /* no SVM activated; fast case */ > if (likely(!GUEST(s))) { > @@ -2433,14 +2432,7 @@ gen_svm_check_intercept_param(DisasContext *s, target_ulong pc_start, > } > gen_update_cc_op(s); > gen_jmp_im(s, pc_start - s->cs_base); > - gen_helper_svm_check_intercept_param(cpu_env, tcg_const_i32(type), > - tcg_const_i64(param)); > -} > - > -static inline void > -gen_svm_check_intercept(DisasContext *s, target_ulong pc_start, uint64_t type) > -{ > - gen_svm_check_intercept_param(s, pc_start, type, 0); > + gen_helper_svm_check_intercept(cpu_env, tcg_constant_i32(type)); > } > > static inline void gen_stack_update(DisasContext *s, int addend) >
diff --git a/target/i386/helper.h b/target/i386/helper.h index f794d1c7c7..86484a4ec4 100644 --- a/target/i386/helper.h +++ b/target/i386/helper.h @@ -107,7 +107,7 @@ DEF_HELPER_2(inl, tl, env, i32) #ifndef CONFIG_USER_ONLY DEF_HELPER_FLAGS_4(bpt_io, TCG_CALL_NO_WG, void, env, i32, i32, tl) -DEF_HELPER_3(svm_check_intercept_param, void, env, i32, i64) +DEF_HELPER_2(svm_check_intercept, void, env, i32) DEF_HELPER_4(svm_check_io, void, env, i32, i32, i32) DEF_HELPER_3(vmrun, void, env, int, int) DEF_HELPER_1(vmmcall, void, env) diff --git a/target/i386/tcg/sysemu/svm_helper.c b/target/i386/tcg/sysemu/svm_helper.c index 79c73d67af..b431016e72 100644 --- a/target/i386/tcg/sysemu/svm_helper.c +++ b/target/i386/tcg/sysemu/svm_helper.c @@ -506,10 +506,9 @@ void cpu_svm_check_intercept_param(CPUX86State *env, uint32_t type, } } -void helper_svm_check_intercept_param(CPUX86State *env, uint32_t type, - uint64_t param) +void helper_svm_check_intercept(CPUX86State *env, uint32_t type) { - cpu_svm_check_intercept_param(env, type, param, GETPC()); + cpu_svm_check_intercept_param(env, type, 0, GETPC()); } void helper_svm_check_io(CPUX86State *env, uint32_t port, uint32_t param, diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 8a02c5a373..12ef2cf064 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -197,7 +197,7 @@ STUB_HELPER(clgi, TCGv_env env) STUB_HELPER(invlpga, TCGv_env env, TCGv_i32 aflag) STUB_HELPER(set_dr, TCGv_env env, TCGv_i32 reg, TCGv val) STUB_HELPER(stgi, TCGv_env env) -STUB_HELPER(svm_check_intercept_param, TCGv_env env, TCGv_i32 t, TCGv_i64 p) +STUB_HELPER(svm_check_intercept, TCGv_env env, TCGv_i32 type) STUB_HELPER(svm_check_io, TCGv_env env, TCGv_i32 port, TCGv_i32 p, TCGv_i32 a) STUB_HELPER(vmload, TCGv_env env, TCGv_i32 aflag) STUB_HELPER(vmmcall, TCGv_env env) @@ -2423,9 +2423,8 @@ static inline int svm_is_rep(int prefixes) return ((prefixes & (PREFIX_REPZ | PREFIX_REPNZ)) ? 8 : 0); } -static inline void -gen_svm_check_intercept_param(DisasContext *s, target_ulong pc_start, - uint32_t type, uint64_t param) +static void gen_svm_check_intercept(DisasContext *s, target_ulong pc_start, + uint32_t type) { /* no SVM activated; fast case */ if (likely(!GUEST(s))) { @@ -2433,14 +2432,7 @@ gen_svm_check_intercept_param(DisasContext *s, target_ulong pc_start, } gen_update_cc_op(s); gen_jmp_im(s, pc_start - s->cs_base); - gen_helper_svm_check_intercept_param(cpu_env, tcg_const_i32(type), - tcg_const_i64(param)); -} - -static inline void -gen_svm_check_intercept(DisasContext *s, target_ulong pc_start, uint64_t type) -{ - gen_svm_check_intercept_param(s, pc_start, type, 0); + gen_helper_svm_check_intercept(cpu_env, tcg_constant_i32(type)); } static inline void gen_stack_update(DisasContext *s, int addend)
The param argument to helper_svm_check_intercept_param is always 0; eliminate it and rename to helper_svm_check_intercept. Fold gen_sve_check_intercept_param into gen_svm_check_intercept. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- target/i386/helper.h | 2 +- target/i386/tcg/sysemu/svm_helper.c | 5 ++--- target/i386/tcg/translate.c | 16 ++++------------ 3 files changed, 7 insertions(+), 16 deletions(-) -- 2.25.1