Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2789056rwb; Fri, 11 Nov 2022 15:04:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf5gol9QKRFkpf/c5PP2lk3MC5S7MW9wpqRPlqS1IjStF7T4hymz4YgYBpQUejjPyjx86GYQ X-Received: by 2002:a17:906:3551:b0:7ae:43f5:a2a3 with SMTP id s17-20020a170906355100b007ae43f5a2a3mr3423705eja.595.1668207858897; Fri, 11 Nov 2022 15:04:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668207858; cv=none; d=google.com; s=arc-20160816; b=DK6n1cFmAi/BdUtwOw2k+pc2N2w9HdADJ7etNlQeOWolvxrrEGNAJ13L69hJ+SO70c 0nurySsAIeqi/ZjHBevZwpX/SPibsdGUCG9Z5888I5S0olC0YmRKJdrTv23QI+LiNk9E e3Dj4CxyliZKI0+O3zW94l/PcdzDg6+e9ApyZPugVD5cc9sQdcz1+RECqSLQsS1CRCPi VIPHy9zYWS5Vk7oydfQJ/w8kl7rn5pZjvHlQR9cFXNBReIueioMZhFPA8mN407/GxPJy 0ruehATXj1ognHdyQnM4gF/GaFxU5ACwJsILib/zBAUqMimuRCTgjibqPwLFofy9JRjF Bngw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:references:in-reply-to:user-agent:subject:cc:to:from :date:dkim-signature:dkim-filter; bh=O1ECDzgrNJ2QPuDyfHd9HOoEhnN8133IN4kF3vA+6+s=; b=IX3v7JEbdhAIb0glOS6MQbaFqh+ABaKqufwoYhU5OiztX+/rA4UuQ0faqTutPRMWsd k76xZ/ulpNflSSgslZBvSW91uvVAOdQcO91hK6T+GDnLgN8JtH8TYVS3ymRKO9ChEcbM t+yc85cZyh121DktJXIpljeRFDdaSm/CfX+U5kCAMHWuXrtJ8wdE01K1y9Hwp+ftdXLJ maNG3sBIq3M0DIiKzWHyzZnIXTzTjbcZGEI/ObbjcXb2k4zCPvUN3ioaKrpmLuOzRmor SoqdvhWz8xOQPyNoURn3x1kt/EoeX7PC5/qy1ViSDR7HNhKzUrp0VZieVTDCb5T4WE6K +YVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2022110601 header.b="T0ygx/O3"; 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=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q20-20020a056402519400b0046775196bdesi1004254edd.29.2022.11.11.15.03.52; Fri, 11 Nov 2022 15:04:18 -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=@zytor.com header.s=2022110601 header.b="T0ygx/O3"; 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=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234387AbiKKWPz (ORCPT + 90 others); Fri, 11 Nov 2022 17:15:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234272AbiKKWPx (ORCPT ); Fri, 11 Nov 2022 17:15:53 -0500 Received: from mail.zytor.com (unknown [IPv6:2607:7c80:54:3::138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E70274B997; Fri, 11 Nov 2022 14:15:52 -0800 (PST) Received: from [127.0.0.1] ([73.223.250.219]) (authenticated bits=0) by mail.zytor.com (8.17.1/8.17.1) with ESMTPSA id 2ABMFVHF1233540 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Fri, 11 Nov 2022 14:15:31 -0800 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 2ABMFVHF1233540 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2022110601; t=1668204932; bh=O1ECDzgrNJ2QPuDyfHd9HOoEhnN8133IN4kF3vA+6+s=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=T0ygx/O3H50+9+1+AHzvNkwaqnjRalu4WVESpKwHH5p2IE1nM5m9SDNTICIyydXDs 5XKctgVCQmZu2cS+1iqqUtNkuc1EiX+x9BsknQ++8yv8+NCh+jUjOBTI2kUq5sA04o bUO6nuhu/IcuR2/wywWSykPZHnNF2FMX4jLnX6IRJ9lw7iRnZiu3E1dtlkYAcEvO0F H758iwRWlxaH9s8KHbg+IRXR1yMXL7HhrLbIY6D1dCHApobnheBaJRYdoNint3gl8q 7RHVGojMt2KlCPkIMJS+2wlJcW9tF19WyogJp3OXNPF0jT7GHYCx1tt0z1tWqaARf+ B5Cb6cMJWnSrA== Date: Fri, 11 Nov 2022 14:15:28 -0800 From: "H. Peter Anvin" To: Peter Zijlstra , 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" , "Christopherson,, Sean" , "Tian, Kevin" Subject: =?US-ASCII?Q?Re=3A_=5BRESEND_PATCH_5/6=5D_KVM=3A_x86/VMX=3A_add_kvm=5F?= =?US-ASCII?Q?vmx=5Freinject=5Fnmi=5Firq=28=29_for_NMI/IRQ_reinjection?= User-Agent: K-9 Mail for Android In-Reply-To: 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> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RDNS_NONE,SPF_HELO_PASS, SPF_PASS autolearn=no 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 November 11, 2022 6:23:13 AM PST, Peter Zijlstra wrote: >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 al= ways >> > > eaten by the VMEXIT and have to be reinjected manually=2E >> >=20 >> > That 'optionally' thing worries me -- as in, KVM is currently >> > opting-out? >>=20 >> Yes, because "If the =E2=80=9Cprocess posted interrupts=E2=80=9D VM-exe= cution control is 1, >> the =E2=80=9Cacknowledge interrupt on exit=E2=80=9D VM-exit control is = 1" (SDM 26=2E2=2E1=2E1, >> checks on VM-Execution Control Fields)=2E Ipse dixit=2E Posted interr= upts are >> available and used on all processors since I think Ivy Bridge=2E > >(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=2E=2E=2E I object to saying that FRED is making it worse=2E Xin's patchset gets rid= of low-level assembly magic across the board and at least makes it obvious= what the code actually *does*, right now, as opposed to being buried in hi= ghly questionable assembly=2E It would also, regardless, be good to narrow down the set of possible even= ts that may have to be reinjected to the absolute minimum, *and* document t= hat in the code=2E That being said, if there are better ways of doing it, we should, and you = are certainly right that we may not have properly dug into if this code is = even exercised on platforms which will have FRED=2E