Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2295720rwb; Fri, 11 Nov 2022 07:32:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf7C+2HIVAMKjsc9/8akHRnqWYirzMRzC8SRs/w4re7+fxDp3z45iA9PF5bFt57VXZDw8ixS X-Received: by 2002:a05:6402:1004:b0:461:53b0:2ac0 with SMTP id c4-20020a056402100400b0046153b02ac0mr1882321edu.153.1668180772545; Fri, 11 Nov 2022 07:32:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668180772; cv=none; d=google.com; s=arc-20160816; b=othVVIEzIXyz23JpNvH77RP+eGL2C5wbya0uwAF+grKlbiW29YjzVK+5ZVChgqfi+p GSFDj5PuFkdsO2M0UBga9P06K2ndyhHznKBNqi5M46kaiIRlXhpPeipI4kBRqI8XHSu7 yM5Y5arzJv2Z9BC7+Led2iP+1GJuUisuIrqgQyIaZpKEl7U0YgmRQD+npALVQHLaq74o 1sTDwysIdd8UYYCTZiY3V6sH8n74zHC98QHOiiiJhyI7el7cxoS5gC2rA42US1Idqkre 6xxzzDwXk1wppbcXjCl4LcsRPz983a2WRAcEgyZ+xetENz2zN4GK27e6RFBNTmuyC6gy xX5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Sb7rhzFRTTVumBbHTQESASP2OPrWEPxQZs1Su9jVIS0=; b=MgnKq6R2LbSCtk1sysQbGgn0FjwNlEq5fY+wGEtl4r5bp10ltwyAcGp7XA2AfV3f1N FKI7uRPLOHxKFV8uIANvi8BLl6K4WMwKDDOlVtxyTqgaTSdcaMQkMh9OQ2KyB5Omx2UZ 9UC32bv1aUyeK9TEVmXntu78RPX/nOHjNNNBVF8lqnIKMDAa34dzGHvED059Y0LPepJQ JBlz9IlUTANtpARdZxmw48QViNlhMNJxiJTV/AuldcerGaVe7GQb+/UbonPQ9K2kP0bw VwWomj+Zp+mBRc2MfrIKwreodF/WhXbfjDDrIKXgCQQAp6HNPP/XvDaEQsRe4b0GXBLX CURA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=k7bnVmG5; 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 w19-20020a056402269300b0045db2dcff0esi3126811edd.594.2022.11.11.07.32.28; Fri, 11 Nov 2022 07:32:52 -0800 (PST) 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=@infradead.org header.s=desiato.20200630 header.b=k7bnVmG5; 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 S234419AbiKKOYg (ORCPT + 91 others); Fri, 11 Nov 2022 09:24:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233172AbiKKOYK (ORCPT ); Fri, 11 Nov 2022 09:24:10 -0500 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07EC043863; Fri, 11 Nov 2022 06:23:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=Sb7rhzFRTTVumBbHTQESASP2OPrWEPxQZs1Su9jVIS0=; b=k7bnVmG5wpWVyC1+0eVzQvuOPX MQhjYm/BIy+ccLdUF+xyA/giCUzSMkBXuC59bUHm2ZcizyQSJtaOKDVV6kRk8+sWsPOXy6marMMgP 0PDuJ/m1cJK5WwGYpZM7u3jjdVBR10VtQ5FmcaihgGNHYKQLtxqDVh689CbJpdjZIPOq/Rz4qeBJh gT4jzJparsbJHfYofxho2RCagrUoEPpFBULfHBKoTeJCN/Q53TOvfyL74CUkWAJWddiAazhYilwbP 14gHE55QmeZbHUZlxGxGT278Zqcjw0PC7WNHby0gwvf5KBH11F292rNAepWnRw2KDzBImyPdp9VLj jWSk7/Og==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1otUw6-0003qY-NW; Fri, 11 Nov 2022 14:23:15 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 7DBFA30036B; Fri, 11 Nov 2022 15:23:13 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 6593D2016A1E7; Fri, 11 Nov 2022 15:23:13 +0100 (CET) Date: Fri, 11 Nov 2022 15:23:13 +0100 From: Peter Zijlstra To: Paolo Bonzini Cc: "Li, Xin3" , "linux-kernel@vger.kernel.org" , "x86@kernel.org" , "kvm@vger.kernel.org" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "dave.hansen@linux.intel.com" , "hpa@zytor.com" , "Christopherson,, Sean" , "Tian, Kevin" Subject: Re: [RESEND PATCH 5/6] KVM: x86/VMX: add kvm_vmx_reinject_nmi_irq() for NMI/IRQ reinjection Message-ID: References: <20221110061545.1531-1-xin3.li@intel.com> <20221110061545.1531-6-xin3.li@intel.com> <6097036e-063f-5175-72b2-8935b12af853@redhat.com> <6fd26a70-3774-6ae7-73ea-4653aee106f0@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6fd26a70-3774-6ae7-73ea-4653aee106f0@redhat.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 Fri, Nov 11, 2022 at 01:48:26PM +0100, Paolo Bonzini wrote: > On 11/11/22 13:19, Peter Zijlstra wrote: > > On Fri, Nov 11, 2022 at 01:04:27PM +0100, Paolo Bonzini wrote: > > > On Intel you can optionally make it hold onto IRQs, but NMIs are always > > > eaten by the VMEXIT and have to be reinjected manually. > > > > That 'optionally' thing worries me -- as in, KVM is currently > > opting-out? > > Yes, because "If the “process posted interrupts” VM-execution control is 1, > the “acknowledge interrupt on exit” VM-exit control is 1" (SDM 26.2.1.1, > checks on VM-Execution Control Fields). Ipse dixit. Posted interrupts are > available and used on all processors since I think Ivy Bridge. (imagine the non-coc compliant reaction here) So instead of fixing it, they made it worse :-( And now FRED is arguably making it worse again, and people wonder why I hate virt...