From nobody Mon Feb 9 01:11:16 2026 Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) (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 24223329E49 for ; Fri, 19 Dec 2025 17:06:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766163984; cv=none; b=BYXKemFiPlITHD7NDvrW/VWoHjGD5pUgOJkYy7Zjr702Auo2KLRu43Cw5R7UNVKa9VugazAY5hhFGmzYUtYdjlIwVl7Kylfzvo+PNn18HFeOYqjW3pFHyK+aYKpxpq6BuZH/wm11RgEnrzE5TJZNBcJVgdB9SGe0Qz5qsgsnW9o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766163984; c=relaxed/simple; bh=0D/WrdGQQE7ltHL5+mGa/wEqsIL3YPu+z4L3U2Lyshg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oPHdQHWUh7hmz3nHF5BfJi10lgVYeaj758u0rbURpLhjR+4ZCstUfthhsEnMjWpvKVijyuxW2EzMnjmfv01CFwd++UTxAGDrEjWjmgJ/n5XcpWAVFvJ1nysEM4irkAUkQU9MKgxtNkfQ40yUt94VbE40E46xdsZztHgomJfyddo= 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=Ei6ASSpc; arc=none smtp.client-ip=209.85.160.194 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="Ei6ASSpc" Received: by mail-qt1-f194.google.com with SMTP id d75a77b69052e-4eda6c385c0so15008211cf.3 for ; Fri, 19 Dec 2025 09:06:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1766163981; x=1766768781; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0kou8afbLn05l+95wrl3ljXnrRcnV/4rBFXifcZSKEU=; b=Ei6ASSpcATcOSt4Hg9M1P5/7rlrbnn7cUE1w7jloYyMv/AjUQknuuIQJL8cfJ8Lsg1 e/FtFrk55jLNHumNaKgy6cDm2bQSVCOZJCYBWUOOtQc/0Q5hp7CNbZG3/NuKFrXuJPFK x4P1fcm7F9fi+osc/VF9Cu6Aqu04dBFO4XYKcvpJJtair0Z9976Dz+iNyFcxi5H3oPwh mk5rBGVjBiQndB+1xFvYulMAuTrFjPUj0P5Xf/7fxkKBQDDGLql7j+jb+UKce7zpx/3F ycfKauErYVzpsZIYDlWZbwRgtH16A3KQfsjTuucnDQjvtZOeqyB/H/JMDECBmIV1tBkE Mwyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766163981; x=1766768781; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=0kou8afbLn05l+95wrl3ljXnrRcnV/4rBFXifcZSKEU=; b=Y9rinJNEYptqKL3QM5I44/aS0VZxoan+A5N0aZEH/sh6lSDa66RJRFcuEYUsuYK8iB G9jHLnt0qZjATQnNNdVKDzUdISP0VZFE9Ew3Ri/unyfP4Cg1s0yz5Z9oWzOluDM0M8+B R9ac9el5j7YYoVx9uz40nl80yu1ZNEuCyUc3S4WTihp7NL678CXv95HAB7NHqEq3zPXM i/AtKwSXDv8Eqkg4IQ7otbr2EcYnf2lzezA8rPkGqhfZD377JqGO1i1dUF8xL9Ht4sW4 xx2tJ/OR7f31ZFj4Vh5DageUpxnYCBY4W13Sr0cy2BKmCXCIrI+S4o0xN/wGwipjN/t7 qsRw== X-Forwarded-Encrypted: i=1; AJvYcCVv645Y6Ur9ZHt9C/0Vc9EsuiqXDSTQK5sb9rbkzXD2G7lA2qZ+HvfinANV/qXNAPri9wKPo22iIWaWVbk=@vger.kernel.org X-Gm-Message-State: AOJu0YzVgiaZV1duQQ0uQK5McFbF9OB+gGFi/igJ+SbEgHlbZIAO3+rN kbbKflwfwGCpdENpj8VlO+uZLQUxOH1cqkfHNdIen+osjvRFSkgZdRezSmchBLY79Kg= X-Gm-Gg: AY/fxX6JWKviA2iGsOSPt4K1ucZsbHv4ta2pPnroJrBDMrp1aVdSA/1XSpU3P+U5WNY 60zupmqPokdoqygMwH2+kCVVyJ3xaG9Zd0P94IF69AJ32z1ARmU8+4MM8YvIOW3KPmHm0OSOVaL bUaueeZQZ0ckJL65Pfwz8wk9n/iBlt5yFLqSm665cHidhD2/HCvlyDRsH/s6DEXQWPc6uMnyCo7 wlHGW8z7806FTlN85X+s1fS0ylfpmS6WitABWffFs6eDoHGwx/0uxgHLG63g190XX6WBfA5LB3s 0csax4qtPOsJnbQgO3C7b/zVJKS1ZN5wBWKPU88lGK2lPlr3ejYWx5ZCXtu6Wcxf55fSAGaxVph ADSC8S9ptBs3qBfb2uaDTw2l/UXc5o9Yc/enYyHy72fqOhtAk69oLO45VTRn+See4YsNQ4Aj29g kqRRVvOjn/itKRIU4vwlCTN5TGd3Yjrste9d9BmgoFuSuYrpKDqX9kYYyZhRzaDQQxc2AYeRiBG cw= X-Google-Smtp-Source: AGHT+IEw8aBZs2L4mMPmBDnnSLjfBX5Ies32NoaSuD3sFkoiOQdXSOB6QOg5l7pX5LIIu4V5HSwekQ== X-Received: by 2002:a05:622a:1c0b:b0:4e7:2dac:95b7 with SMTP id d75a77b69052e-4f4abd2b668mr47440391cf.37.1766163980936; Fri, 19 Dec 2025 09:06:20 -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-8c096787536sm223197185a.4.2025.12.19.09.06.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Dec 2025 09:06:20 -0800 (PST) From: Gregory Price To: linux-cxl@vger.kernel.org Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, 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, rakuram.e96@gmail.com, alucerop@amd.com Subject: [PATCH v3 1/2] Documentation/driver-api/cxl: BIOS/EFI expectation update Date: Fri, 19 Dec 2025 12:05:37 -0500 Message-ID: <20251219170538.1675743-2-gourry@gourry.net> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251219170538.1675743-1-gourry@gourry.net> References: <20251219170538.1675743-1-gourry@gourry.net> 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" Add a snippet about what Linux expects BIOS/EFI to do (and not to do) to the BIOS/EFI section. Suggested-by: Alejandro Lucero Palau Signed-off-by: Gregory Price Reviewed-by: Alejandro Lucero Palau Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron --- .../driver-api/cxl/platform/bios-and-efi.rst | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Documentation/driver-api/cxl/platform/bios-and-efi.rst b/Docum= entation/driver-api/cxl/platform/bios-and-efi.rst index a9aa0ccd92af..9034c206cf8e 100644 --- a/Documentation/driver-api/cxl/platform/bios-and-efi.rst +++ b/Documentation/driver-api/cxl/platform/bios-and-efi.rst @@ -29,6 +29,26 @@ at :doc:`ACPI Tables `. on physical memory region size and alignment, memory holes, HDM interle= ave, and what linux expects of HDM decoders trying to work with these featur= es. =20 + +Linux Expectations of BIOS/EFI Software +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +Linux expects BIOS/EFI software to construct sufficient ACPI tables (such = as +CEDT, SRAT, HMAT, etc) and platform-specific configurations (such as HPA s= paces +and host-bridge interleave configurations) to allow the Linux driver to +subsequently configure the devices in the CXL fabric at runtime. + +Programming of HDM decoders and switch ports is not required, and may be +deferred to the CXL driver based on admin policy (e.g. udev rules). + +Some platforms may require pre-programming HDM decoders and locking them +due to quirks (see: Zen5 address translation), but this is not the normal, +"expected" configuration path. This should be avoided if possible. + +Some platforms may wish to pre-configure these resources to bring memory +up without requiring CXL driver support. These platform vendors should +test their configurations with the existing CXL driver and provide driver +support for their auto-configurations if features like RAS are required. + UEFI Settings =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D If your platform supports it, the :code:`uefisettings` command can be used= to --=20 2.52.0 From nobody Mon Feb 9 01:11:16 2026 Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) (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 17F3B33B6E8 for ; Fri, 19 Dec 2025 17:06:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.196 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766163988; cv=none; b=FoZBSIScTTSj0GLN3+lHhOFXYXtINgzPNF/ZhSIkYd9FASa8ZinyBHqyGjD3GrTUJJg7zNqo2QNeuwb0Wmq2tY5fDg/gzcp9gcu0dH6tAWG0xbLrHUDuvK2YbzvlTQz7USADlCGbNGhBTNr0P41ZiluVMXs8UcY45n/9oJKSQzg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766163988; c=relaxed/simple; bh=Y+71PUVRfwuvUKxaHdzqE9jx5sqntnX+4UWIz5GKPsk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Irrpo70waPyVJPQc4eYzrZQrOJBbSPBaxlyOPEIDfsWR8Pbmhjy8Feut32budu+16t3U7OHbrJkpeYIkkEGqlZ9lN2MPwyRRblxXh4J3ylFidLTrndSeHpwCsdBQWUfor26CiJKPiDANdKJpJECKPYbz89FaVkL+CFdpUwyxuMc= 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=erBE4GC4; arc=none smtp.client-ip=209.85.222.196 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="erBE4GC4" Received: by mail-qk1-f196.google.com with SMTP id af79cd13be357-8b2d6df99c5so294347285a.1 for ; Fri, 19 Dec 2025 09:06:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1766163984; x=1766768784; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ve73z4RK/cYcNMBA2t4ADqsjJbpaVx1NScHqoDm2Vdk=; b=erBE4GC4Inpl1kZlITE3hnD+U9NVUqo5T9x0GfFt0MYjlPcjix1elMFZq9Zqeb533K qXHmpvV7x8ink+nv8aE5UqCDBg5U2KnesSuVee+0u/qcAYN+GN9y9E5tDQKOJLiRKfVE dCZK8HYwq1SWUjC+MkS0M29L8dy3y1xy0pzd3TsE6vnSUUMRPJ+OZnUTPZG0h5PCCKYw F2ZNF/ap51NxMLwqJqB2M7J4K6PrrNC9gLraksGV2gTgezpv8MJgtgTQwi9bytKBa525 4cokFih8UrJlcOHc16NMHiMLjZEb/p9h9tcufttXrkbsJMIElnwBQkpkk6BRT2l05/Ib cAOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766163984; x=1766768784; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Ve73z4RK/cYcNMBA2t4ADqsjJbpaVx1NScHqoDm2Vdk=; b=ln+Dpa9JrdLjnvBF0mbmCc59ZgFj/Qokq6oZF6BJ3FA88O3Z1gzcjJT99e3XeQdO3y geNyOaJR33UhptAGrqTO89EEvpR7iY5zgboq5vBYUZHCf761wHwIaC2FWjj+Ug2/J8Be 8GL4kx9ouj1lEN++oSVbUQwYEovW6FiowaXr8TiA62FziYZ9sbt6IaUo91dcJw1iaLhk i13JtNOZXBiuMUiYq6LqgycUhxEeSbqnSI144eVX4Am9s3Bkz/ekS74UWWT0QU36tap1 vtIJvrySH8xKxu8j6Dlxp+WLKqidz1gmcKEK/OeAC5jT5950x1m1R+DExZunnTs2usfG be1A== X-Forwarded-Encrypted: i=1; AJvYcCVpmIt/OJoM/Weun26FsyhoUqM14oTOmPYx3wILFSyp7Jj3UWC5sa+gvdcBeXpzpv65Y/A0hF/FRs/cJQg=@vger.kernel.org X-Gm-Message-State: AOJu0Yzay9Mj2mjL398kSuuGEDiGrmjDEwUCRjvI8Ew5F4JsfZDuSOTs I4Ch9tr+bXyr+qiBUWRCYgv7RYMSKvG8bajDYiMqL7AQVObIFQipIV8da05w3+nVDTE= X-Gm-Gg: AY/fxX6j/nyYqaNjDyAqRr21bZcR70uqTt1v1DCDcdwtQFo8gXjIjhHj66pLzMG2Ne/ PkskJvYz0FCeo29bF2ijuyfqI1CXKpA/vJp+K/bAM8RPzrqi4SMTnE7CUqKT2xKACAZl0gSViMT f8/Is3RbTWVgByJJ4L+wUqop/x8kY6GrA2+xPf2CSkKImGENRnacnXDC6eeluir5J44fhJJRK4s vT1DHU2p0hhnuMmdOV9oxaNCH7hxnTOyv7/8b28wN3Lz0z60N18iV2DR9RQmioQRjqo61R6YF0a Rlws+szIFsG5+iBD/I1k6PjInaX1pp71MYLIFTRF9+hC7GAlqwiX5RigugIzSVn0Nc4BGrQEx22 ZxsuCGv54YVn/LcKwd8nPB0b93LW4cOWXQCWRLygpEMAUYHNUyDCUmveYmXRsL1/ci4yM8MXbEA l7JevJPDBZTJnBWDf1T3lX+iVQJJ3IdgmJBQzzza+6tBmniLQSUouG/KPUg3LTfqjD3aHAysWZB Lk= X-Google-Smtp-Source: AGHT+IGhL++VzFeCqDT/tB5Cvy1Ps114ykiQjB+fbR/l94srArH+8w2+c687M3sNwAIPyDyiArGerA== X-Received: by 2002:a05:620a:4495:b0:8a3:c4fa:9b5b with SMTP id af79cd13be357-8bee682063amr943344385a.12.1766163983905; Fri, 19 Dec 2025 09:06:23 -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-8c096787536sm223197185a.4.2025.12.19.09.06.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Dec 2025 09:06:23 -0800 (PST) From: Gregory Price To: linux-cxl@vger.kernel.org Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, 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, rakuram.e96@gmail.com, alucerop@amd.com Subject: [PATCH v3 2/2] Documentation/driver-api/cxl: device hotplug section Date: Fri, 19 Dec 2025 12:05:38 -0500 Message-ID: <20251219170538.1675743-3-gourry@gourry.net> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251219170538.1675743-1-gourry@gourry.net> References: <20251219170538.1675743-1-gourry@gourry.net> 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. Reviewed-by: Jonathan Cameron Signed-off-by: Gregory Price Reviewed-by: Alejandro Lucero Palau Reviewed-by: Alison Schofield Reviewed-by: Dave Jiang --- v3: Jonathan updates, change some italics to bold, add some bits about Linux's expectations for BIOS/EFI behavior at runtime. Documentation/driver-api/cxl/index.rst | 1 + .../driver-api/cxl/platform/bios-and-efi.rst | 3 + .../cxl/platform/device-hotplug.rst | 130 ++++++++++++++++++ 3 files changed, 134 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/bios-and-efi.rst b/Docum= entation/driver-api/cxl/platform/bios-and-efi.rst index 9034c206cf8e..a4b44c018f09 100644 --- a/Documentation/driver-api/cxl/platform/bios-and-efi.rst +++ b/Documentation/driver-api/cxl/platform/bios-and-efi.rst @@ -49,6 +49,9 @@ up without requiring CXL driver support. These platform = vendors should test their configurations with the existing CXL driver and provide driver support for their auto-configurations if features like RAS are required. =20 +Platforms requiring boot-time programming and/or locking of CXL fabric +components may prevent features, such as device hot-plug, from working. + UEFI Settings =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D If your platform supports it, the :code:`uefisettings` command can be used= to 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..e4a065fdd3ec --- /dev/null +++ b/Documentation/driver-api/cxl/platform/device-hotplug.rst @@ -0,0 +1,130 @@ +.. 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). + +BIOS/EFI software is expected to configure sufficient resources **at boot +time** to allow hotplugged devices to be configured by software (such as +proximity domains, HPA regions, and host-bridge configurations). + +BIOS/EFI is not expected (**nor suggested**) to configure hotplugged +devices at hotplug time (i.e. HDM decoders should be left unprogrammed). + +This document covers some examples of those resources, but should not +be considered exhaustive. + +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 +A device present at boot may be associated with a CXL Fixed Memory Window +reported in :doc:`CEDT`. That CFMWS may match the size of the +device, but the construction of the CEDT CFMWS is platform-defined. + +Hot-adding a memory device requires this pre-defined, **static** CFMWS to +have sufficient HPA space to describe that device. + +There are a few common scenarios to consider. + +Single-Endpoint Memory 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 capacity 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. + +Multi-Endpoint Memory Device Present at Boot +-------------------------------------------- +Non-switch-based Multi-Endpoint devices are outside the scope of what the +CXL specification describes, but they are technically possible. We describe +them here for instructive reasons only - this does not imply Linux support. + +A hot-plug capable CXL memory device, such as one which presents multiple +expanders as a single large-capacity device, should report the **maximum +possible capacity** for the device at boot. :: + + HB0 + RP0 + | + [Multi-Endpoint Memory Device] + _____|_____ + | | + [Endpoint0] [Empty] + + +Limiting the size to the capacity preset at boot will limit hot-add support +to replacing capacity that was present at boot. + +No CXL Device Present at Boot +----------------------------- +When no CXL memory device is present on boot, some platforms omit the CFMWS +in the :doc:`CEDT`. When this occurs, hot-add is not possible. + +This describes the base case for any given device not being present at boo= t. +If a future possible device is not described in the CEDT at boot, hot-add +of that device is either limited or not possible. + +For a platform to support hot-add of a full memory device, it must allocate +a CEDT CFMWS region with sufficient memory capacity to cover all future +potentially added capacity (along with any relevant CEDT CHBS entry). + +To support memory hotplug directly on the host bridge/root port, or on a s= witch +downstream of the host bridge, a platform must construct a CEDT CFMWS at b= oot +with sufficient resources to support the max possible (or expected) hotplug +memory capacity. :: + + HB0 HB1 + RP0 RP1 RP2 + | | | + Empty Empty USP + ________|________ + | | | | + DSP DSP DSP DSP + | | | | + All Empty + +For example, a BIOS/EFI may expose an option to configure a CEDT CFMWS with +a pre-configured amount of memory capacity (per host bridge, or host bridge +interleave set), even if no device is attached to Root Ports or Downstream +Ports at boot (as depicted in the figure above). + + +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. BIOS/EFI software should consider options to +present flexible CEDT configurations with hotplug support. + +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