Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp32164lql; Fri, 12 Apr 2024 02:46:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVzh1W00HrZrvjEEw8PoCTULAwG3q+VVZBXVroDyiCUv+ytpsW/GceaJgbM31RWxw+y25xYhKPG5HBzRTo1TGeJoDW8zHZO0656jzBgIg== X-Google-Smtp-Source: AGHT+IHPNc8ENqPPTb8IqlmygXATVyHd2OUmIW0Pg9u0PeTsnUwpp8xOlpv97FbRScUhtbFvoFMb X-Received: by 2002:a05:6a21:6d98:b0:1a7:ab24:79e2 with SMTP id wl24-20020a056a216d9800b001a7ab2479e2mr6400796pzb.30.1712915186668; Fri, 12 Apr 2024 02:46:26 -0700 (PDT) Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 9-20020a631849000000b005cfd3333850si2817421pgy.106.2024.04.12.02.46.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 02:46:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142398-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=le2aAuXu; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-142398-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142398-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 2D091B21733 for ; Fri, 12 Apr 2024 09:24:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C5B0252F9C; Fri, 12 Apr 2024 09:21:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="le2aAuXu" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0BB624A39; Fri, 12 Apr 2024 09:21:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=198.175.65.19 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712913710; cv=fail; b=PYJJqDN9tgugQ1m3lTox8PB5lBbcykQEF1kyBrrFQrkSWwpaO7woVvGF/w8fIpjcBSuy/iPLBPrznMSJHzhtXMLoRSs52xvpEhOUTJt9GyfU+cFNNmmym5+p1CSVEr+s5zbT50fEUNS2xKRzazQDBXeCdeZqA9SoXs0hv6AdFJg= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712913710; c=relaxed/simple; bh=tk7DoxA3GsiLdbMz2SzGLUal3UyWq+PNCcatgbxN2UI=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=l+OWq7rr5HT0Xpdo8HCxvWLpFdj3nznmHnZlU9kxGi6D7bAc6XFu40ghPB2W4vPcKryKUajpmfyWgrSeYYLT5VQVEiHogE+0c9f2w0EaX1VjbmMosWhXFRGa/VYowwpzw729g1UDP36dNJ9n6hK0z1L65TpjC9Dh1ohNo6vvAz4= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=le2aAuXu; arc=fail smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712913709; x=1744449709; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=tk7DoxA3GsiLdbMz2SzGLUal3UyWq+PNCcatgbxN2UI=; b=le2aAuXupYYj5TmRO59lfYs9F7rBcH9qkwhVttQB+f0IQyjGbgWufdhI oy2dfMyUCy39dDhnVwirFzO/ZYKe9BdAgFPY8Q1WPG8yKRnHZZOJrqz8P UOaRE7m4IBpDRAvZZ86i1CmPzPjIarld6aLyCpfgg8+Wl7pzOFCjx3tZx 9gQG4wFSD7gO03vZ6pmxDCS3OBDTeNuEYrmb3Nn65C803AJ8WtT6xowaa UZpQYoy9hLd8eZ/CDEbc7xPtBtmjGnI9GULCAbnBrPEFQ1g5Wi5kjIpcN C+E4Wsxo40J6od/0saZPl0prjPzK1gHHaNfWSNORMSX0tofyl4Px+WG+5 Q==; X-CSE-ConnectionGUID: rDGxF0vGS9iP/s5AoTT3pw== X-CSE-MsgGUID: B7OkWlARSqWt/fwhZs+v7Q== X-IronPort-AV: E=McAfee;i="6600,9927,11041"; a="8235297" X-IronPort-AV: E=Sophos;i="6.07,195,1708416000"; d="scan'208";a="8235297" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2024 02:21:48 -0700 X-CSE-ConnectionGUID: J4kwKKo7Q/asCoF6uWCTCg== X-CSE-MsgGUID: vHM60tl2Q0W6/TtpV0d21A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,195,1708416000"; d="scan'208";a="44448608" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmviesa002.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 12 Apr 2024 02:21:47 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 12 Apr 2024 02:21:47 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Fri, 12 Apr 2024 02:21:47 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.41) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 12 Apr 2024 02:21:47 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MnnvH2BAvoYWv0L+FM9lzz6ZYIGxyaz6+AC5aKKYyMFVdO5UERcL4AYP72PlNF8a29HyzezC59WmnNak75ohZXd7h9T932NLZV3YyaSuGFnq8sBbuUGH0zx0HP5sOZwos/sg7EQmxCh6RpvcL97Wz619j/Xr+lHeTR8o8pwG2E+yzacKeFviLg8QHIgnLEG+R5CSfu+ZgUzPv4cRRQuKvgAHE1LLOoNPfApnf4+KE1vhC2Rcg0S0cw6ZISHfMlG0FEZSUjwWh4pxFZbabcHKvuDqrqSK3aFpOZQGs34JkIV4B6B1M/Dc3Xh/u1MbK6+W5AluvEsvX4oMHl5DiBdrmQ== 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=MC/q2WOwUEu09pGPzkY0NSJnVSNpVw9VZcGnPyY51o8=; b=euT+rpwmhi8kaM0MVxBQGdOs3J5EmTrUrR4BmxYAoV6Q2uhHpmKhA39TF6M2MlTz/cZKBlm3amAX8dN+GgqJ3uRiDfLLosHwdxcjOrXpj4N7CKw3o03guaf0x0ytNR4tgIjWWkJdLfYaOnN2/P8KHqkRBjqANzQkM/yGoPf12W1A/kCFLdA4uV8Xwi3f1O8OLgwiEYz95JtsWjuG9CT+h32tdK9nU1tue7qSWG1li7zviobFRFOovMuVuIBwyYQOCMIT5Uri+cHjhfzvrnCj770AeH1WEYnxXa0WVkiGr3vtPC7QVY+DmED+IM/8So40UmjiLWgIru3jwP5D/W5AMw== 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 BN9PR11MB5276.namprd11.prod.outlook.com (2603:10b6:408:135::18) by MN2PR11MB4664.namprd11.prod.outlook.com (2603:10b6:208:26e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.26; Fri, 12 Apr 2024 09:21:45 +0000 Received: from BN9PR11MB5276.namprd11.prod.outlook.com ([fe80::6c9f:86e:4b8e:8234]) by BN9PR11MB5276.namprd11.prod.outlook.com ([fe80::6c9f:86e:4b8e:8234%6]) with mapi id 15.20.7452.019; Fri, 12 Apr 2024 09:21:45 +0000 From: "Tian, Kevin" To: Jacob Pan , LKML , X86 Kernel , Peter Zijlstra , "iommu@lists.linux.dev" , Thomas Gleixner , Lu Baolu , "kvm@vger.kernel.org" , "Hansen, Dave" , Joerg Roedel , "H. Peter Anvin" , Borislav Petkov , Ingo Molnar CC: "Luse, Paul E" , "Williams, Dan J" , Jens Axboe , "Raj, Ashok" , "maz@kernel.org" , "seanjc@google.com" , Robin Murphy , "jim.harris@samsung.com" , "a.manzanares@samsung.com" , Bjorn Helgaas , "Zeng, Guang" , "robert.hoo.linux@gmail.com" Subject: RE: [PATCH v2 07/13] x86/irq: Factor out calling ISR from common_interrupt Thread-Topic: [PATCH v2 07/13] x86/irq: Factor out calling ISR from common_interrupt Thread-Index: AQHah6hf0+1860aOe0i/wzWWSuIGmbFkZOjw Date: Fri, 12 Apr 2024 09:21:45 +0000 Message-ID: References: <20240405223110.1609888-1-jacob.jun.pan@linux.intel.com> <20240405223110.1609888-8-jacob.jun.pan@linux.intel.com> In-Reply-To: <20240405223110.1609888-8-jacob.jun.pan@linux.intel.com> 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-traffictypediagnostic: BN9PR11MB5276:EE_|MN2PR11MB4664:EE_ x-ms-office365-filtering-correlation-id: b320fa49-92bd-44b8-371e-08dc5ad1f917 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: lmu775Dw+mYWLiDuJ8kTf730pTiePnk1mkkXGk91vq83DoUk3pSTI3aCWaScBubEkxR5sJWD66o8Wybc5jBWeYjubgKcnyC9WCtl+AGqBrJofzaMgBvTtgludLbhDmAQdogUB5IEwUCiYoA/TuFcPtEYAdjtpyfWzVw2uycHloVnQV1+D4oalZWYXOHaFM3BJ4Darfb0cVcA1zVkckQzH+qu+15Bvf9Uxw2BPCQ6UpmwmikAA3/6SBZ46VEQNIz4amG3MNxnVsE5d5aF0ua2QL5/ssploZK7fZiFkgyrUUfVidd633SLf3mFHoOM1rdM9YN6UkLsdfP8O0LBCWQW9yw95Ln3DTbRa2JuWMLHHp1kdYE4/uBQFG2eMcJEWs0lGWFolTqee8vglk2tFoY7z67h/0+jvp2m/js4TVHGPptRuV+pkZUveI911Gak+tffwgLjE6/1fiQSXDS4bWJIe0C7IQ59xSWFsM+O1/M4OUIvhci4NJU9LFUfwGGfHkNfyeDqbe8qg4o3RHoWU7/y0r/oJUakPG1F7gnztVPq8ibO+Wp7P23B+ct/jq4Gw22EpEqFnRvQv0AmEZpf6NlqUI3u3KONr1TRc5i2CE8CIuTixVhS7/io0EW5BTsnihDLOzZixmdh0jz884iNEniBPzKfpCfrDw7Wj+8N32If7BhnAfXafWnZinwBpRWCAACFCExRdeYwByHYDufPAk/f51HbmvkAxxeurGCHrEXhKIk= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN9PR11MB5276.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(376005)(7416005)(1800799015)(921011)(38070700009);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?8LfW5eVh49EJ9fKBlfn9A+GP5paR60raRu0TGURd3kCsaNsj/krRo4WMvY+g?= =?us-ascii?Q?9sT7H84nmJNKtcCijX4HwZtpSYVHyBpI4P0Y0SgshbeZfsTvRHzel+uGdV3K?= =?us-ascii?Q?VDkl5jg1PZVAX1++BZ13NN28GWdJfmnePOLZiMQcZy68iGhReQ/UBUUpr03q?= =?us-ascii?Q?0iOl5UZUsxLhk/rkbOEeTOTRvxPSPoLFmxzcTtTyFcwEhPnYQs7RGC5/159N?= =?us-ascii?Q?+Mel3uJH8uih/mNmx+iLJRDI/rrROelTz/Jl+xBfCx34iZclSET7onRL5lOg?= =?us-ascii?Q?r6ZLU+fV2wiFwLPRKDlVb5j1A8Z2J2qRNbSm58AxNZRFTPzhW/hyLxvVfQkH?= =?us-ascii?Q?Ftu2dpYniyFMqfO1Y1ZmjWo1fncaY7tHMEgQLSB+/OWJlcK2lDPzrm26yFqY?= =?us-ascii?Q?kxGjNnYmOGUWmloer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?= =?us-ascii?Q?vhWEs8r4tCijFWxePNkcxaDy2b+fxkqTEkhWGkFYjolW4nfgT94V+2v6OAe2?= =?us-ascii?Q?OvVQfOkdGRXwdAdwRNRRDzzHq3op77MnFU7Y1SN60ovqPZulSIaT8nHoXFVx?= =?us-ascii?Q?Edyfgsuk/icIHTyZNlfnvwKsu5OwTke+77dNYHuW8c1N3/R4zXhJBGUyzfU0?= =?us-ascii?Q?CL3zI+N+xPlZ+6XQeuZiuYCoimui6EltJyxGk0apBYXWpp/3/Vr/bj0IAyTq?= =?us-ascii?Q?wN2P8U7G9Rf5R3je++ZPxwHhwv4bfIVxKFg8W3z2?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR11MB5276.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b320fa49-92bd-44b8-371e-08dc5ad1f917 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Apr 2024 09:21:45.2855 (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: V27I8Xzx9F3ol9g4n/8U72kRHQZkTYWD3viKsn6n0blASNoOMksNO2ybikeVVHtZzkNUvJ+YxsFN0liPXnJzjw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4664 X-OriginatorOrg: intel.com > From: Jacob Pan > Sent: Saturday, April 6, 2024 6:31 AM >=20 > Prepare for calling external IRQ handlers directly from the posted MSI > demultiplexing loop. Extract the common code with common interrupt to > avoid code duplication. >=20 > Signed-off-by: Jacob Pan > --- > arch/x86/kernel/irq.c | 23 ++++++++++++++--------- > 1 file changed, 14 insertions(+), 9 deletions(-) >=20 > diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c > index f39f6147104c..c54de9378943 100644 > --- a/arch/x86/kernel/irq.c > +++ b/arch/x86/kernel/irq.c > @@ -242,18 +242,10 @@ static __always_inline void handle_irq(struct > irq_desc *desc, > __handle_irq(desc, regs); > } >=20 > -/* > - * common_interrupt() handles all normal device IRQ's (the special SMP > - * cross-CPU interrupts have their own entry points). > - */ > -DEFINE_IDTENTRY_IRQ(common_interrupt) > +static __always_inline void call_irq_handler(int vector, struct pt_regs = *regs) > { > - struct pt_regs *old_regs =3D set_irq_regs(regs); > struct irq_desc *desc; >=20 > - /* entry code tells RCU that we're not quiescent. Check it. */ > - RCU_LOCKDEP_WARN(!rcu_is_watching(), "IRQ failed to wake up > RCU"); > - > desc =3D __this_cpu_read(vector_irq[vector]); > if (likely(!IS_ERR_OR_NULL(desc))) { > handle_irq(desc, regs); the hidden lines has one problem: } else { apic_eoi(); if (desc =3D=3D VECTOR_UNUSED) { ... there will be two EOI's for unused vectors, adding the one in sysvec_posted_msi_notification().