Skip to content

Commit

Permalink
target/i386: Implement skinit in translate.c
Browse files Browse the repository at this point in the history
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>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-33-richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed May 19, 2021
1 parent b322b3a commit e6aeb94
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 16 deletions.
1 change: 0 additions & 1 deletion target/i386/helper.h
Expand Up @@ -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 */
Expand Down
7 changes: 0 additions & 7 deletions target/i386/tcg/sysemu/svm_helper.c
Expand Up @@ -412,13 +412,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);
Expand Down
7 changes: 3 additions & 4 deletions target/i386/tcg/translate.c
Expand Up @@ -7578,10 +7578,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)) {
Expand Down
4 changes: 0 additions & 4 deletions target/i386/tcg/user/svm_stubs.c
Expand Up @@ -46,10 +46,6 @@ void helper_clgi(CPUX86State *env)
{
}

void helper_skinit(CPUX86State *env)
{
}

void helper_invlpga(CPUX86State *env, int aflag)
{
}
Expand Down

0 comments on commit e6aeb94

Please sign in to comment.