Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1162667rwd; Thu, 1 Jun 2023 11:17:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ45BUINtKajmEiADXH/808cRuYNAjeWAqO9iKzTjr6bYNUihfm4ujU21cjWSvLRVvVmgCtA X-Received: by 2002:a05:6a00:10c9:b0:646:2edb:a23 with SMTP id d9-20020a056a0010c900b006462edb0a23mr11893705pfu.1.1685643426717; Thu, 01 Jun 2023 11:17:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685643426; cv=none; d=google.com; s=arc-20160816; b=wVQ5z7qmsiqpkyyi5svAqF9CZkmMj57QQ4MQccwttRn/KJ9kbsCEFHv+TMgUtz/A73 CmUhLXCUc9adkpLg2+Hktzfmf1kLE73ZEV2bSmTgtEJ1j9BXWkDYVe6LGwlASrXEPd3s nsBShhK/yRTWeEkjM1XhKUiB07s3sb1cMDwODlQvR+f4N0dexo0FfAgVUtdT020gOsKM RKIaCsP/4LYeYzdvWMd7fpPWNBtmOqFEeFDgiMgeA0hkwOH8ST7oN2tGgFtmwFVsbo51 7ILgFusiAlfMOkiw6im6AriZga5xVFBCt9pkwlEVfQzktcTMH1oLZTew4dv4jgElhIS2 qUoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=wp0YQYMAq0XkX3xn93TKxhLb/28jHSHBIXsKLomEFa8=; b=PxUYlMJo5Q8Mrlplh6vdPYqU+0TGhur2K2zHiFSuPGr06i29h+l+/te3B6gii4vSHc SnmQlFHwHyClsaeHmWnxox13u+qj3EduEKZvMtmAVXbd2zT9DZGJXHr8Qe/5RKhnz+6v 6n6bX1O+N4nbX1rHdOlnLloYtixW7miUAmTB2AQrBGun+zypGUwSJ1yACN2ckhlC1KLM wtuEweVN5bMx81I+UePlkRNWkiuhiAG605Qh5Hkw/PdZoqj08bIZbAvCQddnZOi+VkZR 2E/g/UbvPHUWGuQqg2Oqw0aPKo74dJScFCiHxfjDgqJR2j0vdqP5j8Sqamafbq5sUTq1 BXFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x13-20020a63b20d000000b00524cf947601si3145899pge.23.2023.06.01.11.16.24; Thu, 01 Jun 2023 11:17:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230151AbjFASFw (ORCPT + 99 others); Thu, 1 Jun 2023 14:05:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232052AbjFASFq (ORCPT ); Thu, 1 Jun 2023 14:05:46 -0400 Received: from vps-vb.mhejs.net (vps-vb.mhejs.net [37.28.154.113]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A33CD1B5; Thu, 1 Jun 2023 11:05:37 -0700 (PDT) Received: from MUA by vps-vb.mhejs.net with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q4mfy-0000do-Ji; Thu, 01 Jun 2023 20:05:30 +0200 Message-ID: <0c897867-42cb-60b0-aca7-7c8136411e1a@maciej.szmigiero.name> Date: Thu, 1 Jun 2023 20:05:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH] KVM: SVM: vNMI pending bit is V_NMI_PENDING_MASK not V_NMI_BLOCKING_MASK Content-Language: en-US, pl-PL To: Sean Christopherson Cc: Paolo Bonzini , Maxim Levitsky , Santosh Shukla , vkuznets@redhat.com, jmattson@google.com, thomas.lendacky@amd.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org References: From: "Maciej S. Szmigiero" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1.06.2023 20:04, Sean Christopherson wrote: > On Thu, Jun 01, 2023, Maciej S. Szmigiero wrote: >> On 19.05.2023 17:51, Sean Christopherson wrote: >>> On Fri, May 19, 2023, Maciej S. Szmigiero wrote: >>>> From: "Maciej S. Szmigiero" >>>> >>>> While testing Hyper-V enabled Windows Server 2019 guests on Zen4 hardware >>>> I noticed that with vCPU count large enough (> 16) they sometimes froze at >>>> boot. >>>> With vCPU count of 64 they never booted successfully - suggesting some kind >>>> of a race condition. >>>> >>>> Since adding "vnmi=0" module parameter made these guests boot successfully >>>> it was clear that the problem is most likely (v)NMI-related. >>>> >>>> Running kvm-unit-tests quickly showed failing NMI-related tests cases, like >>>> "multiple nmi" and "pending nmi" from apic-split, x2apic and xapic tests >>>> and the NMI parts of eventinj test. >>>> >>>> The issue was that once one NMI was being serviced no other NMI was allowed >>>> to be set pending (NMI limit = 0), which was traced to >>>> svm_is_vnmi_pending() wrongly testing for the "NMI blocked" flag rather >>>> than for the "NMI pending" flag. >>>> >>>> Fix this by testing for the right flag in svm_is_vnmi_pending(). >>>> Once this is done, the NMI-related kvm-unit-tests pass successfully and >>>> the Windows guest no longer freezes at boot. >>>> >>>> Fixes: fa4c027a7956 ("KVM: x86: Add support for SVM's Virtual NMI") >>>> Signed-off-by: Maciej S. Szmigiero >>> >>> Reviewed-by: Sean Christopherson >>> >> >> I can't see this in kvm/kvm.git trees or the kvm-x86 ones on GitHub - >> is this patch planned to be picked up for -rc5 soon? >> >> Technically, just knowing the final commit id would be sufficit for my >> purposes. > > If Paolo doesn't pick it up by tomorrow, I'll apply it and send a fixes pull > request for -rc5. Thanks Sean.