diff mbox series

[1/7] target/i386: fix INVD vmexit

Message ID 20230618215114.107337-2-pbonzini@redhat.com
State New
Headers show
Series target/i386: add a few simple features | expand

Commit Message

Paolo Bonzini June 18, 2023, 9:51 p.m. UTC
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).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/tcg/translate.c | 2 +-
 1 file changed, 1 insertions(+), 1 deletions(-)

Comments

Richard Henderson June 19, 2023, 7:17 a.m. UTC | #1
On 6/18/23 23:51, Paolo Bonzini wrote:
> 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).
> 
> Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
> ---
>   target/i386/tcg/translate.c | 2 +-
>   1 file changed, 1 insertions(+), 1 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
diff mbox series

Patch

diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index 5cf14311a60..9783fe80a30 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -6119,7 +6119,7 @@  static bool 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;