Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp313754pxb; Mon, 2 Nov 2020 23:33:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxSUBML4Ou11R0yDb9uWJclpFSRFO3Gt372iG80lFmuTA5Mg9yhip74xyESocG7pkdwLCfK X-Received: by 2002:a50:cbc9:: with SMTP id l9mr19911990edi.310.1604388804045; Mon, 02 Nov 2020 23:33:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604388804; cv=none; d=google.com; s=arc-20160816; b=Q+5vsEyvwegu6JxiTZs/M62xl58RVMOUqueE/pOldU0MuZ6DNAxsU83pkFabebRnW1 Zw7dw6ZHj/Ru8Rgt6UytwdnFHPOn54Stnx9BzfZ0fHUkJeD+2MMdSn2XKfAw32quoaE0 p7Qf5lL/cAA9BFGsssVlgHSY88AnDqI3ZJP0O9M30g2/2HVLt2Z6kjFteVcqJLUmWIVk Wx3b8oKUTOEB6NRYyBK3+xlZ8g2nKJ/bOCwTHIZjHtiZRonQrf3+McopENfPj59+5M9V Rzeo6AZfQctm6XX9UYzMEveCOjRvWe2I7RZtNWL9xQnNZQU4P23Dca/bjVjok0VWyaMq NLwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=r+sYEIM4Zbr5fkzy6Emw8mC6F4bGsxt7UdKKVxkgqjo=; b=SnAp3pp6tsqTYCPkqgiTL0ZDs3ACdDqzVXdRAAbxzVcBIbdnTNC6sRu3bXvtOkXpGe rvwWRA6sbP9SRVqf28zmvlSS6vFOu9U9UrK2UogcGoagOlPaRVYnCZUwVG73bU9UkMy5 wQP0PjiAUERWRBABHbY68zSkNdJZZJ5UNuVVZqFNNnDwDAghwC9spxU80qy0QAumjWct eaoYdgpJdXLU2Wnw7m9UuI+3MSyrkdnqOnrCUdUJZdaFHCjoc0vMrcoF8gtYnKItKp9P btafkQwLx7qKDqhB/1ybXnPVto2JgqITYUAybrNn/T5mUgF/RD3tHNALGYgLNgJ5P8oE Gvng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rn28si10955449ejb.585.2020.11.02.23.33.02; Mon, 02 Nov 2020 23:33:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727760AbgKCH3k (ORCPT + 99 others); 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: linux-kernel@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.