From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.61.69 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796444105; b=LZsmEN0z0NmIOh9Iu8EpU91IP2hoorgJFOw+UCPBXybCUFDpqZRHdXMX+/UfeDnTfRkV UQuvP5RyTUsx4pYEX/Qt+QJ/w0qLalfaVFu6QYbTf9qcwzi8KlvnK0YizlQglVIDY20Rz LHmTQeLj7pkHTi2wtVtFUTWhFQ93zx8Rg8tjy2ESzdU3zGTFmEVeGY8rC8bDAA+oAoCFi qQMvSxAZ2/rqzkxBS7G0HACKq8o4emrTrixaC5WsPYjmyaF6tkKVO2OrWIDxnLV2H0Cr6 F4C7tWVbrtV7uEdaeP6rwjcc5gqMmTjGzZ/lgnyA46FyqBFlFuElK89DSHB44qeTmrw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796444105; h=DMARC-Filter:DKIM-Signature:Received:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:Content-Transfer-Encoding:Content-Type: X-ClientProxiedBy:MIME-Version:X-MS-PublicTrafficType: X-MS-TrafficTypeDiagnostic:X-MS-Office365-Filtering-Correlation-Id: X-MS-Exchange-SenderADCheck:X-MS-Exchange-AntiSpam-Relay: X-Microsoft-Antispam:X-Microsoft-Antispam-Message-Info: X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-CrossTenant-Id:X-MS-Exchange-CrossTenant-MailboxType: X-MS-Exchange-CrossTenant-UserPrincipalName: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=s4KmptUz+mGFtqygAj9WftUUmqTXudpFCNmVouMB0pQ=; b=sNjIOOmc1p4fOe9UN+2Z9pF2eR+yR2kA5Wbw4HXXvu1dzuelmtuBH3oqDu89LpUHs6sr 8hdlhrxLnQTSzQcQadtiF63nIB9R49bZTeyJoGzF3gH0XZ99M481l7kElrrjNgWLQPemV KyYoOEmTgGjvyBL/1F5MXmXSZAhMwumnG2QoXqzwC6Hiq4ivFLcuBsb8YYCI/nlcjd0UY DzaibqqlAex/wb8rjUG8uIjVIY4u5+8zW3iYoiWrBeefmG8//BEHZgjA5GCI84rbJ7lOF 9D21pBNfw7QXPORvHog8Y5vUAX9UJENRU4lQtHsRHOpS/3e4GuWA9jrh5s73CXHCpng== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=njMcmWTm; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.61.69 Received: from DM1PR04CU001.outbound.protection.outlook.com (mail-centralusazon11010069.outbound.protection.outlook.com [52.101.61.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E236606A330; Sat, 5 Dec 2026 04:15:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3E236606A330 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=njMcmWTm ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LhK5vxNh2vBjTLAe+Pcm0q9VWIE1btA6SdtUVcwBKYiMOwodfpwaBVTyxwrquFG90FP9Yjtn1GT6U7F9AKHr915jEhHTt/2hFh3V5jDffLwsgY9kWhlJaJSClrFIj9uWeUKEd6j/zRFi2m5d3rjO/zFP67ET68nQSHBCvf8PPUlXmTeAz0q0nJ73HEKv7oiJL1uGoOYcJyfDI+HDudmt+1uZAjgMjNbQPNdzdMQaxSoMQIsHqw90zuxyutIv1iYmPHGCKdLkKpTEuXhkp2qABnQ0Zc+vlFkzEd2RFB48WQ0ablrkLujdJ+AI5Mh+6kM30IDVEGIa+WZhQ3eGtbd55Q== 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=s4KmptUz+mGFtqygAj9WftUUmqTXudpFCNmVouMB0pQ=; b=Yt5nu2IuysdfvLW1ORHAV9WMgXQ836rdyxJmzkguFEqThaS/n10wxj8O1wBDdd1pbQAP0/GGEcD1RcQa6OjxebRl6IpGwQDhsZu8GVMPMH/Ei8fxoDDIHZy9Qg6ANwnuVfmYreMH114VyrxtTLbwI85DRubNfOI+RpE+ytQ0oSYUIod+WoH3H4RzcsWiXzFzn1/NIr7S3c8fQHr1SAkQvDBwsT7cQkSu2f1z++9HFFSTC2sxCqa4NLfhTrA5qA98TJCsypvvcvEBf0+bI51u1tPYw38ji8nWnRndSVQ18tU99ixfG8I3uQf4jA/TW2hx6ECJJ5971f90W2d8qg4qSA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=s4KmptUz+mGFtqygAj9WftUUmqTXudpFCNmVouMB0pQ=; b=njMcmWTmeIzlybdiCUgS8IzYWNhGrG977N75VXerJ/wmFg9xD7Ty+zDD1ZMMrqW6zhw8ByJ6LJLx9svxX3qOu/By8foxS2RHZxoyWMNNgK+4PuF0ogV54aXo6F3lJsijhNsjY/DetOdDDXXmSTJ64O01XIV/ZsjlvESGfQnAcBV7DcIVoqLOu8F+64RXUHBgV9f3a8PWaRYa27hQTsqM6U/7pUZYmtHaMmt0fIklGrhePNfgXn6rcE1LSgj4Au1Rx7YHgpgDJhGeYKDXoIKdVazepId2XkRbMtfb58xnFa4M01OM8fSU4B8NpnXVrpLxiPn742A5xKdN6BPuQC/1Gw== Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DSVPR12MB827618.namprd12.prod.outlook.com (2603:10b6:8:3e5::24) by CY8PR12MB7489.namprd12.prod.outlook.com (2603:10b6:930:90::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.13; Sat, 5 Dec 2026 04:14:59 +0000 Received: from DSVPR12MB827618.namprd12.prod.outlook.com ([fe80::c673:6b00:5b48:b56f]) by DSVPR12MB827618.namprd12.prod.outlook.com ([fe80::c673:6b00:5b48:b56f%5]) with mapi id 15.21.0688.011; Sat, 5 Dec 2026 04:14:59 +0000 From: Srirangan Madhavan To: Alison Schofield , Bjorn Helgaas , Dave Jiang , Davidlohr Bueso , Ira Weiny , Jonathan Cameron , Vishal Verma , linux-cxl@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Li Ming , Joshua Machauer , Alex Williamson , vsethi@nvidia.com, alwilliamson@nvidia.com, Sai Yashwanth Reddy Kancherla , Vishal Aslot , Manish Honap , Jiandi An , Richard Cheng , linux-tegra@vger.kernel.org, Alejandro Lucero Palau , Srirangan Madhavan Subject: [PATCH v18 00/19] PCI/CXL: Add CXL reset support for Type 2 devices Date: Sat, 5 Dec 2026 04:14:34 +0000 Message-ID: <20261205041453.3946529-1-smadhavan@nvidia.com> X-Mailer: git-send-email 2.43.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR05CA0056.namprd05.prod.outlook.com (2603:10b6:a03:33f::31) To LY0PR12MB727857.namprd12.prod.outlook.com (2603:10b6:408:3ba::5) X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DSVPR12MB827618:EE_|CY8PR12MB7489:EE_ X-MS-Office365-Filtering-Correlation-Id: c1d7985d-b404-477c-4ed1-08df52865302 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|23010399003|366016|376014|7416014|18002099003|6133799003|921020|56012099006|3023799007|11063799006|5023799004|261009223027099003|10067099003|261102123227099003|261021121427099003|261021123027099003|261026140227099003|261026121527099003|261028144727099003|261022113327099003|261022075727099003|261022105027099003; X-Microsoft-Antispam-Message-Info: ZYcsuF6hTIZxSlwZ5tw8n0J5uvVAgl5ZqiKThSo1wqcHdxXY7YwzKNBt5xKMNwgf9A2D1kH84dZZKEDeNr1QyDUEz/VXGd/GAShjc1wCjwPbltg9XlXKVof5cTp6WJmxUnzIjfcY0RrblWeLhKDOvGGhLGNj6+Hwdg13v1qQxb46LsHsUe4jGaCzDgP1x3XXja43Y5ncUgYGLrUUZCoKEzL0UVrq0b21u9u4kTmxKjpgmCFMy8nmBGe+HYR1dXfpFemzgksTJL3qatVH4v6YBFVf3kbx60sNJjWkqLjmRWZAGzUcWDYGOiQtWUeFBS+JC2GpPRjxuq9e26CKhk6rzQSe4o9S61gybBoMmYve6C7LCOlVpEzIHPlyaH7oYRBBLKh0GTOnBqAWVhWnaBxhefR3glzd2Qjkdz/kmaV2V5NJOwf7zXRgVdIOHZi6MbLZ+OLyQGhrd1f/Zl6RoDFF9Ax/UqPLeWGZlgWJNGF7AZG7Fv1vuJNp2kiCzTV8uuMZngqknAxWbqei/kYgW6SQx/alK4+QyruQUhQ/qn71Q1NM65tW84ijXVvAJi5xrjCGeH1G8lAHC1/XoBcON3NlYdmhth+walb+E+zb8X1AFkHcNYxlKi7e5Or787OeXNF3dJ5TIUvFgHMzKBxQ+eHxk2g3lGDR18rvB0m0ts1lwAV7cIYpcBLw89afWfeeHnaaOSR1Y6Cab0TSFbZxfsMKAQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DSVPR12MB827618.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(23010399003)(366016)(376014)(7416014)(18002099003)(6133799003)(921020)(56012099006)(3023799007)(11063799006)(5023799004)(261009223027099003)(10067099003)(261102123227099003)(261021121427099003)(261021123027099003)(261026140227099003)(261026121527099003)(261028144727099003)(261022113327099003)(261022075727099003)(261022105027099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?FOfonk4plTgZrfA4CxfzafutSkyAlpLZGiDeoBdFgJfo/UM87p7sY2gH3nFw?= =?us-ascii?Q?wPFey3KBNM0pSYVJ4SUY/a6oKRXWNH4P+HglC7tRmJi3pjpo3gWT8zIAoS1E?= =?us-ascii?Q?6pzVla5JgfxfMs9nIgPWrZHwyV4AfHKbuAARPy8FUnoHdb1loMc8dpsmdOf2?= =?us-ascii?Q?U+Z3QqX7t3SgopkhXf4V+SM8wGvFf4orq7FocRXRNPhBKelwDAdN5PHJRDSM?= =?us-ascii?Q?RPo7Ba5yVp0PBbB+Yw5Jq6jQaHZBMg+sZ3f8NUxQK8Q7FEDE9BellmeEkGBj?= =?us-ascii?Q?p3/b3CJk5eBNzhbLNvkGw31aj+xJncsPQr0Boum5sXJVR8oBbX/GbPLnvunh?= =?us-ascii?Q?GVH2jTS7d7A/2Zb/2uSetJ9Dotf3IvBfn192rG3orfNjwAz5rYIFug6ybA4j?= =?us-ascii?Q?hO+eM0UP3mt416NphF6kAaPUTfjKTGK30O+L+3oMvXGnXIY8AYox6xG1/pTZ?= =?us-ascii?Q?gdU5WEIusx9Aj/ZicsqtH0GYBZsUQHOKlf2ROkrvGMymoxyE/Kjv8YX7L3C6?= =?us-ascii?Q?IjKrn6YcZDKRHP0MfukQXtKNj+rDCUD0yfl9XxMwfGSI1o++2byQFV7RaQCb?= =?us-ascii?Q?fMVLdz02Z/thQnavBrcojcyslncRLeuxDkSQYHR8IyQvedqIYc3d92kFeHHL?= =?us-ascii?Q?GDQ0qBTo0TsI3KOwIv1Lv5qsOUiqzcXhfu5Aw9vPoGIPaoKxvnGfo14QdQ+1?= =?us-ascii?Q?0fIWNbp3n0fSWt70x6EjxC+N5/OzfXJSayUJ0t0fioA6iXxwWbziu74jq4In?= =?us-ascii?Q?sWYHmLmaUBfBf+bNsOh1j5f+s0iDU1v+GU15UDH8HK401uUWFKNeZG+/uHyX?= =?us-ascii?Q?td9T3UIfsX8KccOIdDrLfrciIPfqYjSYX4gvOpN11adcOXAn7hFShUcJxjKc?= =?us-ascii?Q?TWKueuU8RrxGAX1VMOZSlRyHkWm+hnEIfxF50NHkTAglmyiP9WyeXIDLKjyt?= =?us-ascii?Q?qmxqD4PJlXbhmCfP08TMYGXeXD2Zs89iz5cvKMx8t8WzYlRMiycfrvxgWZuZ?= =?us-ascii?Q?YFJPTfNUAdGcTAct3Hce0OhzWrHA6pVaEhiTC8pzMiOuxlZ3HiXPtyCP4kgY?= =?us-ascii?Q?tDcWy0hMVNd4zJTKwx1It1d8P5RYyZdS3TqoOlG4/MV7vc3rAhy5NYihqlwb?= =?us-ascii?Q?ChPfSO1WRWR1wQV+KRMcZN5Z64LeQBU74GeGnUrdhLF+4IwrYX2OzLVg1RBk?= =?us-ascii?Q?pwmDh/TUUYEPf6O+J0HlXzoMP37DEBcdoC/LqwE7Q+XqNbc6HwgW3plHIOiL?= =?us-ascii?Q?EhYScQ+z/8Bl3TN2deeCWzF7ZJF1O+Jbz5Dw9zHhRSkVgGZl/zkKIxF5pyK6?= =?us-ascii?Q?wM6Qvu0xVxXKxdOJHz8Jl/MuTidNp3hkcdilrpBU3eBP0GUkxI3JwDtjyqFU?= =?us-ascii?Q?AafBj5EUNnURF0vXCpwEHLKt+uezUZ/EA+HhJPjGoYBuzxDmZnomaCb+5MBc?= =?us-ascii?Q?Fb6oNtwbQ90DVF8aM7az9+MAUAI5GemcQUJM7NkItuPhFzzdBqZEg2hV9Xxq?= =?us-ascii?Q?Le90XR5cfi/aPe4ZDoVJHqSEqp7Z0G+dcOFDOnlZZX+82GS5APErMP2qELBz?= =?us-ascii?Q?GaJDpBPsrOWjbJHHJruCAvGga0BTxfXnmopgAx2Xx9iFUkG5Alw4yA5/Mj55?= =?us-ascii?Q?1ailNAM0nBMrDEHWvXvgc0KvkuyAfE2GeY6/FuqFuNLif8FJToUT6cVjc4a6?= =?us-ascii?Q?VullwYZXrbOdLzTrS35L7dbMByuCw3htwh4nRadnIqWHAv7s+74D64eWyNnB?= =?us-ascii?Q?XNVkHIg6oQ=3D=3D?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: c1d7985d-b404-477c-4ed1-08df52865302 X-MS-Exchange-CrossTenant-AuthSource: LY0PR12MB727857.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2026 04:14:58.9003 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8NS6z18Z920P2qh0rSKhbFtZ5cKLLhvQy+zsl7BKQSJJb0vRBgv3XnWtvcPYiqfsZA81hcDD+zCTa7/WJHpp4A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7489 Hi folks, This series adds CXL Reset for Type 2 devices through the existing PCI reset_method and reset sysfs attributes. It disables CXL.cache, performs supported cache writeback, initiates CXL Reset with Memory Clear, and restores cached HDM decoder and CXL Device DVSEC state before PCI use resumes. Active HDM ranges are reserved and CPU caches invalidated before and after reset. The method remains limited to eligible single-function devices with both CXL.cache and CXL.mem enabled. CXL bus reset restores the same cached state and flushes the host and device caches around the reset. The reset sequence follows the CXL 4.0 specification [5], including CXL.cache disable, optional cache writeback, CXL Reset Memory Clear, ResetComplete polling, and ResetError reporting. Sections 9.7.2 and 9.7.3 define the completion timeout encodings and reset access restrictions. The userspace ABI is the existing PCI reset interface: /sys/bus/pci/devices/.../reset_method /sys/bus/pci/devices/.../reset Userspace selects "cxl_reset" in reset_method and triggers the reset through reset. Following Dan's v6 feedback, this uses the PCI interface instead of adding a memdev-specific sysfs ABI. For sysfs reset, the generic PCI path invokes the driver's reset_prepare() callback when provided and disables PCI I/O, memory decoding, and bus mastering. The CXL path reserves affected HDM ranges exclusively and blocks IOMMU translations where applicable. It does not offline memory or revoke mappings: userspace is expected to offline CXL.mem users before reset. The reservation enforces this for claimed ranges by failing the reset while a conflicting resource is claimed. Locking changed in v18. The global region lock is no longer held across the reset. Both reset paths take cxl_rwsem.region only for four short windows: prepare: snapshot the cache, validate and reserve the HPA ranges, set reset_pending (no region lock) host cache flush, device cache writeback offline: set regs_offline (no region lock) reset, Memory Clear wait for cxl_reset restore: re-read the cached decoders, restore the state, clear regs_offline (no region lock) host cache flush unmark: clear reset_pending While reset_pending is set, cxl_decoder_commit() returns -EBUSY for that device, so no region using it can commit in the middle of a reset. While regs_offline is set, a region teardown only updates the software state and the cache and leaves the registers alone; the restore then programs the decoders from the updated cache. Dave's lockdep reproducer [6] (a region read, a device remove and a slot power-off during the reset) no longer hangs. Changes from v17 [1]: - Rebased onto cxl/for-7.5/cxl-kunit (Alison) - Reworked the locking as described above, for both cxl_reset and cxl_bus (Dave, Alison) [6][7]. disable_hdm() now also updates the cached global control, and the restore re-reads the decoders from the cache (Dave) - Fixes from the Sashiko review [10]: the reset preconditions are checked in the prepare step, so a refused CXL reset no longer falls back to FLR; DVSEC-decoded memory is judged from the snapshot; Normalized Addressing survives decoder refreshes; CXL.cache stays off until the host caches are flushed; a bus reset checks that it can run before touching the device; function 0 of an ARI device is rejected when other functions share the bus; all-ones config reads are rejected when filling the cache - cxl_reset now refuses, as cxl_bus already did, when CXL.cache is enabled but the device cannot write back its cache - Smaller cleanups in patches 2 and 9-12 (Dave, Li Ming). Each patch has the details. - Dropped the Assisted-by trailers and added Dave's Reviewed-by to patches 7 and 8 Still open: Alison's question about resetting before Normalized Addressing is known [8] and Alejandro's CXL.io/IOMMU question [9]. I'll follow up in those threads. Earlier history is in the v16 [2] and v15 [3] cover letters. HDM caching needs the CXL.cache, CXL.mem, CXL Reset and Reset Memory Clear capabilities, and CXL bus reset restores its state from the same cache. CXL Reset also needs a CPU cache clean/invalidate provider, such as the SMCCC series [4]. Without one, cxl_reset is still listed but fails with -ENXIO and does not fall back to FLR, unless the test-only CXL_REGION_INVALIDATION_TEST option is set. The KUnit suite covers HDM range boundaries, zero-size and uncommitted decoders, lock and target-type decoding, and 12-way interleave. AI coding assistants were used to help write and review parts of this series, and an AI review found two of the v18 fixes. I have reviewed all AI-assisted changes. Testing: I ran v18 in QEMU with two cxl-type2 devices behind two CXL host bridges and lockdep on, for both cxl_reset and cxl_bus, with a delay added in the prepare step. A region read and a device remove complete during the delay, and lockdep reports nothing for the CXL locks. The pciehp slot power-off path still shows the existing pci_rescan_remove_lock vs reset_lock warning, which also shows up without this series. Each patch builds with W=1, and Clang 23 context analysis is clean for the touched files. The CXL KUnit suites, including cxl_hdm_unpack_kunit, pass. On hardware, I ran v18 with the SMCCC provider series [4] (provider in use, CXL_REGION_INVALIDATION_TEST off) on an ARM64 system with four CXL Type 2 devices and the vendor driver bound. On each device I onlined the memory as a NUMA node, left dirty CPU cache lines in it, offlined it, and then issued the driver's CXL reset and CXL bus reset requests (which select cxl_reset and cxl_bus) once each. All of them succeeded. Afterwards all four devices still had the CXL DVSEC, CXL.cache and CXL.mem were still enabled on the device I checked, and a CPU fill and verify of the device memory matched. [1] https://lore.kernel.org/linux-cxl/20261105185917.2667656-1-smadhavan@nvidia.com/ [2] https://lore.kernel.org/linux-cxl/20261029145703.2185231-1-smadhavan@nvidia.com/ [3] https://lore.kernel.org/linux-cxl/20261011021422.3428136-1-smadhavan@nvidia.com/ [4] https://lore.kernel.org/linux-arm-kernel/20261021224557.1827361-1-smadhavan@nvidia.com/ [5] https://computeexpresslink.org/wp-content/uploads/2026/02/CXL-Specification_rev4p0_ver1p0_2026February26_clean_evalcopy_v2.pdf [6] https://lore.kernel.org/linux-cxl/5616c825-454e-4eba-9352-b06d98dc123a@intel.com/ [7] https://lore.kernel.org/linux-cxl/avyOoQjiD7Uh_3rE@aschofie-mobl2.lan/ [8] https://lore.kernel.org/linux-cxl/avyPsvwV1_lc9va5@aschofie-mobl2.lan/ [9] https://lore.kernel.org/linux-cxl/f5fdc266-aed3-47e6-a10f-e8188b58c93f@amd.com/ [10] https://sashiko.dev/#/patchset/20261105185917.2667656-1-smadhavan@nvidia.com Srirangan Madhavan (19): cxl: Clarify decoder interleave limit cxl: Share CXL port upstream PCI device lookup cxl: Move decoder declarations to shared header cxl: Embed decoder configuration in a standalone structure cxl: Introduce endpoint HDM decoder settings cxl: Move HDM decoder helpers to built-in code cxl: Share HDM decoder register unpacking cxl: Move cxl_rwsem into built-in code cxl: Refresh cached PCI HDM decoder settings cxl: Build register block helpers into the kernel PCI/CXL: Cache endpoint HDM state during PCI enumeration PCI/CXL: Add CXL Device Reset sequencing cxl: Validate and synchronize HDM ranges around reset PCI/CXL: Reject reset with unsafe function scope PCI/CXL: Restore CXL state after PCI reset PCI/CXL: Expose CXL Reset as a PCI reset method PCI/CXL: Restore CXL state after CXL bus reset PCI/CXL: Flush host and device caches for CXL bus reset cxl: Add KUnit checks for HDM decoder unpacking MAINTAINERS | 1 + drivers/cxl/Kconfig | 8 +- drivers/cxl/acpi.c | 26 +- drivers/cxl/core/Makefile | 2 +- drivers/cxl/core/atl.c | 4 +- drivers/cxl/core/core.h | 15 + drivers/cxl/core/hdm.c | 315 ++++---- drivers/cxl/core/hdm_regs.c | 443 +++++++++++ drivers/cxl/core/hdm_state.c | 499 +++++++++++++ drivers/cxl/core/pci.c | 140 ++-- drivers/cxl/core/port.c | 62 +- drivers/cxl/core/region.c | 117 +-- drivers/cxl/core/regs.c | 9 + drivers/cxl/cxl.h | 46 +- drivers/cxl/pci.c | 2 +- drivers/cxl/port.c | 4 +- drivers/cxl/tests/Makefile | 3 + drivers/cxl/tests/hdm_unpack_kunit.c | 91 +++ drivers/pci/Makefile | 1 + drivers/pci/bus.c | 1 + drivers/pci/cxl.c | 1029 ++++++++++++++++++++++++++ drivers/pci/pci.c | 57 +- drivers/pci/pci.h | 51 ++ drivers/pci/probe.c | 1 + include/cxl/cxl.h | 57 +- include/cxl/hdm.h | 119 +++ include/cxl/pci.h | 13 + include/linux/pci.h | 8 +- include/uapi/linux/pci_regs.h | 14 + tools/testing/cxl/Kbuild | 1 - tools/testing/cxl/test/cxl.c | 158 ++-- 31 files changed, 2850 insertions(+), 447 deletions(-) create mode 100644 drivers/cxl/core/hdm_regs.c create mode 100644 drivers/cxl/core/hdm_state.c create mode 100644 drivers/cxl/tests/hdm_unpack_kunit.c create mode 100644 drivers/pci/cxl.c create mode 100644 include/cxl/hdm.h base-commit: 533928808ac1e6a96a7daa74b6ad68c3f7f43a28 -- 2.43.0