From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,HK_RANDOM_FROM,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CEAC1C388F7 for ; Tue, 3 Nov 2020 07:29:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9204022226 for ; Tue, 3 Nov 2020 07:29:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727709AbgKCH3k (ORCPT ); Tue, 3 Nov 2020 02:29:40 -0500 Received: from mga02.intel.com ([134.134.136.20]:58283 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725968AbgKCH3j (ORCPT ); Tue, 3 Nov 2020 02:29:39 -0500 IronPort-SDR: s+jbcbFJJD00Rs0Dvvvl07xJaxyHV8URDvbuDSA2VTvDP7kHsZnF9KwqIdLYLZc7qUOx6qyi2n R61fAIZCXrTg== X-IronPort-AV: E=McAfee;i="6000,8403,9793"; a="155999399" X-IronPort-AV: E=Sophos;i="5.77,447,1596524400"; d="scan'208";a="155999399" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2020 23:29:39 -0800 IronPort-SDR: 2JwyHF+rwKrId2o2gdW5kMJvmpmaWyM1RD2wpeRZSKOkKXWhh8O0W9HbVncpKH2lLycljKI0hc 8O+SJu5EubFg== X-IronPort-AV: E=Sophos;i="5.77,447,1596524400"; d="scan'208";a="470690411" Received: from xiaoyaol-mobl.ccr.corp.intel.com (HELO [10.239.13.118]) ([10.239.13.118]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2020 23:29:35 -0800 Subject: Re: [PATCH] KVM: VMX: Enable Notify VM exit To: Tao Xu , Andy Lutomirski Cc: Paolo Bonzini , "Christopherson, Sean J" , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , X86 ML , kvm list , LKML References: <20201102061445.191638-1-tao3.xu@intel.com> From: Xiaoyao Li Message-ID: Date: Tue, 3 Nov 2020 15:29:33 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 11/3/2020 2:08 PM, Tao Xu wrote: > > > On 11/3/20 12:43 AM, Andy Lutomirski wrote: >> On Sun, Nov 1, 2020 at 10:14 PM Tao Xu wrote: >>> ... >> >>> +static int handle_notify(struct kvm_vcpu *vcpu) >>> +{ >>> +       unsigned long exit_qualification = >>> vmcs_readl(EXIT_QUALIFICATION); >>> + >>> +       /* >>> +        * Notify VM exit happened while executing iret from NMI, >>> +        * "blocked by NMI" bit has to be set before next VM entry. >>> +        */ >>> +       if (exit_qualification & NOTIFY_VM_CONTEXT_VALID) { >>> +               if (enable_vnmi && >>> +                   (exit_qualification & INTR_INFO_UNBLOCK_NMI)) >>> +                       vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO, >>> +                                     GUEST_INTR_STATE_NMI); >> >> This needs actual documentation in the SDM or at least ISE please. >> Hi Andy, Do you mean SDM or ISE should call out it needs to restore "blocked by NMI" if bit 12 of exit qualification is set and VMM decides to re-enter the guest? you can refer to SDM 27.2.3 "Information about NMI unblocking Due to IRET" in latest SDM 325462-072US > Notify VM-Exit is defined in ISE, chapter 9.2: > https://software.intel.com/content/dam/develop/external/us/en/documents/architecture-instruction-set-extensions-programming-reference.pdf > > > I will add this information into commit message. Thank you for reminding > me.