From nobody Mon Feb 9 01:01:11 2026 Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58AAE28850B for ; Thu, 18 Dec 2025 14:47:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.193 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766069238; cv=none; b=SHOpUd49BEoj4glru0+5M+Jx8eY47kVwgwv13wbl+ezpHjNQgcDzTQaKdKC/xS0r446i+Ofz2MMcS9L2U7hbpQ2z45+zwO5iVfMbrzaRcTO1UwUoJ/wsbfNJ2ckv+8Pv6KzUjSsDYAXK119UagIv4isyMDLQ5mfAGAhrP+NYpLY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766069238; c=relaxed/simple; bh=wUkrh8TV1+RwPKNKqlybTP/4u0tI61BgBs1sDpD1Mn8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=oGnnxhsN/YlS8OK1MJ4kau2oTwN+zqMFpDX/iSrWX01oD2YBc3LXJJU0qk7SMUvcWBDeASQTje1IJugY9b+ZCK6sLOKLX/KMMY4nCPn6cR8RHlejpxqvTK9D+HRWtT1pvpq4EOSpMcLMHuoU9hed3VhY9Q9YZNAMm+hjt/dwNWA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=FguINTqc; arc=none smtp.client-ip=209.85.222.193 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="FguINTqc" Received: by mail-qk1-f193.google.com with SMTP id af79cd13be357-8b9f73728e8so73845685a.0 for ; Thu, 18 Dec 2025 06:47:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1766069235; x=1766674035; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=80Wj3hQjVTosfLzfe42v+uXysTzJn7NF93jJAzRmue0=; b=FguINTqc/xR8BzBmDZJE/YWPVmI0KgSp++X/tMalDopEJeOOTblT+a8USadhSBMelJ 1tOxOoCdAd/GfPB785xWwcUfUx+az0ZX+1SpAFaiJfTGMmMNCyu7TWtKFsWpLBNkw3aY NXjfDxB796Y7sj26k6Elj8mahTmLSLvxQZccBqYg6k8S+oeTrdz5MY4osGhP+WyHWUJJ kF0jXl+W+QyyTmwpQP7AGMyb5Ydl6QIQ8U0GEVbuvpXIBzhl1RmArxdSywmuDL2F/2R0 Q24U2DQH+L/y1dUZ8l/ORhb3wQiwZYAJAFem378n60cOkoiZmIpa0g4RlQHkh7ZtBPPx 1lrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766069235; x=1766674035; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=80Wj3hQjVTosfLzfe42v+uXysTzJn7NF93jJAzRmue0=; b=t4NEa2lALYLsRGVd6stZJWrXHuNxuKbh0Q/rCZwQPMFKPZ0BsyvBw+zFjvUc6pzcgQ C5E1hV0CO6EnwoF53nzsaVpvCWUDbYw8ILnPzaalfQ4w+W2b4Gx5jgAiT539MzU9kXRd lfAv6uNFQBj1RoBjEvczeEgwpApDY5a4Kw8UmUzz8qZXpoyNYQkz7OIIKJulJ8UZ0Lfm q4tgRcJs9DKgv86hCd7ia44l+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d9mr2875380285a.77.1766069235039; Thu, 18 Dec 2025 06:47:15 -0800 (PST) Received: from gourry-fedora-PF4VCD3F.lan (pool-96-255-20-138.washdc.ftas.verizon.net. [96.255.20.138]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8beeb5f189fsm177076185a.14.2025.12.18.06.47.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Dec 2025 06:47:14 -0800 (PST) From: Gregory Price To: linux-cxl@vger.kernel.org Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, dave@stgolabs.net, jonathan.cameron@huawei.com, dave.jiang@intel.com, alison.schofield@intel.com, vishal.l.verma@intel.com, ira.weiny@intel.com, dan.j.williams@intel.com, corbet@lwn.net, gourry@gourry.net, kernel-team@meta.com, alejandro.lucero-palau@amd.com Subject: [PATCH] Documentation/driver-api/cxl: device hotplug section Date: Thu, 18 Dec 2025 09:46:36 -0500 Message-ID: <20251218144636.1232527-1-gourry@gourry.net> X-Mailer: git-send-email 2.52.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Describe cxl memory device hotplug implications, in particular how the platform CEDT CFMWS must be described to support successful hot-add of memory devices. Signed-off-by: Gregory Price --- Documentation/driver-api/cxl/index.rst | 1 + .../cxl/platform/device-hotplug.rst | 77 +++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 Documentation/driver-api/cxl/platform/device-hotplug.rst diff --git a/Documentation/driver-api/cxl/index.rst b/Documentation/driver-= api/cxl/index.rst index c1106a68b67c..5a734988a5af 100644 --- a/Documentation/driver-api/cxl/index.rst +++ b/Documentation/driver-api/cxl/index.rst @@ -30,6 +30,7 @@ that have impacts on each other. The docs here break up = configurations steps. platform/acpi platform/cdat platform/example-configs + platform/device-hotplug =20 .. toctree:: :maxdepth: 2 diff --git a/Documentation/driver-api/cxl/platform/device-hotplug.rst b/Doc= umentation/driver-api/cxl/platform/device-hotplug.rst new file mode 100644 index 000000000000..9af8988bd47a --- /dev/null +++ b/Documentation/driver-api/cxl/platform/device-hotplug.rst @@ -0,0 +1,77 @@ +.. SPDX-License-Identifier: GPL-2.0 + +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +CXL Device Hotplug +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Device hotplug refers to *physical* hotplug of a device (addition or remov= al +of a physical device from the machine). + +Hot-Remove +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +Hot removal of a device typically requires careful removal of software +constructs (memory regions, associated drivers) which manage these devices. + +Hard-removing a CXL.mem device without carefully tearing down driver stacks +is likely to cause the system to machine-check (or at least SIGBUS if memo= ry +access is limited to user space). + +Memory Device Hot-Add +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +Hot-adding a memory device requires that the memory associated with that +device fits in a pre-defined (*static*) CXL Fixed Memory Window in the +:doc:`CEDT`. + +There are two basic hot-add scenarios which may occur. + +Device Present at Boot +---------------------- +A device present at boot likely had its capacity reported in the +:doc:`CEDT`. If a device is removed and a new device hotplugge= d, +the capacity of the new device will be limited to the original CFMWS capac= ity. + +Adding a device larger than the original device will cause memory region +creation to fail if the region size is greater than the CFMWS size. + +The CFMWS is *static* and cannot be adjusted. Platforms which may expect +different sized devices to be hotplugged must allocate sufficient CFMWS sp= ace +*at boot time* to cover all future expected devices. + +No CXL Device Present at Boot +----------------------------- +When no CXL device is present on boot, most platforms omit the CFMWS in the +:doc:`CEDT`. When this occurs, hot-add is not possible. + +For a platform to support hot-add of a memory device, it must allocate a +CEDT CFMWS region with sufficient memory capacity to cover all future +potentially added capacity. + +Switches in the fabric should report the max possible memory capacity +expected to be hot-added so that platform software may construct the +appropriately sized CFMWS. + +Interleave Sets +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Host Bridge Interleave +---------------------- +Host-bridge interleaved memory regions are defined *statically* in the +:doc:`CEDT`. To apply cross-host-bridge interleave, a CFMWS en= try +describing that interleave must have been provided *at boot*. Hotplugged +devices cannot add host-bridge interleave capabilities at hotplug time. + +See the :doc:`Flexible CEDT Configuration` +example to see how a platform can provide this kind of flexibility regardi= ng +hotplugged memory devices. + +Platform vendors should work with switch vendors to work out how this +HPA space reservation should work when one or more interleave options are +intended to be presented to a host. + +HDM Interleave +-------------- +Decoder-applied interleave can flexibly handle hotplugged devices, as deco= ders +can be re-programmed after hotplug. + +To add or remove a device to/from an existing HDM-applied interleaved regi= on, +that region must be torn down an re-created. --=20 2.52.0