From fab6f4cd3ae4471445e063417f1d923b4052deb5 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Tue, 3 Jul 2018 01:26:23 -0400 Subject: [PATCH] target-i386: Allow interrupt injection after STGI 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. Backports commit df2518aa587a0157bbfbc635fe47295629d9914a from qemu --- qemu/target/i386/translate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qemu/target/i386/translate.c b/qemu/target/i386/translate.c index 19d8bf17..2cacee0f 100644 --- a/qemu/target/i386/translate.c +++ b/qemu/target/i386/translate.c @@ -8074,8 +8074,9 @@ case 0x101: break; } gen_update_cc_op(s); - gen_jmp_im(s, pc_start - s->cs_base); gen_helper_stgi(tcg_ctx, cpu_env); + gen_jmp_im(s, s->pc - s->cs_base); + gen_eob(s); break; case 0xdd: /* CLGI */