Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2365374iob; Fri, 20 May 2022 07:51:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLcbdUuNoP+1nPp5C8lHR0U3TCFYJLUnCDsw5kO1umUU168mKqlKNssoeYPMkEovzEZO7C X-Received: by 2002:aa7:ce08:0:b0:42a:f7c9:2afd with SMTP id d8-20020aa7ce08000000b0042af7c92afdmr10324750edv.344.1653058292352; Fri, 20 May 2022 07:51:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1653058292; cv=pass; d=google.com; s=arc-20160816; b=qSiQIafMPDLw1+kZZTjtdjfkCiiPgBxXtQpIe2TIt7yp0ll7/az1oCV2oH5gdluVkh +zHLB8roZVWUk98cTdIY5BXKV7aTqEFP8bSnwzaCm7hT+Ylk6IZwb8xCAlnjClt91ljW Wp0qImNQUMzm6c/kUcv7cpRHgLyJylH4MBAZx77OsV22edvteHpQed3XsTWrlVXwf+UB yB8kF9UJvBEzEIN/Hu1b4E3pM1SoG3o4pswP1Hym/lheUJCMPGN+ggsWARuwWdBaw982 wLtWfmPEYuqtaYn6iSvIk5eApBx0LASpLd17meAm5UrMZM59uTmVGsZaCwTjbuH7H67s /beg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=zmqfmOLAbHXvgjQ2tw4QkrWOxozUxrZc/AWvNpPtfBk=; b=bW7BzCefUTiIeTc6tFz1JgPkmnxK02/0Jt9O9iTZHqrd267zDbM9Sr++8cAC4v5iQX NYMx93iWAPwrsRn76sZn5JmwP8lSSavfLY/YbU+qJRLSj6q57t9eu3pXNotzLbibzi70 G2nf+PuXfXAE17FB9bulrUVoC6ICS01uLUV+0mMndYwGkjQlVPMph3hW8PJSJiNDR83e mMPqhaGGnENW3o9jGQET97R1TflOLKNaWjQPhZOz2JJ3GNpaeUFxrTuChBE5nDTZXH/n cW8T01lWqs7F2u8vfWb15SHilghz4apmcT6TqB/vHQh3x6fffuDv+AevP5Vf+zPqgbzV O3PQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZxR0Muh8; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t4-20020a056402524400b0042b370a1538si779503edd.7.2022.05.20.07.51.06; Fri, 20 May 2022 07:51:32 -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=@intel.com header.s=Intel header.b=ZxR0Muh8; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347982AbiETJyY (ORCPT + 99 others); Fri, 20 May 2022 05:54:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229765AbiETJyV (ORCPT ); Fri, 20 May 2022 05:54:21 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FAA0FD343; Fri, 20 May 2022 02:54:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653040460; x=1684576460; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=hw6BQS58NxSFmaYN1BLFTk/I2GNWbBb80qoSt/RuY5w=; b=ZxR0Muh8isp3wIW7A5QEUq/1YqlbXst/wIyRFI8wysNFeRcKk/Io0Zfs sfWA2FnnnAeAFYkQMPzNKtgRd4SQamOCcRjjTE/u8DUotMpnIPmxlU1Mu Jh4/K9dlmVHPXUclmtmX48ivDLsoob93JmP+hi1P5xNZQAVcOuPDUqvnu HtOy7NqSJtY+pfxRPXQjCS2G2zAb5vmDfHiyTT60kzY1Yal1khr3Ezfa1 iJlVU3R4vyrpgAoYTPD4/2Z2jIdtJdwvOqzULYqL3cD1YXL8jlbUMo7TZ /N9Gz/aMlm2M0GNSymvmtiJegyIa4ZjbjgN7zDfImdCzIJ5ouZwjspTYr w==; X-IronPort-AV: E=McAfee;i="6400,9594,10352"; a="358962546" X-IronPort-AV: E=Sophos;i="5.91,238,1647327600"; d="scan'208";a="358962546" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2022 02:54:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,238,1647327600"; d="scan'208";a="701676479" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga004.jf.intel.com with ESMTP; 20 May 2022 02:54:18 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 20 May 2022 02:54:18 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Fri, 20 May 2022 02:54:18 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.173) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Fri, 20 May 2022 02:54:17 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h53LT5ElvgkSY6GJqGGbCfMwxNoxmiSc58OkG/1w8DJrpp+RWZzm2PDV8gCjnMgR6+1POKl+TW8agkf5eYlOpjVRQcrFh9qeB2CgnovyE8izQkgT6WTHuyVYci+xyPEI4VM1+XFZdCOpnMyHm/5tX+5xA7D8BbdhMgFxIIgSVTuyBaeX0CGROYFdMYcbxEZPppa/hOGu5+XYBauG9O0pBo1Pw2CEsvgEzKnfTv5i16nwTYT/rJ3HykJen/mIeIAj9rUyHg13R73Dga82Hn7nUZr2XWNhDRs0icUKcVmqgJg21/UA6CZYQt9KcBQ7Yqxl7bIcxmzpZGtr/NXec3MPZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zmqfmOLAbHXvgjQ2tw4QkrWOxozUxrZc/AWvNpPtfBk=; b=Ex1s797EpTEp4Q0esBIIYSxuY8bGztaAbC9L77ErGPQCkzic0rfkncVJ7e0E+c4+MCaq12JVphnaBObI34De9AuVXIxCWVeCEbfoz3+ixBJt82B4naC+Vd2EVRleFVx2Ysb2WGmJTtBb6rYfwXKqsYktDM8MHFL+CLK5//1UF/0CsjFSMbbP3N0dRsBLdNpq5vhyhIZ3IzmZeBcXSn/kGByGZ9TdMF112GIqxtspvaRCkGM/VSKC745i+V99F9KjKjT+mCe/22wBe9uicQSnhXlTDjmolVtD1M23xNyp0DK/5UJMN1+Qjun6sCUgJ3PJ4ZooSMHjD9tv+CRvKpqHWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM6PR11MB4138.namprd11.prod.outlook.com (2603:10b6:5:19a::31) by BN7PR11MB2530.namprd11.prod.outlook.com (2603:10b6:406:ac::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.16; Fri, 20 May 2022 09:54:15 +0000 Received: from DM6PR11MB4138.namprd11.prod.outlook.com ([fe80::e9d2:8b69:bb48:b305]) by DM6PR11MB4138.namprd11.prod.outlook.com ([fe80::e9d2:8b69:bb48:b305%7]) with mapi id 15.20.5273.017; Fri, 20 May 2022 09:54:14 +0000 From: "Xu, Yanfei" To: "Christopherson,, Sean" CC: "pbonzini@redhat.com" , "vkuznets@redhat.com" , "wanpengli@tencent.com" , "jmattson@google.com" , "joro@8bytes.org" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "dave.hansen@linux.intel.com" , "x86@kernel.org" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Wang, Wei W" , "Liang, Kan" Subject: RE: [PATCH] KVM: x86: Fix the intel_pt PMI handling wrongly considered from guest Thread-Topic: [PATCH] KVM: x86: Fix the intel_pt PMI handling wrongly considered from guest Thread-Index: AQHYaH+s6PwCFUVqKUabQKcfsjJv5a0hiOoAgAX7yBA= Date: Fri, 20 May 2022 09:54:14 +0000 Message-ID: References: <20220515171633.902901-1-yanfei.xu@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a302ce4e-168f-4b6a-863d-08da3a46b2d9 x-ms-traffictypediagnostic: BN7PR11MB2530:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: QQplcC0Wg8JuON5eW4jZ1ifuqA1/XruhGXXW4kr1MYCSa8LteDwY+nA0GVdKaz2owrYPpE72lKzBxbnAV6Fk5YMMSGvxkZFPyazV6NjaB9LUExI3OBO40ed2jeleienN11swO75qKp0WQ23tLK0Pz0Uzz3EWp9NGfH82xXNSuMTKJU9T8S//bMhtvKNG+h0uicNzoRWWpNmphqAT1Wuwry5S0jPUQQh75hIUAvp2vhz7u0L4RhmD2nLLu1hbEbVDNs+IeFWdD0Nz3JakRad5DfaVtAdSR5TNSXp2UKk9r7p77VKPCYURaUIffpyC0sQICXnQdnFJYwpY8OKRLmlf1OJExUCL+biAL9U7+dQ5qeffg/AiR5r8+jjFAR5JpKwyzqzIgXJD1Pvbj3Wb4ZPAobZ3ANwfCzlZyj7SLD910Yr0IcR+SydLuSITMX+Ja+o3Eqq1mT1Ykl8xegNv4HU+tCIY3/8G4i7xbxHXVfzb464I5yEqbPfuLvFrZhyYffOR18AwyyYiUae1IDi//FtjezKApBCS3NYtXwV2CILUzjRkLdCPMJtoOIyiBRurPDUfPVdw5PoeNfdyKbU/5V+zY5sCyGindYZ9hRznJXcTmZ3+IZWvROHE4oTaNr3eFj70UZhGV5DX71eFHPlscZf7O9vIw//fR3gVb6lJoObeGVDDqyazb3FV4z2gQQhm0LFU44rv7cPe1JO+UFQidzDCOQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4138.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(5660300002)(7416002)(38070700005)(86362001)(55016003)(54906003)(6916009)(33656002)(316002)(83380400001)(186003)(66446008)(64756008)(9686003)(2906002)(82960400001)(508600001)(4326008)(8676002)(38100700002)(122000001)(26005)(53546011)(71200400001)(8936002)(66556008)(76116006)(7696005)(52536014)(66476007)(6506007)(66946007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?9v/60GT0w3Sgiccaz1DY41/ik2XjVT5s9m8cjT4mJxv2hPQenfnSjiOSEbo/?= =?us-ascii?Q?8iVt7W98GM5N5i6HRXpQVtCq8DVIeGgQFe1KN1y/C+gZjiY/t0PLBBZ4/aU/?= =?us-ascii?Q?eSl8BRJkzoy1dU4ganeUKA6+vjkhyX5jv8C7gjG5HMfTJ77w2HXHHKboa5rk?= =?us-ascii?Q?Z/XyixL5PyrwvSisMv7vh/3A5F3kKh9/lZcU1UEjlnKMJCHKqD+twFJgH3J1?= =?us-ascii?Q?mu9B0LbXuYGtBFzlyhUVEKZDy4L/UbJIJibKZ/VQmf5A8DieJ+TmX8J5bU6R?= =?us-ascii?Q?/WopzhS/3e1KqA4FwpnHga8+M/p2P2HEdqjPtPFIcPDAwMIk8ytN1cDGbC2U?= =?us-ascii?Q?LFmaiKPxOzlKxVeNvGUmb/SHlOqkap8AwCSVLYbtSXx2Sv99s+WyzuChiNNq?= =?us-ascii?Q?Er7VHPQCYpix7SaZf+g0lP+zEPnG/L4lcm5M0sEiVavg/+pfB1Je37gAtlck?= =?us-ascii?Q?3IkNdI7bnHLBKlJiWL7puqyPzfctBf8tPDVWBpaaMdOpIRnTAObYt9Y/VVtl?= =?us-ascii?Q?sza8pwa19yxgTyl+2rdYjrFLzl+5GnAvACu3fMbND3d7L6EKneC1S4/Eb28I?= =?us-ascii?Q?UpkKCeDAoS/lOMKw65vccShhLqHu8XfhXVMC4Utkx6cHsCaUDINQmFcfT7BP?= =?us-ascii?Q?2w1MNjbY0D4Bhg5V6vwRmt5MZD/cVZeYGFounXOvYM4nE+Bv9iVcmx8rezcE?= =?us-ascii?Q?fHXcOzElmD27Y9Rki+RoKSYhJxuXpjfOi21lHDbtvNc7jjpte18/OR2yHjBX?= =?us-ascii?Q?L6yi5D9Q0iQngH43PadUbA5tvdEP2w3xWDr++eQXfVyFZsk8k6E7jeimsrNr?= =?us-ascii?Q?lgFmiOQ39wW4sBoEB7+Y+ng85tRLM0FRsgHvZn380rYLYHSP3Z0EFuNSOi0C?= =?us-ascii?Q?/lsJe5Pybxh70YRX4XvY54nltdHpuE1q2WjkSP9FgdNWcv//y4d4qxyTuha3?= =?us-ascii?Q?n34WuKRubRqTiSA1HZ/qoDWnt1e6QMt/Vzn37MoYzfehEqqsIxRV8othr8eq?= =?us-ascii?Q?vwsebw/++NszH47KGDIUISaubr1qBNXaT4JBN0JKDFCw57u12Ep4Ja6bxyKO?= =?us-ascii?Q?TMaBFLhRV1XG3LEFkx+d3HAnwy2GquNYZn2mnDkKpvVt0/QUiUnm49T4xXsq?= =?us-ascii?Q?HKzZUPIGdh55D/sy2mZGT5sdFV+0QmTBFb3Rr9R0Hmax+UdhUKrpQzscmSeN?= =?us-ascii?Q?ms9I31o4ftGb9y0MJcELkUTcjmz7z2kOw80D205zybkI+EqyWVZ2FZ07YWFv?= =?us-ascii?Q?YqDXtqSEV9fZ2TILicUig4jWuEd08jlHs885yCGWb8cnh8sxev3m8HUXezrD?= =?us-ascii?Q?B81jbLyS+hys3JPpEnL2Sq0aaCRMTdhyavoVRd9l+HiDiQ+EgnGOpiooL3Ar?= =?us-ascii?Q?65g6UBZ+NSFQKzo2paRlFQFclXsbeI/bwmmViBkPA3j8Ap5+05XprG8wGj2Q?= =?us-ascii?Q?jPRkyfLvt2AoIiMZCuHX1Q7AwV/ts3KDTga3jqAqz4jLvieTisyJlh+9BY3V?= =?us-ascii?Q?QX19DkIgV2D1h+AZfp3kOMcpkqYB2dF/5ADp0vyfnrONJwAP2iepHu2aZT7I?= =?us-ascii?Q?cLEKwMmBk2thdWqcopxqIW+VGUtnULQoV8PyG0+WpvfcU4ruBPK5Ci8FAAJJ?= =?us-ascii?Q?Hr02GFju1AEhR6MaBePwEyHWkxUsf/N+CYIG6Wo2eXyHzQHbCqjKdUw3f4P2?= =?us-ascii?Q?H/ZQ5ggLo2Epj0kTKDee6ShLB3iyeCWBoP+6UDKugcibHZetMW3uTq/iunng?= =?us-ascii?Q?h/ynfaVkPQ=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4138.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a302ce4e-168f-4b6a-863d-08da3a46b2d9 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 May 2022 09:54:14.8599 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 8UIufCUawjStI0miAGLbOq5/KidUGgHk9ywLxalb2AUNLnhpQfftlTOMcqYKiOcvk6PGI2LsNLoBmU8DV1ZYww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR11MB2530 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,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 Hi Sean, You are right, the change of kvm_arch_pmi_in_guest is incorrect, because it= should cover two cases of PMI.=20 For the PMI of intel pt, it certainly is the NMI PMI. So how about fixing i= t like below? diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index 610355b9ccce..378036c1cf94 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -7856,7 +7856,7 @@ static unsigned int vmx_handle_intel_pt_intr(void) struct kvm_vcpu *vcpu =3D kvm_get_running_vcpu(); /* '0' on failure so that the !PT case can use a RET0 static call. = */ - if (!kvm_arch_pmi_in_guest(vcpu)) + if (!kvm_handling_nmi_from_guest(vcpu)) return 0; kvm_make_request(KVM_REQ_PMI, vcpu); Thanks, Yanfei -----Original Message----- From: Sean Christopherson =20 Sent: Monday, May 16, 2022 9:58 PM To: Xu, Yanfei Cc: pbonzini@redhat.com; vkuznets@redhat.com; wanpengli@tencent.com; jmatts= on@google.com; joro@8bytes.org; tglx@linutronix.de; mingo@redhat.com; bp@al= ien8.de; dave.hansen@linux.intel.com; x86@kernel.org; kvm@vger.kernel.org; = linux-kernel@vger.kernel.org Subject: Re: [PATCH] KVM: x86: Fix the intel_pt PMI handling wrongly consid= ered from guest On Mon, May 16, 2022, Yanfei Xu wrote: > When kernel handles the vm-exit caused by external interrupts and PMI,=20 > it always set a type of kvm_intr_type to handling_intr_from_guest to=20 > tell if it's dealing an IRQ or NMI. > However, the further type judgment is missing in kvm_arch_pmi_in_guest(). > It could make the PMI of intel_pt wrongly considered it comes from a=20 > guest once the PMI breaks the handling of vm-exit of external interrupts. >=20 > Fixes: db215756ae59 ("KVM: x86: More precisely identify NMI from guest=20 > when handling PMI") > Signed-off-by: Yanfei Xu > --- > arch/x86/include/asm/kvm_host.h | 8 +++++++- > arch/x86/kvm/x86.h | 6 ------ > 2 files changed, 7 insertions(+), 7 deletions(-) >=20 > diff --git a/arch/x86/include/asm/kvm_host.h=20 > b/arch/x86/include/asm/kvm_host.h index 4ff36610af6a..308cf19f123d=20 > 100644 > --- a/arch/x86/include/asm/kvm_host.h > +++ b/arch/x86/include/asm/kvm_host.h > @@ -1582,8 +1582,14 @@ static inline int kvm_arch_flush_remote_tlb(struct= kvm *kvm) > return -ENOTSUPP; > } > =20 > +enum kvm_intr_type { > + /* Values are arbitrary, but must be non-zero. */ > + KVM_HANDLING_IRQ =3D 1, > + KVM_HANDLING_NMI, > +}; > + > #define kvm_arch_pmi_in_guest(vcpu) \ > - ((vcpu) && (vcpu)->arch.handling_intr_from_guest) > + ((vcpu) && (vcpu)->arch.handling_intr_from_guest =3D=3D=20 > +KVM_HANDLING_NMI) My understanding is that this isn't correct as a general change, as perf ev= ents can use regular IRQs in some cases. See commit dd60d217062f4 ("KVM: x= 86: Fix perf timer mode IP reporting"). I assume there's got to be a way to know which mode perf is using, e.g. we = should be able to make this look something like: ((vcpu) && (vcpu)->arch.handling_intr_from_guest =3D=3D kvm_pmi_vector) > void kvm_mmu_x86_module_init(void); > int kvm_mmu_vendor_module_init(void); diff --git a/arch/x86/kvm/x86.h=20 > b/arch/x86/kvm/x86.h index 588792f00334..3bdf1bc76863 100644 > --- a/arch/x86/kvm/x86.h > +++ b/arch/x86/kvm/x86.h > @@ -344,12 +344,6 @@ static inline bool kvm_cstate_in_guest(struct kvm *k= vm) > return kvm->arch.cstate_in_guest; > } > =20 > -enum kvm_intr_type { > - /* Values are arbitrary, but must be non-zero. */ > - KVM_HANDLING_IRQ =3D 1, > - KVM_HANDLING_NMI, > -}; > - > static inline void kvm_before_interrupt(struct kvm_vcpu *vcpu, > enum kvm_intr_type intr) > { > -- > 2.32.0 >=20