From nobody Sat Sep 26 08:37:18 2026 Received: from CWXP265CU009.outbound.protection.outlook.com (mail-ukwestazon11021140.outbound.protection.outlook.com [52.101.100.140]) (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 A95591D63F3; Thu, 3 Sep 2026 01:39:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.100.140 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788399585; cv=fail; b=eBRHdKbum/fRkD+wBaYCt4wddNL8XHIl3eVK3ZHfTzuhqnRYLIms3uoQD5BcJ30U0TjJ1iqOhacrlb5XTHq5Zvzaj17FvkYLqMmsQg2wwT/p4L9271CHqArBiNWq0qyZiY/pgOnZ5lJ9zN0yj8aYhsL1Kbgjav1seUEgjQeC/Og= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788399585; c=relaxed/simple; bh=ezFZDn+nK4eT6xnu4pbaxxWnX6V0BhOXHsCclREqiRE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=jqJ870qHlDHFdSZho+M/8xuT4ZRp1+Wjfx8IhOA1EqX9nlxlgHQQ0cgwG2cSR0YRv8HGmaTggBlO7B9qnR9qicfnpR2g8KJ5SOvFY+sOa5VRPCh+qngiR/qYhIzF+KZjMNa3Lg3XmRTyOYag9mcPLCo3/pCA5hG80pQ2aEYPTlM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=atomlin.com; spf=pass smtp.mailfrom=atomlin.com; arc=fail smtp.client-ip=52.101.100.140 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=atomlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=atomlin.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ob8+lj/4vNYYeYVebxat/+rBVQvUI7YyNw5CK32YGXSd6wM65xbOMsbQ2vZUYS3UgQlXgG/npOr6Mh7UrXbo48YhxsjQncFfXxgk8RXDGPsNbgCWD2l7T1BfO0qlFeotjupLkHre/w2yaw4PCLubV59P/ApL2Xoo28zMNMlhOmQk2bhF2J8QiTiEYADESg1HPT1+RhD+D5+tKmFMNabjUI7SPrT91C6gwkFWNHxBKHDZ+jGQfk32qsrYh+/o7rSWn2ySVXJV3CaKo/X6P6vugcukffSedDvhBPcyKkibAap2NrmgnOVn1pl7e1ap6jep0Tpl+oWkC+fxnCDOZB8wQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:MIME-Version; bh=1nHxhrK5XASI/i8SjDEdO/bffHrIEYRR+FQg8rh1rpg=; b=mWXrjJ1cgrNQ+dV/PfNmv0F1x/urf9MBBicRwIEbUkx/D3Q/D5nBX6hynK4JdJXjsX3rMkpLFOWtX+ZUcKuG8re/chddoOPTRvLPZWDMcCkGGft3Trzulx/f/4ixWIH+ZeYbr+yGA3cj73WDmfRHbpG6FAVc4bRsV1ybm+lOE5tduMz2OdaP1Uo4yLP+EZ0HutSdcKvkGvIvBAaRARJC0poLtPy0AHDnV+W0zjGBizNG0JZD6kwA0C8LIgKeRQfSS9L9jenysKfd4mCTahZX4Wj/9774eurgm/Uiz5aHI+d7pD1f0JPaa5ZT/3nzpJQmB7Anx4gnIMpguE8b95kkaQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=atomlin.com; dmarc=pass action=none header.from=atomlin.com; dkim=pass header.d=atomlin.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=atomlin.com; Received: from CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM (2603:10a6:400:183::5) by LO4P123MB6532.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:2aa::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.382.10; Thu, 3 Sep 2026 01:39:40 +0000 Received: from CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM ([fe80::cec4:77ab:262e:d230]) by CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM ([fe80::cec4:77ab:262e:d230%4]) with mapi id 15.21.0360.008; Thu, 3 Sep 2026 01:39:40 +0000 From: Aaron Tomlin To: tony.luck@intel.com, bp@alien8.de, tglx@kernel.org, mingo@redhat.com, dave.hansen@linux.intel.com Cc: x86@kernel.org, hpa@zytor.com, frederic@kernel.org, marco.crivellari@suse.com, sean@ashe.io, chjohnst@gmail.com, mproche@gmail.com, nick.lange@gmail.com, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/2] x86/mce: Do not reinitialise mce_timer structure on CPU restart Date: Wed, 2 Sep 2026 21:39:32 -0400 Message-ID: <20260903013933.172063-2-atomlin@atomlin.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260903013933.172063-1-atomlin@atomlin.com> References: <20260903013933.172063-1-atomlin@atomlin.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: BN9PR03CA0096.namprd03.prod.outlook.com (2603:10b6:408:fd::11) To CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM (2603:10a6:400:183::5) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CWLP123MB6607:EE_|LO4P123MB6532:EE_ X-MS-Office365-Filtering-Correlation-Id: 449b39c3-e82a-41cd-b8a1-08df095c3884 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|23010399003|1800799024|376014|366016|6133799003|56012099006|5023799004|10067099003|3023799007|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: e41gM0BPwWeFxV44gn6tczeodcSJznKsAP6ho5iXXUgYvV6YQQWzEjMOlQsSjEK3O/TwxqoovR2NeQD97Rl1REcGcoNlDejVwjPPLUBaTRA03ap58a3QW3WIH4Or39w0G4316e0u60N7bk/l1pdTOxgo6IF32EuyVzA5KRrhdkFdTrgP1ecZDk1eDr72w/3WuuKPDtxeZ4z+wnXGmzovkA5+TmIa5hVwVflpjFwbIkKf4NUusmeDEteJaDHCx4bPvmgSB8oHhvSXfD+SZE0UfD78XeONriYwDFVeQ0ZeDH+VHF0jzC4kIjtba7OlluBe/dqueo5+c6NSzFRthl3VJ5gHGJIxP3AtiXyLUNHIW7vS/ye/rFeH4ItiWpFV1/HIFcjoGeM19lweE3juBa6mmgAwXZJGD8kKjDM3bM9nWcGQ+zxvwHLFgcy3kmmddVkmKyAfD9QpVVtU7B1sdEEUcNpFel0t5P5t5T4WLc0q9mv2G2sY6+wN36YcDMV5RuG+0xkWJH/QOEn2sA293jctGyQ5eVHYcFE7k3+8D3G44lHhMv9a8Ch8hPPNuooQ2GHLs/HRzAXRQlwrdCtws85l4eXcWTXDvya8HLeJ7FUesK+hT5XmynmSOgvcRMBQFR78bVnOl+0F47NvXOZMQ73xSTGWkZWSglpNxNSE+GKag3o= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(7416014)(23010399003)(1800799024)(376014)(366016)(6133799003)(56012099006)(5023799004)(10067099003)(3023799007)(22082099003)(18002099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?b1dmx4IFs1ls99tX2/Sh1V+e2Vesgle5FDR2etO3Ip7OFwMzpwC2p2KDsVOl?= =?us-ascii?Q?9iJAEZeys4WkM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Y+XQ6G1vRqCj?= =?us-ascii?Q?jkrO3ldDuXgRItBtA2L47N4zmj5O910opQLv5RD1tybL8WwZbcgys5liNhe3?= =?us-ascii?Q?sD46Zs9f5L+bIVfwlIRXpqGBTeOElVcXIv9uHCEJWipRD7VXomKJV4oO30u+?= =?us-ascii?Q?2RH0+qSqwOoidvt2JrFlJEF3ahV843iR9kPE9369h7FYxRwpPC44G9uQOKDN?= =?us-ascii?Q?GwVpx5jCJLEK++M8DqFBtvCJF7X/58+9jjAj/zJUZazQvrnUjPCIFYSl43P2?= =?us-ascii?Q?9gS8SCQrjMDbCnMS98e0OVt6QhX8eBbgfQspj7Mf1EoX2JRJ6WaB1CGcORMR?= =?us-ascii?Q?4gFFFGD9mjCkuYIYd47VAHV+RrNsWZMNa8UOh1yphGvAbcYgVr3IY5CRcXVY?= =?us-ascii?Q?vaS5sjlWH0du41rfoHThcN8PQW9LC5AqbnIdbRkreKqv3b45Ypep/w0qOvKK?= =?us-ascii?Q?bBv0uS7ieGsVqk06rMY2oXUy38JbOb4q5HLX+t+nu+wwM/gSy7pM2lxPI+lV?= =?us-ascii?Q?bZx9h3tCSa6ThveVtG05fUB/ZDV3nN6stp6CLDSBFdp7U5IqD7NkGmwFkbd8?= =?us-ascii?Q?VfUx4wsiTjCg1GCGTjzgV7RqlVi9i0deNPUWj1l1u8GjmtzwljnAW5DuBn9V?= =?us-ascii?Q?VzUqimykaEafZx+PvgGS8aeK6xoqU7pkoF0/vYCh03npjDNJXPL0J6aDOP4H?= =?us-ascii?Q?un/1wh8JSxGxY5ShUtpzNSmWMlITVkQuNP9chPVSmhUVXvxstJGY5CiwdvNT?= =?us-ascii?Q?1prMuq2TPPMAJwAMQYRFFEEaMEMndyfQPdpdXgntZq7mopGkv66/p3C11/0d?= =?us-ascii?Q?TEXVh6qImQ=3D=3D?= X-OriginatorOrg: atomlin.com X-MS-Exchange-CrossTenant-Network-Message-Id: 449b39c3-e82a-41cd-b8a1-08df095c3884 X-MS-Exchange-CrossTenant-AuthSource: CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Sep 2026 01:39:40.0737 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e6a32402-7d7b-4830-9a2b-76945bbbcb57 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: g3TAjEquQM7BpU0FFiS3ys4PAuBTyXBdvsSZyfe1iIEfQEhVnZhftyCtefkxWaa5Rh08AyuwbXGzcOmUYdEPLQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LO4P123MB6532 Content-Type: text/plain; charset="utf-8" During early CPU initialisation, mcheck_cpu_init() invokes __mcheck_cpu_setup_timer(), which initialises the per-CPU mce_timer descriptor via timer_setup(t, mce_timer_fn, TIMER_PINNED). However, __mcheck_cpu_init_timer() is also called at runtime during sysfs reconfiguration (via mce_cpu_restart() and mce_enable_ce()), redundantly re-initialising mce_timer with timer_setup(). This introduces a race condition against asynchronous CMCI interrupts. When mce_restart() runs, it invokes mce_timer_delete_all() before broadcasting an IPI to execute mce_cpu_restart() on all CPUs. If a hardware CMCI interrupt fires on another CPU before the IPI is serviced, the CMCI handler triggers storm tracking and arms mce_timer via mce_timer_kick(true), enqueuing it in the active timer wheel. When mce_cpu_restart() runs subsequently in IPI context, __mcheck_cpu_init_timer() calls timer_setup(), which invokes __init_timer() on the already-queued timer. This clears the timer's internal list pointers (entry.next and entry.pprev) whilst it remains linked in the active timer wheel bucket, causing linked list corruption, softirq lockups, or kernel panics during timer expiration. Fix this by removing the redundant timer_setup() call from __mcheck_cpu_init_timer(). The timer is already initialised once during CPU setup; runtime restart paths only need to arm it via mce_start_timer(). Fixes: 26c3c283c5b0 ("x86: mce: Split timer init") Reported-by: sashiko-bot Cc: stable@vger.kernel.org Signed-off-by: Aaron Tomlin --- arch/x86/kernel/cpu/mce/core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c index ab469605fc89..765e8103b0d2 100644 --- a/arch/x86/kernel/cpu/mce/core.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -2091,7 +2091,6 @@ static void __mcheck_cpu_init_timer(void) { struct timer_list *t =3D this_cpu_ptr(&mce_timer); =20 - timer_setup(t, mce_timer_fn, TIMER_PINNED); mce_start_timer(t); } =20 --=20 2.55.0 From nobody Sat Sep 26 08:37:18 2026 Received: from CWXP265CU009.outbound.protection.outlook.com (mail-ukwestazon11021140.outbound.protection.outlook.com [52.101.100.140]) (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 2379D31716D; Thu, 3 Sep 2026 01:39:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.100.140 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788399588; cv=fail; b=W/E5WoKxs+1T754fW0LFTA1xdlOU5TmKqfIusqBzQ3UWFS01iHPojWYmIdhbCKw5PrxBKHdwBMSdBYayHQSlJ0hZ9sEvWPldOfN/Tys4eI4bxwhaE1qP07ekG1Vuf3tN4fmYely5ILGJdROo8/laPSLc2VF+zhPRhRJkwAfymrk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788399588; c=relaxed/simple; bh=04yEFP4GjbFdJKK0fXJx62XE0XF6lJHBZ8RLw3AXgiU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=CT2T7HKsFvRtW246AlN8PgnS6Tvg9jpods77wPQEr9MiS4nNRqW7PQ6zhvPceO4fprarKEOpCoO8ATcqocYAmV/oUgFn6H0Rph0A0E7YOavsZICKYpfLd/ezbazwmPJdVdrZw142FLzUUFS5sBJVPLjWpksnvgv9HEEFTU5HUUY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=atomlin.com; spf=pass smtp.mailfrom=atomlin.com; arc=fail smtp.client-ip=52.101.100.140 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=atomlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=atomlin.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=zRUv7tQhpApP81GkdKxA6WZYHGFqickV/eG+utZ3nJC5DBVfRCm/UYCKkY9C5Q7ZvdrhPHZ+1z08Z8MW4OODSVdFphI5hU2u8lLxgnmgN7fOdp8QlQLNWW9gJ6nMUq3KEJ3ioiSE71fmoWTd4ntKXCz0lS9xy7idf2wC8HmgTAsgGSVz5hlJuxDIrhQpocm6RuKmJ5sMzIYI+18buHcuuSZx9GUiZi4c9Taz+t6RBUsfwUf9FN4w62JgEa5zL0TCZ4qrHJpvf39hWPiXHWNgquySu2xBCkbiyapU61+g4xDAeh+nE9q0Cm9Xj+tVqr1vDiooYn/VWaSJiUjQe5WZGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:MIME-Version; bh=UMvUsNqvWFm5VcatlN++Fa+BvkFT3QiqIEnOH1BJJKg=; b=BTw1qbtyOJT41TePifYNKkktJnBdSoZI1PIy9p4lDXzWRzHq0zQvDyV17+xItlCDydcDQ6iKFKFv6K7p9nLkIqJmvY0txvaZArlkgCQGEVwkI8Vy2sbFJGnrPCwa2mxK5X93SgakJZQQrPUg8N4wT2Ew9FW7uBe6KPHfvv2m4+tLkNdAaySuaOzgwVpjRdhidbEw+8bc+ICPhfbg2kWUtiB0NJzYC/xbIc097plq1mUsXBBgAqFMPDYDiYrL6FayQqD5nGO+wP6luJ0R7Uil+Hj6gntEUlnegngJ482jd2QURteUdyy0X1ACwY80G85FcgqXjXkNLsMDBP0zhsIhWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=atomlin.com; dmarc=pass action=none header.from=atomlin.com; dkim=pass header.d=atomlin.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=atomlin.com; Received: from CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM (2603:10a6:400:183::5) by LO4P123MB6532.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:2aa::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.382.10; Thu, 3 Sep 2026 01:39:43 +0000 Received: from CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM ([fe80::cec4:77ab:262e:d230]) by CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM ([fe80::cec4:77ab:262e:d230%4]) with mapi id 15.21.0360.008; Thu, 3 Sep 2026 01:39:43 +0000 From: Aaron Tomlin To: tony.luck@intel.com, bp@alien8.de, tglx@kernel.org, mingo@redhat.com, dave.hansen@linux.intel.com Cc: x86@kernel.org, hpa@zytor.com, frederic@kernel.org, marco.crivellari@suse.com, sean@ashe.io, chjohnst@gmail.com, mproche@gmail.com, nick.lange@gmail.com, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/2] x86/mce: Avoid arming periodic polling timer when not required Date: Wed, 2 Sep 2026 21:39:33 -0400 Message-ID: <20260903013933.172063-3-atomlin@atomlin.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260903013933.172063-1-atomlin@atomlin.com> References: <20260903013933.172063-1-atomlin@atomlin.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: BN8PR04CA0045.namprd04.prod.outlook.com (2603:10b6:408:d4::19) To CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM (2603:10a6:400:183::5) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CWLP123MB6607:EE_|LO4P123MB6532:EE_ X-MS-Office365-Filtering-Correlation-Id: 2483571f-b3f4-44b6-1880-08df095c3aa5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|23010399003|1800799024|376014|366016|56012099006|5023799004|10067099003|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: vxjKgYIwGZT2cV8KcHzxQJFoIRZ2WEXHseCEvFiAg8Lz98F40FLCnNg7Z0bj+2LQMq+IW/NHxcChXxWY800FrvK77mMSqNjaQvyqbyG23rbT/LUVfM5M7iszATFMHSJNXChR9VDXrPzQIs+B9U013cJNHjcWj26LUz7ft4EKmmih1pIN9gSxnHiKcmf1C2Xbr+ngF05NNvj9aXyy66TuQP/06g88/cI7Arwv7B+iOP2dVyB+StOJtKnk+/gKWoscoLDhcONS+XAJh6MKXlprqfvrBwl2eR6rbcGzApoeDoGjFJoYebJxA+rthVwfo835NTKAePO0vcIGS8BrMOy5OWtnQ/vDhhxeewwn37didSxjol92864wKhs2PYJguiol4lnaJA/BW5ZxRIBpHwhW4W0MLPjxbs6n7EGmbR8tjun/81+2flGC+uTN8/3//18oMdU3U9v7IqZwCz1Cw26BXUBvytLz7MaiYHVjhA7vr9TtrITGqzMpOPjslAQExL2ms3JTkDCRA2IeC2qQ1DA9uQy7GIPy6/CwO7E9SgaRe5j2X4toZxOigcf7jWPNgi0N3HxJar48ZWmcDmfVpNUwNJ3d7lLMLEwNik7Z2lQW8+EXIAqGB1U3P0Q8IPXxqWaAhjBdFvWA7Q15G6AcXDkerirF6AXdbwmy5zu7mAw7LDU= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(7416014)(23010399003)(1800799024)(376014)(366016)(56012099006)(5023799004)(10067099003)(22082099003)(18002099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?trQxes8ZreKkwzEvadiMeEZumx79cX1okEx/L4cmAzv36D5EdUd7Ob6ibb5k?= =?us-ascii?Q?ds07H1oI0LnX9eRFcqx5hEct3UjQWNHKjDEMPAUCWp3HXrqvSztpRxFslnRx?= =?us-ascii?Q?BxYu9BTD7jh4F39XzMaAB+Ta3VVXSxR1/DVnwONS73aACrQEHJg7wWbZ11pQ?= =?us-ascii?Q?cN2I81UlUUahiARPNeVGHZ3DpYjx2pVrkPP50CYks9zVBss413npKFEsKnpm?= =?us-ascii?Q?J6d+1SHJIsrWsmY4R92A0Z0IyaXBvpzLkVkDK0KnmCpSlIxiaEcOjSgLZu+5?= =?us-ascii?Q?4vmDwS08mAOxAr7qYWlwbjyToXRyKm7SAUyOnmlVMZAI0LTfww1+0WL9XcJh?= =?us-ascii?Q?rFkH9cBQIIoPpActPpzsbIODYWqZTnXlvha2BPcPhvoCcDZhFzRbqEQm7YJ/?= =?us-ascii?Q?579W5CzQG0Qn2A0Q0uOO9Fjw4jRRhNgY9rTsQBX2ActYjb5zFdhMqOwFOWaN?= =?us-ascii?Q?ZR6Jw238Ii7tXdOPztaawGmSm62lFEizL+LeR6bsDLU2VnZ/NvnHmHjwvQ1I?= =?us-ascii?Q?Ixwl0ouwt9lH5aoWdAYn+pE8htINp847vQj5XeRuQ/xf1pHiie7ZrdpK+LY8?= =?us-ascii?Q?LdGBTjeqN/U8KWcNcEXBjy2Zgc43yrR8ixcaSe2nmtV8bAWEwGXC3tayt6P8?= =?us-ascii?Q?HxLBem8PxwRVVkT3TLsQ0jzU25N9R6h8HWVk2fNKlHEdBQYC7ZuecOULNDXQ?= =?us-ascii?Q?+wwnrOp3J+HuspI+Eeqf3NLBE11PkcdYnyFuA3kA4xN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DLtBWQuaSQx7KiHMOk23QAmVdcf5MCRMJfKso/W/wL9yr+D?= =?us-ascii?Q?KsQvQGMiiHfifnNaGPzhZh2E0Bl+E2HTk6qHXVKC0DmMBEC5IqAtcEfCeUvC?= =?us-ascii?Q?0xrRRSAg+A=3D=3D?= X-OriginatorOrg: atomlin.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2483571f-b3f4-44b6-1880-08df095c3aa5 X-MS-Exchange-CrossTenant-AuthSource: CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Sep 2026 01:39:43.6253 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e6a32402-7d7b-4830-9a2b-76945bbbcb57 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: FELFslCb/bstMfOUM/fBHqU4WjBTezj5bBIFhy4f+DPAvmygBl3D9iLiYyIQ8smnQObhUyXz3sr1BKoH9X9QqQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LO4P123MB6532 Content-Type: text/plain; charset="utf-8" On x86 platforms, the Machine Check Architecture (MCA) subsystem arms a per-CPU, pinned standard timer (mce_timer) to periodically poll hardware banks for "silent" corrected machine check errors. Because mce_timer is pinned to the local CPU via TIMER_PINNED, the timer core cannot migrate its expiration to a housekeeping CPU, causing periodic latency jitter on isolated cores. On Intel systems supporting Corrected Machine Check Interrupt (CMCI), hardware generates an interrupt for banks with CMCI enabled, clearing their respective bits in mce_poll_banks. However, for banks where MCI_CTL2_CMCI_EN does not stick (such as the Power Control Unit bank), Linux historically assumed software polling was required and left the bank flagged in mce_poll_banks. Per the Intel SDM (Vol 3B, Section 18.5 "Corrected Machine Check Error Interrupt"), if bit 30 of IA32_MCi_CTL2 is zero, no CMCI is available for that bank and no corrected or Uncorrected No Action Required (UCNA) errors will be reported on that bank. Therefore, polling such banks is redundant and wasteful. Clear non-CMCI banks from mce_poll_banks in cmci_claim_bank() on CMCI-capable CPUs, and amend should_enable_timer() to: 1. Check bitmap_empty(mce_poll_banks) so that mce_timer is never armed when no banks on that CPU require software polling. 2. Pin the MCE polling timer to a HK_TYPE_TIMER housekeeping CPU, sparing isolated nohz_full cores from periodic wakeups on systems requiring mce_poll_banks polling. On systems requiring software polling such legacy platforms lacking CMCI or when booted with mce=3Dno_cmci, the mce_timer is restricted to housekeeping CPUs. While this intentionally leaves core-private banks (e.g., L1/L2 caches) on isolated cores exempt from periodic polling to guarantee zero timer jitter, housekeeping CPUs continue to harvest telemetry from their own banks as well as shared package-level resources. Synchronous (#MC) exceptions on isolated cores remain entirely unaffected. Suggested-by: Tony Luck Signed-off-by: Aaron Tomlin --- arch/x86/kernel/cpu/mce/core.c | 7 +++++++ arch/x86/kernel/cpu/mce/intel.c | 11 ++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c index 765e8103b0d2..b01ad1a9b455 100644 --- a/arch/x86/kernel/cpu/mce/core.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -1759,6 +1760,12 @@ void (*mc_poll_banks)(void) =3D mc_poll_banks_defaul= t; =20 static bool should_enable_timer(unsigned long iv) { + if (bitmap_empty(this_cpu_ptr(mce_poll_banks), this_cpu_read(mce_num_bank= s))) + return false; + + if (!housekeeping_cpu(smp_processor_id(), HK_TYPE_TIMER)) + return false; + return !mca_cfg.ignore_ce && iv; } =20 diff --git a/arch/x86/kernel/cpu/mce/intel.c b/arch/x86/kernel/cpu/mce/inte= l.c index 4655223ba560..cc7d0dfcf9c7 100644 --- a/arch/x86/kernel/cpu/mce/intel.c +++ b/arch/x86/kernel/cpu/mce/intel.c @@ -229,16 +229,17 @@ static u64 cmci_pick_threshold(u64 val, int *bios_zer= o_thresh) */ static void cmci_claim_bank(int bank, u64 val, int bios_zero_thresh, int *= bios_wrong_thresh) { - struct mca_storm_desc *storm =3D this_cpu_ptr(&storm_desc); - val |=3D MCI_CTL2_CMCI_EN; wrmsrq(MSR_IA32_MCx_CTL2(bank), val); rdmsrq(MSR_IA32_MCx_CTL2(bank), val); =20 - /* If the enable bit did not stick, this bank should be polled. */ + /* + * If the enable bit did not stick, this bank does not support CMCI + * and no corrected or UCNA errors will be reported on this bank + * (SDM Vol 3B 18.5). No polling is needed. + */ if (!(val & MCI_CTL2_CMCI_EN)) { - WARN_ON(!test_bit(bank, this_cpu_ptr(mce_poll_banks))); - storm->banks[bank].poll_only =3D true; + __clear_bit(bank, this_cpu_ptr(mce_poll_banks)); return; } =20 --=20 2.55.0