From b17eea58c7497f96cb66d31b8c59fdcdb06b6c40 Mon Sep 17 00:00:00 2001 From: jipengfei_yewu Date: Sun, 24 Sep 2023 19:43:41 +0800 Subject: [PATCH] target/i386: fix INVD vmexit Due to a typo or perhaps a brain fart, the INVD vmexit was never generated. Fix it (but not that fixing just the typo would break both INVD and WBINVD, due to a case of two wrongs making a right). cheery-pick from 4d714d1a0bf1fca9576ee53a1a5dfa3fd5ddae99 Signed-off-by: jipengfei_yewu Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index e9e1451540..82f77b52fb 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -7773,7 +7773,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x108: /* invd */ case 0x109: /* wbinvd */ if (check_cpl0(s)) { - gen_svm_check_intercept(s, (b & 2) ? SVM_EXIT_INVD : SVM_EXIT_WBINVD); + gen_svm_check_intercept(s, (b & 1) ? SVM_EXIT_WBINVD : SVM_EXIT_INVD); /* nothing to do */ } break; -- 2.41.0.windows.1