From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from BL2PR02CU003.outbound.protection.outlook.com (mail-eastusazolkn19011010.outbound.protection.outlook.com [52.103.1.10]) (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 F170F53A381; Thu, 1 Oct 2026 16:14:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.103.1.10 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790871269; cv=fail; b=mlKnFsMPPQvOlOGsbC5MNDguKX7GAAD1UI4XPWKf9y3t+NjrghH560yi/triCC7Rzcy3Q2MMDZlsL39Dgg4Iya2cAM+4yUBW8eqSl3mPR0wXlPK1Yy4gBzqkkW4JI6j9/tE7/qVFgapfrS9Ra5Zq/MOevmjZdo1AMXOmpY8aN5w= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790871269; c=relaxed/simple; bh=DAvL8RgUEhBj58nCQi0BR0pwqV69AvpmG2o/gCXPxE4=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=JMMQ6ah/AcSVpKIv6l/VU2wVl2Qtl2plgKKmkdtYZQla4nQPvui2Jxmzb0/cuXTKID64NSiOALf/y1F1DC3+loS6DSkVSiAz4EAHnNeXkptFqaavoPm/wK2nnKDK0Uk8kr6oqoyHGHUNKgGRMxsrCvmANYCZJCZ/kd8KJeysGIo= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com; spf=pass smtp.mailfrom=outlook.com; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b=EWbDsIVd; arc=fail smtp.client-ip=52.103.1.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=outlook.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b="EWbDsIVd" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XyAJSZMhXYe4ue1SeJTt3GxliRi3gJDIFuZVOr/Rp3U3n8heihv/z6QoueoZ4gpMSZZhdjGjpuNHrkqbqjmcT1OtzaMyWHK+mqhGFT+RAQYumFL8Vo4FO0H3a75fIdwy/0LdD1v5nilsTdu2425Aw4IV277tRVVGtRqhtQvUS51M1QK+vI7pY77DTxImQU2M+QI11HPwtqeVFc9Vk85Nx6Pa/ubzmylU2b7BewupL2pKMB+IJUzTMu+1tGMO8ZCldoXKkGcn4tJQcm3K5ZAqs/UAh094KHJSdSPnB6Te1FUSHMx4fSUAkNN7WFAtk/Ab8AuS9C/7WI7BnDSh/bxZuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=Ss2pwsgwPq54TdYPUPk2EVXMIWwapenzI4+5XkJJTKg=; b=RLm4hHTMPuwUnVAK2vmDbv5VNRetM+BLjZMTAylZk1q4qxLDdkYZIzezTECMem5cKpJ/Om1bwedliJGkx3vMKkPXp17Yr7ATNHvp0g3bUPduhjUvXUY0JG3T/UHW7vTl+P+l+xulAgSutm/XA7sRbQMB31JO/YW47g9udAj09padprRniBpuAIQXz35gwP2LAVFYJkkTqsKlA5L+tokgnHm6AGxkPN0yTcyFCOmsu6/CRGA4keSBB5A3YD88kC9VaaUMOarZmJYin1mjHpZwY8C1WTLrZLJykmRpAV6c126wNqZ91xvhE7XXaATUsNcF9mBZw3hj0W9mVQxHGXR8/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ss2pwsgwPq54TdYPUPk2EVXMIWwapenzI4+5XkJJTKg=; b=EWbDsIVdsy1ElKLleUZ7a3nA5LyHNtCGLXg5RXESPelxUqtxt16QsVYcQQJVYnbZbWzlAu2yP0E01+T6ADydTluaoUhdwjRmzNKe2DsFJJoLb2QQfvcgCy+RpJIKn6oMEZ2+CfCFvb65rUKWDo8tWDwlAqFyVyIxUTqSUzq9AGExYyGU1sh2UpXV2cI0C35uXchelMCMaGnOx6qphRv5YA5DT/8wZEXeMpSHQ5+YFuuxkGMUDKcyyKRhV5ciEabz0qRbJARsDw13BEwM7OY89/IDNTylRFfSwyA1miCUYTgjAZgqowFMqnx+hEzDUpXnzDVWXHq1VDV41t+XDp4G0A== Received: from SN6PR02MB4157.namprd02.prod.outlook.com (2603:10b6:805:33::23) by BY5PR02MB6612.namprd02.prod.outlook.com (2603:10b6:a03:206::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.472.18; Thu, 1 Oct 2026 16:14:22 +0000 Received: from SN6PR02MB4157.namprd02.prod.outlook.com ([fe80::900:1ccf:2b1e:52b6]) by SN6PR02MB4157.namprd02.prod.outlook.com ([fe80::900:1ccf:2b1e:52b6%5]) with mapi id 15.21.0451.026; Thu, 1 Oct 2026 16:14:22 +0000 From: Michael Kelley To: Shradha Gupta , Wei Liu , Catalin Marinas , Baoquan He CC: Will Deacon , "K . Y . Srinivasan" , Haiyang Zhang , Dexuan Cui , Andrew Morton , Mike Rapoport , Pasha Tatashin , Pratyush Yadav , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "x86@kernel.org" , Arnd Bergmann , "linux-hyperv@vger.kernel.org" , "kexec@lists.infradead.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-arch@vger.kernel.org" Subject: RE: [PATCH v3 0/2] hyperv: Run VMBus kexec cleanup from syscore shutdown Thread-Topic: [PATCH v3 0/2] hyperv: Run VMBus kexec cleanup from syscore shutdown Thread-Index: AQHdUafu8BdwG959PEWeGxKlWV317bbo3Hiw Date: Thu, 1 Oct 2026 16:14:22 +0000 Message-ID: References: <20261001132128.1703511-1-shradhagupta@linux.microsoft.com> In-Reply-To: <20261001132128.1703511-1-shradhagupta@linux.microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SN6PR02MB4157:EE_|BY5PR02MB6612:EE_ x-ms-office365-filtering-correlation-id: 932b3aaf-da10-4f90-face-08df1fd70e17 x-microsoft-antispam: BCL:0;ARA:14566002|15080799012|24021099003|55001999006|13091999003|31061999003|19110799012|8062599012|8060799015|25010399006|37011999003|51005399006|102099032|440099028|3412199025|40105399003|2607281247196008; x-microsoft-antispam-message-info: =?us-ascii?Q?U0IISlEIWPghFh7WtxG70LW3ef3AuboU9jiaYzI2JWC12XUwWchvhxNHil3F?= =?us-ascii?Q?3N0UPLXZQ9xBC9ryAMLGl2mxQRbQCdUdjhWYwkPT4lRRJ0EcX91KOhp8qrvF?= =?us-ascii?Q?Q3c8HWKctZD3ouPPxBrs9uqEHq7ZFrMPW41zo6fqCHS7PJ/csjA+3sN6Blek?= =?us-ascii?Q?9crKTm21BGPDY8HNx0BSK4jTXLH2cMBM1CjkXaVqaK7Ck+itrIjXJjKM1tK2?= =?us-ascii?Q?TMJUd2KSF2FxBfapqc/AcorY9+7Ae8FpvZgFuep1/qx6uDBc9ZW/LRPs9TEm?= =?us-ascii?Q?UoNseBqXlJSeEUh4bIlYpk5WzmmGfwD5TtfwSOByddVdJKIgl4lEQH0YV3aX?= =?us-ascii?Q?JAhSZYJIQBFg64uAtoaIc87ojkxWSQBnmdv07Z4HiCQAuVxFj9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-ascii?Q?9HpZUwPeJVGjxW1Dn4l3KEmzv0d4ssOqZqtBaH7T0hJvFi/fGaYVEj6fCT2B?= =?us-ascii?Q?Q+Gr+CngbuIiPSpSiZKulaAO3HpkZWT+DovsfQiXW2+WFYoIHS8XbuY4Moxe?= =?us-ascii?Q?i3H/t+Im4SWoTALMGUzY2BGDPT5h8KGeKECBcqH0Div0Wq/tbzMegipkv2U2?= =?us-ascii?Q?/gp0mUk+mg3J0oFXssN8x0f2bx5lQluKzxrBs6ak3Lh9zaXgoCDtRCE8ovj7?= =?us-ascii?Q?iZ4n/6fJ9o9lRcKDHxzX0WUXCloeNO18vAb2xZcRLp0Ao4slJB/pA/cduByA?= =?us-ascii?Q?/vAdE2jw6nfMW3k36sRTOME3dtuuubqlWEvOVL1Q8nzxu37fpuikxGBd4TRR?= =?us-ascii?Q?qPVShYg=3D?= 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-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR02MB4157.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 932b3aaf-da10-4f90-face-08df1fd70e17 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Oct 2026 16:14:22.4641 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR02MB6612 From: Shradha Gupta Sent: Thursday, Octo= ber 1, 2026 6:21 AM >=20 > Kexec reboot fails on ARM64 Hyper-V guests because the VMBus > connection and SynIC CPU hotplug state are not torn down before the > secondary CPUs are stopped. The kexec kernel consequently starts with > the previous kernel's VMBus state still active. >=20 > The previous version added an ARM64-specific syscore shutdown > implementation. This version follows Michael Kelley's review and moves > the cleanup into the existing architecture-independent VMBus syscore > operations. This removes the separate x86 handler dispatch and gives > x86 and ARM64 the same ordering: >=20 > device_shutdown() > syscore_shutdown() > VMBus UNLOAD and SynIC CPU hotplug teardown > machine_shutdown() >=20 > On x86, VMBus teardown now runs before hv_stimer_global_cleanup(). > This ordering is safe after commit be0cfab740e5 ("clocksource: hyper-v: > Remove support for stimer interrupts in message mode") removed the > VMBus dependency from synthetic timer handling. >=20 > Patch 1 adds a read-only helper that reports whether a kexec reboot is > in progress. The helper is exported because HYPERV_VMBUS is tristate > and the common syscore callback must also link when VMBus is a module. > Patch 2 moves the cleanup into the common callback and removes the > obsolete architecture-specific setup/remove interface. >=20 > For stable kernels that still support message-mode stimers, an > ARM64-specific backport will be needed to preserve the existing x86 > ordering. >=20 > Changes in v3: > - Use the existing common VMBus syscore operations on all > architectures, as suggested by Michael. > - Remove the x86 handler pointer and the weak setup/remove interface. > - Add an exported read-only helper for modular VMBus builds. > - Correct the Fixes tag to the commit that enabled Hyper-V on ARM64. >=20 > Changes in v2: > - Use syscore shutdown instead of an ARM64 machine_shutdown() hook, as > suggested by Catalin. >=20 > Shradha Gupta (2): > kexec: Add helper to report an active kexec reboot > Drivers: hv: Run VMBus kexec cleanup from syscore shutdown >=20 > arch/x86/kernel/cpu/mshyperv.c | 17 +---------------- > drivers/hv/hv_common.c | 10 ---------- > drivers/hv/vmbus_drv.c | 22 ++++++++++++++-------- > include/asm-generic/mshyperv.h | 2 -- > include/linux/kexec.h | 2 ++ > kernel/kexec_core.c | 7 +++++++ > 6 files changed, 24 insertions(+), 36 deletions(-) >=20 >=20 > base-commit: be0cfab740e58b70047ef6e7e3d578f00ed5d258 > -- > 2.43.0 Nice! Net impact is to remove 12 lines of code, instead of adding 40, which is great. And nothing under arch/arm64 is modified. One minor point: In hv_machine_shutdown(), we have two sequential tests of kexec_in_progress. Given that you are removing some code under the first test, I think it would be fair game to do a very minor refactoring of existing code and combine the two tests. It just looks a little funny to have the same test twice in a row. But regardless of whether you include that change, for the series, Reviewed-by: Michael Kelley