From patchwork Tue Apr 3 15:36:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 10321461 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 8ED1D60318 for ; Tue, 3 Apr 2018 15:38:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E9D4256E6 for ; Tue, 3 Apr 2018 15:38:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7335428BB5; Tue, 3 Apr 2018 15:38:59 +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 C5062256E6 for ; Tue, 3 Apr 2018 15:38:58 +0000 (UTC) Received: from localhost ([::1]:43615 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3O1R-0001yX-Ju for patchwork-qemu-devel@patchwork.kernel.org; Tue, 03 Apr 2018 11:38:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38191) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3NzA-0008Sw-EU for qemu-devel@nongnu.org; Tue, 03 Apr 2018 11:36:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3Nz7-00089R-7i for qemu-devel@nongnu.org; Tue, 03 Apr 2018 11:36:36 -0400 Received: from mout.web.de ([212.227.15.4]:37331) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f3Nz6-000898-Ui for qemu-devel@nongnu.org; Tue, 03 Apr 2018 11:36:33 -0400 Received: from md1f2u6c.ww002.siemens.net ([92.77.50.102]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LclHj-1ed9VH25hv-00k7tQ; Tue, 03 Apr 2018 17:36:24 +0200 From: Jan Kiszka To: qemu-devel , Paolo Bonzini , Richard Henderson , Eduardo Habkost Date: Tue, 3 Apr 2018 17:36:11 +0200 Message-Id: X-Mailer: git-send-email 2.13.6 In-Reply-To: References: In-Reply-To: References: X-Provags-ID: V03:K0:PrbzBDj66ovhyEaFR0ut4GjZ+9sen0VtMZNolgBZhn0CVCkxo9e 3D8pjMFqATtTW/Nl9gGB1ATjNiNx9Sxy36fiKQuTFiCKAPncRhHI9Hq4G9FcMClVLZJl1+w s+gcSg4ExTue8MjnfoaDsGOYU4Sl0be3TPGpL09GyDtqKWhXy5AWc2Slad3gJ8rQMZHbbYB brP3XjRIUa2J+yI8LOVBA== X-UI-Out-Filterresults: notjunk:1; V01:K0:qTxX9H+DBtU=:xRv0NNESfOx5L2Y8INyLjg A9RNZOozMU7V9+hCS2i8rQySqKGQQrJ06EXH/PsGiFDS5hAznIy/XaBM4pSWreE5KVQtwJe49 dI2/n5+ZhLkWBH9ZHlaClAR//M79H8CBWp7M/D/GKdPfAuCc2WDVwknRmeSIXnybTjPxrYZZV LtZpDgllW2AzE7qWev5wVc1Xkd5HVDSaGG3P4gDzzqkM2P7FNJ1rav9ELsJ8QzKajtaT04EnX LetCiMkufySTa2IXs9HBCrAv6LWFpsnV/Z65U/01fe6eNgfIS6wKTHhdZ5kdAhtVEMosxQd6y d/2M0gJuuNi45BlP7W8nIVr95MxBaxy/sRmxbrzpdRCkL/DzhVnQgbdtsN6sZlI5YUvT0iRbk ZZ8XMAqvygwxYqvb6twNFhgCwJBHmJ0J7nm044enZQkw5FUeS/6KEkP+6hwFZjFpnhc2rKLoh rbBd474MCxdeI9+1DWCXB8Y02rhm7W3eyXaKBGldfFqOh6Ax5kzt3k+ioiBUGl6IHtdiSpSlF Df3+qkwV7MispQnu5TQHduN74JEsIVSOt3BTQIp02IV7WlDdjmpZrqdqcNQ1/wlpWKgawZmo6 fZk0hHGjfRAfLcojjrPkhaE6JNObITTbXbM+n/XMfYYaKHTH/M9tRqHCLnUbobOFzIXUN2aVB +AT3rtWzak7nKHHSj8b102glJL50q0bvp5us0P3ZQlFyUxLMErZ7XwWWcBUNtftlTEMgLvwO9 s9AzD6RcgdfQg+x4Mlv2o/e2Ix32pKbUT22LHOckRBfQKh2Ec7tKcHmJf3cPN6uGZIKvsYAv9 Ulyk70NHkczqztmDJB2qaLkOUe0yg== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.15.4 Subject: [Qemu-devel] [PATCH v2 1/4] target-i386: Add NMI interception to SVM 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 Check for SVM interception prior to injecting an NMI. Tested via the Jailhouse hypervisor. Signed-off-by: Jan Kiszka --- target/i386/seg_helper.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/i386/seg_helper.c b/target/i386/seg_helper.c index 600a4d7586..00301a0c04 100644 --- a/target/i386/seg_helper.c +++ b/target/i386/seg_helper.c @@ -1337,6 +1337,7 @@ bool x86_cpu_exec_interrupt(CPUState *cs, int interrupt_request) ret = true; } else if ((interrupt_request & CPU_INTERRUPT_NMI) && !(env->hflags2 & HF2_NMI_MASK)) { + cpu_svm_check_intercept_param(env, SVM_EXIT_NMI, 0, 0); cs->interrupt_request &= ~CPU_INTERRUPT_NMI; env->hflags2 |= HF2_NMI_MASK; do_interrupt_x86_hardirq(env, EXCP02_NMI, 1);