Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1175570rwd; Thu, 1 Jun 2023 11:29:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4BueAPU25Ypvxtsh0Bhv+6299hSMleDSD/o6WlnZ01mZ9ug1LRNE3UEPZqDS3vZskCpBsM X-Received: by 2002:a05:6a00:21d1:b0:64d:2365:fbab with SMTP id t17-20020a056a0021d100b0064d2365fbabmr3122993pfj.4.1685644146908; Thu, 01 Jun 2023 11:29:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685644146; cv=none; d=google.com; s=arc-20160816; b=P0vbw3Mzc78YLKUuYPjplOteS0jtOsyGi1Czt64JkfFl/s1xxpp45b3L+0xuaSW3Kj wXowZzZJYmYK+MfEYuIIJeHecGQYh9EDayA3tOL8Jhvgd6XSWcB4CwU+rgVhlckvsqUz 8shAoM7mMZ+U3+IpeK/Ie/jRU2PRtvTyc+bOxF3fyIcB50+0XkuEc7kOyZQXt+GuZVov tQGyiLOK9Cy8QqE1cPyqA+65we4CWc+LHNfbbZI/MOziJ9LUFRlKMIOkCnVqdcBQgZS0 SJrHFaPfl4R7CfrpBrLMyYRChF9KED8Iuw+KTj0x4ndR+M4IuQgjfNLbjyFDf7h5zi6y WOtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=efFhcI9QiJJlyiXbBpdpKvDvm23k7AyskbJFQ1uKZ7w=; b=KLcgvUG1zF8ScyI+9if8fxKXCxAUUZYP30fvrGiVi1ftcHG69yXEzCLVFFqXLRg16W DEgJYDGcrvy7YvT9ixYAW8sVwX0O4JmNt9TYBJUXBXoLx5+qMOS7k8WxLjiTerow/WLS G3ZymF8w8S7ezAIzs4xrSbwkGm7zrP3h40yUxC23g14KqC7KutSbsfQPHMnOv8P1+5wu svAsDjjJVs5eEAyHKfyATuRht6XzzilayyGPPP6/0xizJZ2ktimj2gwPanW5kodlYEEB lCm5MlObcGlUtlN9Ri0OSeR7RbamJnFxb0ado3Gze2kkGde+3wGTSq5rEg532LKf8tVf FA9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=qBMI7+8P; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j13-20020a637a4d000000b0053ef469282bsi3248997pgn.645.2023.06.01.11.28.55; Thu, 01 Jun 2023 11:29: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; dkim=pass header.i=@google.com header.s=20221208 header.b=qBMI7+8P; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232417AbjFASFA (ORCPT + 99 others); Thu, 1 Jun 2023 14:05:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232144AbjFASEx (ORCPT ); Thu, 1 Jun 2023 14:04:53 -0400 Received: from mail-pl1-x64a.google.com (mail-pl1-x64a.google.com [IPv6:2607:f8b0:4864:20::64a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D2448E for ; Thu, 1 Jun 2023 11:04:52 -0700 (PDT) Received: by mail-pl1-x64a.google.com with SMTP id d9443c01a7336-1b0213d4b43so5411495ad.1 for ; Thu, 01 Jun 2023 11:04:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1685642692; x=1688234692; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=efFhcI9QiJJlyiXbBpdpKvDvm23k7AyskbJFQ1uKZ7w=; b=qBMI7+8PByQ26gmjTNFpl5OS+p9zL4Bm8vUg1wsBHVDIMcf2t6c89urPLcbI/PxUGP 131NtdXZg/BwyvSWQqyYDwHPhGflmy2+WkaGmE+muB8yG1NoSvSfozQr4CCgW+uWbeER 2GV+aYCGMf3Rw5CNJrMJIVSvoCWPiN/RwHlMdm+sTMT55M3pLCyaholQqcz3wY0qcvHO 8ymSDCLyRknAnkR6DPNzpu5jEu+Hb4YitGPw/sguqval3CxB9SThUCyOV0Rts3bzT4eH E4CyNUcvuspktTikCVPDMl9PqxOKWePCVYXd8p/VYUcThizQJJROGnVWgKE7wMZW9sJ8 saYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685642692; x=1688234692; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=efFhcI9QiJJlyiXbBpdpKvDvm23k7AyskbJFQ1uKZ7w=; b=BukgJndAjSPjAjb0ysPVzcV4UsA/SZEocyktktSqvotMo0SLVKBAsquy/E9Irsn1ZM Csm4HBfEuom9zoz/DYAdqDDrdPmnck2WvV1UXKP3caDlE9P56WRy4pLQHCprZn9c00OQ a/DVtwE169GbuAHzp8Kr/Ofwu+IPQNDc620CuPwb++pzxm1bv9HWqWN9rC3GjPwzslbE Vgv1Y59KQpKqal8hG6Ibpvlp/sw2bQJtV+LuRhVLv13Z4U+k5wdPblZOLzQOiVJRc7Zx e9pLpxtCA8iQTHLI8ZRd30Hc6yZjf4cCFwE0cc0xxsnqrdFFMpB3SrUY/182T/uZPehV E4rQ== X-Gm-Message-State: AC+VfDws8pEPhWrIXq8aHo9UAyz239dNuYpU9cQomrT+URM4QqeskSsY h5ZGyN/e9yaKz8L1tNkcAeiP6FqSnDE= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:903:2449:b0:1ae:83eb:eaa with SMTP id l9-20020a170903244900b001ae83eb0eaamr74757pls.0.1685642691862; Thu, 01 Jun 2023 11:04:51 -0700 (PDT) Date: Thu, 1 Jun 2023 11:04:43 -0700 In-Reply-To: Mime-Version: 1.0 References: Message-ID: Subject: Re: [PATCH] KVM: SVM: vNMI pending bit is V_NMI_PENDING_MASK not V_NMI_BLOCKING_MASK From: Sean Christopherson To: "Maciej S. Szmigiero" 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 Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL 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 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.