[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 32/50] target/i386: Implement skinit in translate.c
From: |
Richard Henderson |
Subject: |
[PATCH 32/50] target/i386: Implement skinit in translate.c |
Date: |
Sun, 28 Feb 2021 15:23:03 -0800 |
Our sysemu implementation is a stub. We can already intercept
instructions for vmexit, and raising #UD is trivial.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/i386/helper.h | 1 -
target/i386/tcg/sysemu/svm_helper.c | 7 -------
target/i386/tcg/translate.c | 7 +++----
target/i386/tcg/user/svm_stubs.c | 4 ----
4 files changed, 3 insertions(+), 16 deletions(-)
diff --git a/target/i386/helper.h b/target/i386/helper.h
index 095520f81f..7a09efd55b 100644
--- a/target/i386/helper.h
+++ b/target/i386/helper.h
@@ -117,7 +117,6 @@ DEF_HELPER_2(vmload, void, env, int)
DEF_HELPER_2(vmsave, void, env, int)
DEF_HELPER_1(stgi, void, env)
DEF_HELPER_1(clgi, void, env)
-DEF_HELPER_1(skinit, void, env)
DEF_HELPER_2(invlpga, void, env, int)
/* x86 FPU */
diff --git a/target/i386/tcg/sysemu/svm_helper.c
b/target/i386/tcg/sysemu/svm_helper.c
index 5b9c6f18be..ca5a781a7e 100644
--- a/target/i386/tcg/sysemu/svm_helper.c
+++ b/target/i386/tcg/sysemu/svm_helper.c
@@ -423,13 +423,6 @@ void helper_clgi(CPUX86State *env)
env->hflags2 &= ~HF2_GIF_MASK;
}
-void helper_skinit(CPUX86State *env)
-{
- cpu_svm_check_intercept_param(env, SVM_EXIT_SKINIT, 0, GETPC());
- /* XXX: not implemented */
- raise_exception(env, EXCP06_ILLOP);
-}
-
void helper_invlpga(CPUX86State *env, int aflag)
{
X86CPU *cpu = env_archcpu(env);
diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index cd376a2c07..92e85e1872 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -7572,10 +7572,9 @@ static target_ulong disas_insn(DisasContext *s, CPUState
*cpu)
|| !PE(s)) {
goto illegal_op;
}
- gen_update_cc_op(s);
- gen_jmp_im(s, pc_start - s->cs_base);
- gen_helper_skinit(cpu_env);
- break;
+ gen_svm_check_intercept(s, pc_start, SVM_EXIT_SKINIT);
+ /* If not intercepted, not implemented -- raise #UD. */
+ goto illegal_op;
case 0xdf: /* INVLPGA */
if (!SVME(s) || !PE(s)) {
diff --git a/target/i386/tcg/user/svm_stubs.c b/target/i386/tcg/user/svm_stubs.c
index 97528b56ad..63b37f0de6 100644
--- a/target/i386/tcg/user/svm_stubs.c
+++ b/target/i386/tcg/user/svm_stubs.c
@@ -46,10 +46,6 @@ void helper_clgi(CPUX86State *env)
{
}
-void helper_skinit(CPUX86State *env)
-{
-}
-
void helper_invlpga(CPUX86State *env, int aflag)
{
}
--
2.25.1
- [PATCH 17/50] target/i386: Move rex_r into DisasContext, (continued)
- [PATCH 17/50] target/i386: Move rex_r into DisasContext, Richard Henderson, 2021/02/28
- [PATCH 26/50] target/i386: Reduce DisasContext jmp_opt, repz_opt to bool, Richard Henderson, 2021/02/28
- [PATCH 24/50] target/i386: Reduce DisasContext popl_esp_hack and rip_offset to uint8_t, Richard Henderson, 2021/02/28
- [PATCH 23/50] target/i386: Reduce DisasContext.vex_[lv] to uint8_t, Richard Henderson, 2021/02/28
- [PATCH 22/50] target/i386: Reduce DisasContext.prefix to uint8_t, Richard Henderson, 2021/02/28
- [PATCH 27/50] target/i386: Fix the comment for repz_opt, Richard Henderson, 2021/02/28
- [PATCH 28/50] target/i386: Reorder DisasContext members, Richard Henderson, 2021/02/28
- [PATCH 29/50] target/i386: Add stub generator for helper_set_dr, Richard Henderson, 2021/02/28
- [PATCH 36/50] target/i386: Tidy svm_check_intercept from tcg, Richard Henderson, 2021/02/28
- [PATCH 25/50] target/i386: Leave TF in DisasContext.flags, Richard Henderson, 2021/02/28
- [PATCH 32/50] target/i386: Implement skinit in translate.c,
Richard Henderson <=
- [PATCH 30/50] target/i386: Assert !SVME for user-only, Richard Henderson, 2021/02/28
- [PATCH 31/50] target/i386: Assert !GUEST for user-only, Richard Henderson, 2021/02/28
- [PATCH 33/50] target/i386: Eliminate SVM helpers for user-only, Richard Henderson, 2021/02/28
- [PATCH 35/50] target/i386: Simplify gen_debug usage, Richard Henderson, 2021/02/28
- [PATCH 34/50] target/i386: Mark some helpers as noreturn, Richard Henderson, 2021/02/28
- [PATCH 38/50] target/i386: Remove user stub for cpu_vmexit, Richard Henderson, 2021/02/28
- [PATCH 37/50] target/i386: Remove pc_start argument to gen_svm_check_intercept, Richard Henderson, 2021/02/28
- [PATCH 39/50] target/i386: Cleanup read_crN, write_crN, lmsw, Richard Henderson, 2021/02/28
- [PATCH 40/50] target/i386: Pass env to do_pause and do_hlt, Richard Henderson, 2021/02/28
- [PATCH 41/50] target/i386: Move invlpg, hlt, monitor, mwait to sysemu, Richard Henderson, 2021/02/28