[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 29/50] target/i386: Add stub generator for helper_set_dr
From: |
Richard Henderson |
Subject: |
[PULL 29/50] target/i386: Add stub generator for helper_set_dr |
Date: |
Wed, 19 May 2021 13:30:29 -0500 |
This removes an ifdef from the middle of disas_insn,
and ensures that the branch is not reachable.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-30-richard.henderson@linaro.org>
---
target/i386/tcg/translate.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index 5c321b338e..28eb0e8adf 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -179,6 +179,19 @@ typedef struct DisasContext {
#define REX_B(S) 0
#endif
+/*
+ * Many sysemu-only helpers are not reachable for user-only.
+ * Define stub generators here, so that we need not either sprinkle
+ * ifdefs through the translator, nor provide the helper function.
+ */
+#define STUB_HELPER(NAME, ...) \
+ static inline void gen_helper_##NAME(__VA_ARGS__) \
+ { qemu_build_not_reached(); }
+
+#ifdef CONFIG_USER_ONLY
+STUB_HELPER(set_dr, TCGv_env env, TCGv_i32 reg, TCGv val)
+#endif
+
static void gen_eob(DisasContext *s);
static void gen_jr(DisasContext *s, TCGv dest);
static void gen_jmp(DisasContext *s, target_ulong eip);
@@ -8075,7 +8088,6 @@ static target_ulong disas_insn(DisasContext *s, CPUState
*cpu)
case 0x121: /* mov reg, drN */
case 0x123: /* mov drN, reg */
if (check_cpl0(s)) {
-#ifndef CONFIG_USER_ONLY
modrm = x86_ldub_code(env, s);
/* Ignore the mod bits (assume (modrm&0xc0)==0xc0).
* AMD documentation (24594.pdf) and testing of
@@ -8104,7 +8116,6 @@ static target_ulong disas_insn(DisasContext *s, CPUState
*cpu)
gen_helper_get_dr(s->T0, cpu_env, s->tmp2_i32);
gen_op_mov_reg_v(s, ot, rm, s->T0);
}
-#endif /* !CONFIG_USER_ONLY */
}
break;
case 0x106: /* clts */
--
2.25.1
- [PULL 12/50] target/i386: Assert CODE64 for x86_64 user-only, (continued)
- [PULL 12/50] target/i386: Assert CODE64 for x86_64 user-only, Richard Henderson, 2021/05/19
- [PULL 16/50] target/i386: Tidy REX_B, REX_X definition, Richard Henderson, 2021/05/19
- [PULL 09/50] target/i386: Assert !VM86 for x86_64 user-only, Richard Henderson, 2021/05/19
- [PULL 14/50] target/i386: Assert !ADDSEG for x86_64 user-only, Richard Henderson, 2021/05/19
- [PULL 18/50] target/i386: Move rex_w into DisasContext, Richard Henderson, 2021/05/19
- [PULL 17/50] target/i386: Move rex_r into DisasContext, Richard Henderson, 2021/05/19
- [PULL 15/50] target/i386: Introduce REX_PREFIX, Richard Henderson, 2021/05/19
- [PULL 22/50] target/i386: Reduce DisasContext.prefix to uint8_t, Richard Henderson, 2021/05/19
- [PULL 23/50] target/i386: Reduce DisasContext.vex_[lv] to uint8_t, Richard Henderson, 2021/05/19
- [PULL 21/50] target/i386: Reduce DisasContext.override to int8_t, Richard Henderson, 2021/05/19
- [PULL 29/50] target/i386: Add stub generator for helper_set_dr,
Richard Henderson <=
- [PULL 19/50] target/i386: Remove DisasContext.f_st as unused, Richard Henderson, 2021/05/19
- [PULL 20/50] target/i386: Reduce DisasContext.flags to uint32_t, Richard Henderson, 2021/05/19
- [PULL 30/50] target/i386: Assert !SVME for user-only, Richard Henderson, 2021/05/19
- [PULL 26/50] target/i386: Reduce DisasContext jmp_opt, repz_opt to bool, Richard Henderson, 2021/05/19
- [PULL 32/50] target/i386: Implement skinit in translate.c, Richard Henderson, 2021/05/19
- [PULL 31/50] target/i386: Assert !GUEST for user-only, Richard Henderson, 2021/05/19
- [PULL 27/50] target/i386: Fix the comment for repz_opt, Richard Henderson, 2021/05/19
- [PULL 28/50] target/i386: Reorder DisasContext members, Richard Henderson, 2021/05/19
- [PULL 36/50] target/i386: Tidy svm_check_intercept from tcg, Richard Henderson, 2021/05/19
- [PULL 25/50] target/i386: Leave TF in DisasContext.flags, Richard Henderson, 2021/05/19