target/i386: fix processing of intercept 0 (read CR0)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2024-05-09 14:34:24 +02:00
parent c0df9563a3
commit 024538287e
2 changed files with 3 additions and 2 deletions

View File

@ -221,7 +221,7 @@
#define vex13 .vex_class = 13,
#define chk(a) .check = X86_CHECK_##a,
#define svm(a) .intercept = SVM_EXIT_##a,
#define svm(a) .intercept = SVM_EXIT_##a, .has_intercept = true,
#define avx2_256 .vex_special = X86_VEX_AVX2_256,
@ -2559,7 +2559,7 @@ static void disas_insn(DisasContext *s, CPUState *cpu)
goto gp_fault;
}
}
if (decode.e.intercept && unlikely(GUEST(s))) {
if (decode.e.has_intercept && unlikely(GUEST(s))) {
gen_helper_svm_check_intercept(tcg_env,
tcg_constant_i32(decode.e.intercept));
}

View File

@ -272,6 +272,7 @@ struct X86OpEntry {
unsigned valid_prefix:16;
unsigned check:16;
unsigned intercept:8;
bool has_intercept:1;
bool is_decode:1;
};