diff mbox series

[2/4] target-i386: Allow interrupt injection after STGI

Message ID 37939b244dda0e9cccf96ce50f2b15df1e48315d.1522767657.git.jan.kiszka@web.de
State New
Headers show
Series target-i386: Enhance SVM support | expand

Commit Message

Jan Kiszka April 3, 2018, 3 p.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

We need to terminate the translation block after STGI so that pending
interrupts can be injected.

This fixes pending NMI injection for Jailhouse which uses "stgi; clgi"
to open a brief injection window.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 target/i386/translate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/target/i386/translate.c b/target/i386/translate.c
index 0135415d92..71d97876c7 100644
--- a/target/i386/translate.c
+++ b/target/i386/translate.c
@@ -7450,8 +7450,9 @@  static target_ulong disas_insn(DisasContext *s, CPUState *cpu)
                 break;
             }
             gen_update_cc_op(s);
-            gen_jmp_im(pc_start - s->cs_base);
             gen_helper_stgi(cpu_env);
+            gen_jmp_im(s->pc - s->cs_base);
+            gen_eob(s);
             break;
 
         case 0xdd: /* CLGI */