From patchwork Tue Apr 3 15:00:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 10321391 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 443F7602C8 for ; Tue, 3 Apr 2018 15:04:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3402D280CF for ; Tue, 3 Apr 2018 15:04:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 28407284D2; Tue, 3 Apr 2018 15:04:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 10834280CF for ; Tue, 3 Apr 2018 15:04:12 +0000 (UTC) Received: from localhost ([::1]:40955 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3NTn-0002vB-BL for patchwork-qemu-devel@patchwork.kernel.org; Tue, 03 Apr 2018 11:04:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53685) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3NR4-0000gC-Cs for qemu-devel@nongnu.org; Tue, 03 Apr 2018 11:01:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3NQz-00005U-V7 for qemu-devel@nongnu.org; Tue, 03 Apr 2018 11:01:22 -0400 Received: from mout.web.de ([212.227.15.3]:54355) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f3NQz-0008VU-Lt for qemu-devel@nongnu.org; Tue, 03 Apr 2018 11:01:17 -0400 Received: from md1f2u6c.ww002.siemens.net ([92.77.50.102]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Lylol-1ePzoT03C3-016Bby; Tue, 03 Apr 2018 17:01:06 +0200 From: Jan Kiszka To: qemu-devel , Paolo Bonzini , Richard Henderson , Eduardo Habkost Date: Tue, 3 Apr 2018 17:00:55 +0200 Message-Id: <37939b244dda0e9cccf96ce50f2b15df1e48315d.1522767657.git.jan.kiszka@web.de> X-Mailer: git-send-email 2.13.6 In-Reply-To: References: In-Reply-To: References: X-Provags-ID: V03:K0:r9njDMJLosupMsa8Qrylh5Ut6AeCAEAH2ebxG3aXrdyDwz2eMEI NutSDyjyHTf+yp+6ySdeXk3lj+CCOJPZ1FVaknfT6VRbdDc+FdaWdDmZFXYaPjxFuW2X5XC mGSTbnUDP3AJhT8f/BTdXgiiD39TmmLR+7TIOB6vWsJrE+lst5cg0oXp/mBwfNvhVWQP+Yq L1Iq/Q5wzrXDK/c0/GRHA== X-UI-Out-Filterresults: notjunk:1; V01:K0:89KKGERs6bA=:uibZfgmWdf43+AazDNw75a FDoplXSWoUFp6ZC+XtzzFBj/7KFX+AHWwPfzVBph1MCX+nRwh6pM64O8Fe908m5oYb746tJwX I4ngGcTYiLveJERMwLi2RN8TQnfAVGmYlb7+u9piC7Ulx6sJvE/CG3jf8f2BDlZR1TsWJiEBB 33hmHyWhFIkE+y22sVr8PWRT0J6iLsQzLe/ohyDtJ9VhdbxVG5Pe9a84RUXyLVfKTVfIoXc6W d0WpsW6TyCfDLEAspkLXN/Vn2IREBi7yjVbPuOwyneaqhU/JNxnlr6SovG5GQzTVaDfg81bTE HHkhhTryFIpdW6Px8+o2vCqJK1ZkYErmUjBCAeCl1ZqwpvP1fgFY561juWZdPIVOlqV8wtJun 9M9TjtZdA5CBl9AulL1nqmkxk67LXM7uRf8qKFzJzYq328UDua8NynUW7psV+zz1X8Kwrb9Im mkvQNpIIpNUQP2mvaBSmTyudSXCRJpZpW2wE3KzVimA7JMmtkrksQmhCr0uzRmU7+hYLkDRM9 TuD21EzymUF4+wx5hpcMafGon6qX/RbzmtyO9R/tVeSbiLXMTQyDiq9wTTpzZBWENsvsO3Qbq D/qW1U+3tL1OQhedlp6+/izKIIqusl4JpFwgJAfrCFqeXhmw0V8l1eAWO/csKiMxSWExGso90 MLWUoCZdlIU2lZWmfiA99rOfhrL+NlbUVcUzZhLNKmWOi+THv7RYs4r1F7KhxNla8iz/3/59f SNomH6B5V8W8ETklpZp/ivPrDtOKCuxNeJDvtX7jrYNvM2rA1RKR7Wb97zl2jpBxH+85pMgcu b3QRlgMoKxmNDpRMOEL4LVQfY4Xlg== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.15.3 Subject: [Qemu-devel] [PATCH 2/4] target-i386: Allow interrupt injection after STGI X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Valentine Sinitsyn Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Jan Kiszka 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 --- target/i386/translate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 */