Linux CXL
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: Gregory Price <gourry@gourry.net>, 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, alison.schofield@intel.com,
	vishal.l.verma@intel.com, ira.weiny@intel.com,
	dan.j.williams@intel.com, corbet@lwn.net
Subject: Re: [PATCH v3 07/17] cxl: docs/linux - overview
Date: Mon, 12 May 2025 17:09:00 -0700	[thread overview]
Message-ID: <0c753b5b-37e9-4f72-a27a-acd5b64752aa@intel.com> (raw)
In-Reply-To: <20250512162134.3596150-8-gourry@gourry.net>



On 5/12/25 9:21 AM, Gregory Price wrote:
> Add type-3 device configuration overview that explains the probe
> process for a type-3 device from early-boot through memory-hotplug.
> 
> Signed-off-by: Gregory Price <gourry@gourry.net>

Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> ---
>  Documentation/driver-api/cxl/index.rst        |   3 +-
>  .../driver-api/cxl/linux/overview.rst         | 103 ++++++++++++++++++
>  2 files changed, 105 insertions(+), 1 deletion(-)
>  create mode 100644 Documentation/driver-api/cxl/linux/overview.rst
> 
> diff --git a/Documentation/driver-api/cxl/index.rst b/Documentation/driver-api/cxl/index.rst
> index 6a5fb7e00c52..bc2228c77c32 100644
> --- a/Documentation/driver-api/cxl/index.rst
> +++ b/Documentation/driver-api/cxl/index.rst
> @@ -30,9 +30,10 @@ that have impacts on each other.  The docs here break up configurations steps.
>     platform/example-configs
>  
>  .. toctree::
> -   :maxdepth: 1
> +   :maxdepth: 2
>     :caption: Linux Kernel Configuration
>  
> +   linux/overview
>     linux/access-coordinates
>  
>  
> diff --git a/Documentation/driver-api/cxl/linux/overview.rst b/Documentation/driver-api/cxl/linux/overview.rst
> new file mode 100644
> index 000000000000..648beb2c8c83
> --- /dev/null
> +++ b/Documentation/driver-api/cxl/linux/overview.rst
> @@ -0,0 +1,103 @@
> +.. SPDX-License-Identifier: GPL-2.0
> +
> +========
> +Overview
> +========
> +
> +This section presents the configuration process of a CXL Type-3 memory device,
> +and how it is ultimately exposed to users as either a :code:`DAX` device or
> +normal memory pages via the kernel's page allocator.
> +
> +Portions marked with a bullet are points at which certain kernel objects
> +are generated.
> +
> +1) Early Boot
> +
> +  a) BIOS, Build, and Boot Parameters
> +
> +    i) EFI_MEMORY_SP
> +    ii) CONFIG_EFI_SOFT_RESERVE
> +    iii) CONFIG_MHP_DEFAULT_ONLINE_TYPE
> +    iv) nosoftreserve
> +
> +  b) Memory Map Creation
> +
> +    i) EFI Memory Map / E820 Consulted for Soft-Reserved
> +
> +      * CXL Memory is set aside to be handled by the CXL driver
> +
> +      * Soft-Reserved IO Resource created for CFMWS entry
> +
> +  c) NUMA Node Creation
> +
> +    * Nodes created from ACPI CEDT CFMWS and SRAT Proximity domains (PXM)
> +
> +  d) Memory Tier Creation
> +
> +    * A default memory_tier is created with all nodes.
> +
> +  e) Contiguous Memory Allocation
> +
> +    * Any requested CMA is allocated from Online nodes
> +
> +  f) Init Finishes, Drivers start probing
> +
> +2) ACPI and PCI Drivers
> +
> +  a) Detects PCI device is CXL, marking it for probe by CXL driver
> +
> +3) CXL Driver Operation
> +
> +  a) Base device creation
> +
> +    * root, port, and memdev devices created
> +    * CEDT CFMWS IO Resource creation
> +
> +  b) Decoder creation
> +
> +    * root, switch, and endpoint decoders created
> +
> +  c) Logical device creation
> +
> +    * memory_region and endpoint devices created
> +
> +  d) Devices are associated with each other
> +
> +    * If auto-decoder (BIOS-programmed decoders), driver validates
> +      configurations, builds associations, and locks configs at probe time.
> +
> +    * If user-configured, validation and associations are built at
> +      decoder-commit time.
> +
> +  e) Regions surfaced as DAX region
> +
> +    * dax_region created
> +
> +    * DAX device created via DAX driver
> +
> +4) DAX Driver Operation
> +
> +  a) DAX driver surfaces DAX region as one of two dax device modes
> +
> +    * kmem - dax device is converted to hotplug memory blocks
> +
> +      * DAX kmem IO Resource creation
> +
> +    * hmem - dax device is left as daxdev to be accessed as a file.
> +
> +      * If hmem, journey ends here.
> +
> +  b) DAX kmem surfaces memory region to Memory Hotplug to add to page
> +     allocator as "driver managed memory"
> +
> +5) Memory Hotplug
> +
> +  a) mhp component surfaces a dax device memory region as multiple memory
> +     blocks to the page allocator
> +
> +    * blocks appear in :code:`/sys/bus/memory/devices` and linked to a NUMA node
> +
> +  b) blocks are onlined into the requested zone (NORMAL or MOVABLE)
> +
> +    * Memory is marked "Driver Managed" to avoid kexec from using it as region
> +      for kernel updates


  reply	other threads:[~2025-05-13  0:09 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-12 16:21 [PATCH v3 00/17] CXL Boot to Bash Documentation Gregory Price
2025-05-12 16:21 ` [PATCH v3 01/17] cxl: update documentation structure in prep for new docs Gregory Price
2025-05-12 22:46   ` Dave Jiang
2025-05-12 16:21 ` [PATCH v3 02/17] cxl: docs - access-coordinates doc fixups Gregory Price
2025-05-12 22:47   ` Dave Jiang
2025-05-12 16:21 ` [PATCH v3 03/17] cxl: docs/devices - add cxl device and protocol reference Gregory Price
2025-05-12 23:08   ` Dave Jiang
2025-05-12 23:22     ` Gregory Price
2025-05-12 16:21 ` [PATCH v3 04/17] cxl: docs/platform/bios-and-efi documentation Gregory Price
2025-05-12 23:31   ` Dave Jiang
2025-05-12 16:21 ` [PATCH v3 05/17] cxl: docs/platform/acpi reference documentation Gregory Price
2025-05-12 23:49   ` Dave Jiang
2025-05-12 16:21 ` [PATCH v3 06/17] cxl: docs/platform/example-configs documentation Gregory Price
2025-05-13  0:05   ` Dave Jiang
2025-05-12 16:21 ` [PATCH v3 07/17] cxl: docs/linux - overview Gregory Price
2025-05-13  0:09   ` Dave Jiang [this message]
2025-05-12 16:21 ` [PATCH v3 08/17] cxl: docs/linux - early boot configuration Gregory Price
2025-05-13 17:56   ` Dave Jiang
2025-05-12 16:21 ` [PATCH v3 09/17] cxl: docs/linux - add cxl-driver theory of operation Gregory Price
2025-05-12 16:21 ` [PATCH v3 10/17] cxl: docs/linux/cxl-driver - add example configurations Gregory Price
2025-05-12 16:21 ` [PATCH v3 11/17] cxl: docs/linux/dax-driver documentation Gregory Price
2025-05-12 16:21 ` [PATCH v3 12/17] cxl: docs/linux/memory-hotplug Gregory Price
2025-05-12 16:21 ` [PATCH v3 13/17] cxl: docs/allocation/dax Gregory Price
2025-05-12 16:21 ` [PATCH v3 14/17] cxl: docs/allocation/page-allocator Gregory Price
2025-05-12 16:34   ` Matthew Wilcox
2025-05-12 16:38     ` Gregory Price
2025-05-12 17:52       ` Matthew Wilcox
2025-05-12 18:09         ` Gregory Price
2025-05-13  2:39           ` dan.j.williams
2025-05-12 16:21 ` [PATCH v3 15/17] cxl: docs/allocation/reclaim Gregory Price
2025-05-12 16:21 ` [PATCH v3 16/17] cxl: docs/allocation/hugepages Gregory Price
2025-05-12 16:21 ` [PATCH v3 17/17] cxl: docs - add self-referencing cross-links Gregory Price
2025-05-13 20:38 ` [PATCH v3 00/17] CXL Boot to Bash Documentation Dave Jiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0c753b5b-37e9-4f72-a27a-acd5b64752aa@intel.com \
    --to=dave.jiang@intel.com \
    --cc=alison.schofield@intel.com \
    --cc=corbet@lwn.net \
    --cc=dan.j.williams@intel.com \
    --cc=dave@stgolabs.net \
    --cc=gourry@gourry.net \
    --cc=ira.weiny@intel.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=kernel-team@meta.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vishal.l.verma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox