From nobody Tue Feb 10 16:18:35 2026 Received: from mail-qk1-f194.google.com (mail-qk1-f194.google.com [209.85.222.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 5131C35C198 for ; Thu, 29 Jan 2026 21:05:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769720712; cv=none; b=Ll3H/3Srk6D+n0ub7zBtJcUV63K7TFmO5/hydQEfSIV4SrCue7jvScBZjS4cbEqEYNEEqQuopBe3SKoPi5pyIEK0CO71+j2iKAc5orEQgpx7DId5EZJUClaLLO9I/9g+dvTrLxRSDB+VsdZHEi0+/+oo6ZxkB+CFluqJNUNa3Tk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769720712; c=relaxed/simple; bh=Ysme87URA8h80dz3v+yZIs8qliOaAmjArpOmGNPSVUI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Q12wH/UX6o2UtSPZJDc16FQZ2irATjI6mvGcTZmmIWdvJEhWppyHu22wYM4mlICRQ8shpIJEU1ZNXg2t27DcdWogulObUYpj3//iSogdaTFebRUdnFmR6KvBu7fHYs6Utoe0vxF8vRyI+k3AooDzgjmKXSvi223B+fhLXnpQzaA= 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=QmxxnYP9; arc=none smtp.client-ip=209.85.222.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="QmxxnYP9" Received: by mail-qk1-f194.google.com with SMTP id af79cd13be357-8c5320536bfso138520785a.1 for ; Thu, 29 Jan 2026 13:05:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1769720708; x=1770325508; 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=2izjfMr9wFUktZXLnWxTLQ+Uf13Bf1lvXAJZzNDICcs=; b=QmxxnYP9qHqlX5teNx+fVssa6DDhCzWbcI8iRZ9qLS4T3A29ArWI7Yu3NRGNyq7euZ lqS8/NeIgmYLUmi3GxySKkroid0G1b8vXKX8PuW+mBk+QAsPcXm470wilU6yfHMowbMQ epubSFk+CkBbixUrXGBerZKw/U2NoQNczMzprZ3AAX5Vr4AAANFC+JxzGKEhZRtMnzyX 3uMSJN4OYc/7dS8I08Oi6iLXveO1yZywqcVZWP8h2zJVsLGxWo5p3Y+HyIN0+nXXxCG2 RIDF1t++cOFMIw+zzv37v6DELRkVluXfCMfnVsxP3zbA07W7t3eAL+1Sm5+JJXYZFojP yztg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769720708; x=1770325508; 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=2izjfMr9wFUktZXLnWxTLQ+Uf13Bf1lvXAJZzNDICcs=; b=eMkFVaXTaBjPZnQrj8ZylQ+x1r7TNozsOEscckQzokZshgrH0cUmcmi7LRmraGmeXA cnJIRFAb69JRsbCn7cYGW3d6zRBFVKhX0w36CdmOvc43HjskHkEQw4bE1+a0oH6wkqRb +IQ5j+C1fhqD4Mfym+sOOQeKoNyaSr2mh++Ic7UgSjHIbKplbvFyeVDM0sQWQCZ1RF0S 6eYCsZzm1ntBgTo1adoE0PgldA7jV1Er8uLd+bEH6eDs8FOmxJwI+anf6zJhtxqt9fu1 GRMJfDeA+iJSUpYbB25LU0R9kD2cXyZHUDwTBxVP4toQCorGzUMgxYkNxNNfocDY0fab T7uQ== X-Forwarded-Encrypted: i=1; AJvYcCVxvqBjZdKjXsneW1jJ0rA7XzIcPX2UimPH4bD2nHK7JKwZeg7AGy+6oxHJBXk9IQJAOaDivt4C7pyWyHQ=@vger.kernel.org X-Gm-Message-State: AOJu0Ywo0BJDaWC+xIwxgnx3qVOg1x8viOFLAgypX+sAjEZ1yEIgeSGW o8V+yYpS0iITrWALaVNAlD/1Ca8CLAOxvFFf81pZyv5NF4zdhSzsODgyCqog/oc1NK4= X-Gm-Gg: AZuq6aIPFIx/veAm+NWszGtZv1R+RdnBwfdJldnwIPrM+UCh4buo2f7e0odNJ2p5Rhr nar13eN58aUu/0cM4b1IWVh2/ndY1alJXdf6APpytyZGO6HDILKSXxr7d/Elstp2XiTTdPbSZCG T/9BNpFNN4svTbHVvzhXXVTVRsN0/R1obVUCHyDeFYGsw9FLKkIeaYIB+l3wICnapCLUJPoHxKo i9Kqbs+3t6tfrpXdNNGB9vsIyZpbQ7ONMcNMkiwjpZG4DKDDpCHV2E7QpC2N+tE6RDePQy05yTn 5h4I+TnnhmdN7PEfhMhEKck0ZjO2xl3yheds8hw/KtPuLG1XWAwzHBObdPOT4i4yYslS9Wcefaj RVEypQRjVTUmCDmWmSmYPtId+uUkjVQCpIB+3Oaa2FzFuB5KsDEY+VSri92jeEqMykPFgzOFjSC RinHhfeOswyXvRR499VTgRldgMOVM2weJAf33chFm2Beaq8to5Biy0vWcdou3TP32xUKa4XYdT3 nsL+4cHA9lwqQ== X-Received: by 2002:a05:620a:2845:b0:8a4:e7f6:bf57 with SMTP id af79cd13be357-8c9eb258c5dmr134323385a.5.1769720708025; Thu, 29 Jan 2026 13:05:08 -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-8c71b859eaesm282041685a.46.2026.01.29.13.05.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jan 2026 13:05:07 -0800 (PST) From: Gregory Price To: linux-mm@kvack.org Cc: linux-cxl@vger.kernel.org, nvdimm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@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, willy@infradead.org, jack@suse.cz, terry.bowman@amd.com, john@jagalactic.com Subject: [PATCH 9/9] Documentation/driver-api/cxl: add dax and sysram driver documentation Date: Thu, 29 Jan 2026 16:04:42 -0500 Message-ID: <20260129210442.3951412-10-gourry@gourry.net> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260129210442.3951412-1-gourry@gourry.net> References: <20260129210442.3951412-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" Explain the binding process for sysram and daxdev regions which are explicit about which dax driver to use during region creation. Jonathan Corbet =20 Signed-off-by: Gregory Price --- .../driver-api/cxl/linux/cxl-driver.rst | 43 +++++++++++++++++++ .../driver-api/cxl/linux/dax-driver.rst | 29 +++++++++++++ 2 files changed, 72 insertions(+) diff --git a/Documentation/driver-api/cxl/linux/cxl-driver.rst b/Documentat= ion/driver-api/cxl/linux/cxl-driver.rst index dd6dd17dc536..1f857345e896 100644 --- a/Documentation/driver-api/cxl/linux/cxl-driver.rst +++ b/Documentation/driver-api/cxl/linux/cxl-driver.rst @@ -445,6 +445,49 @@ for more details. :: dax0.0 devtype modalias uevent dax_region driver subsystem =20 +DAX regions are created when a CXL RAM region is bound to one of the +following drivers: + +* :code:`cxl_devdax_region` - Creates a dax_region for device_dax mode. + The resulting DAX device provides direct userspace access via + :code:`/dev/daxN.Y`. + +* :code:`cxl_dax_kmem_region` - Creates a dax_region for kmem mode via a + sysram_region intermediate device. See `Sysram Region`_ below. + +Sysram Region +~~~~~~~~~~~~~ +A `Sysram Region` is an intermediate device between a CXL `Memory Region` +and a `DAX Region` for kmem mode. It is created when a CXL RAM region is +bound to the :code:`cxl_sysram_region` driver. + +The sysram_region device provides an interposition point where users can +configure memory hotplug policy before the underlying dax_region is created +and memory is hotplugged to the system. + +The device hierarchy for kmem mode is:: + + regionX -> sysram_regionX -> dax_regionX -> daxX.Y + +The sysram_region exposes an :code:`online_type` attribute that controls +how memory will be onlined when the dax_kmem driver binds: + +* :code:`invalid` - Not configured (default). Blocks driver binding. +* :code:`offline` - Memory will not be onlined automatically. +* :code:`online` - Memory will be onlined in ZONE_NORMAL. +* :code:`online_movable` - Memory will be onlined in ZONE_MOVABLE. + +Example two-stage binding process:: + + # Bind region to sysram_region driver + echo region0 > /sys/bus/cxl/drivers/cxl_sysram_region/bind + + # Configure memory online type + echo online_movable > /sys/bus/cxl/devices/sysram_region0/online_type + + # Bind sysram_region to dax_kmem_region driver + echo sysram_region0 > /sys/bus/cxl/drivers/cxl_dax_kmem_region/bind + Mailbox Interfaces ------------------ A mailbox command interface for each device is exposed in :: diff --git a/Documentation/driver-api/cxl/linux/dax-driver.rst b/Documentat= ion/driver-api/cxl/linux/dax-driver.rst index 10d953a2167b..2b8e21736292 100644 --- a/Documentation/driver-api/cxl/linux/dax-driver.rst +++ b/Documentation/driver-api/cxl/linux/dax-driver.rst @@ -17,6 +17,35 @@ The DAX subsystem exposes this ability through the `cxl_= dax_region` driver. A `dax_region` provides the translation between a CXL `memory_region` and a `DAX Device`. =20 +CXL DAX Region Drivers +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +CXL provides multiple drivers for creating DAX regions, each suited for +different use cases: + +cxl_devdax_region +----------------- +The :code:`cxl_devdax_region` driver creates a dax_region configured for +device_dax mode. When a CXL RAM region is bound to this driver, the +resulting DAX device provides direct userspace access via :code:`/dev/daxN= .Y`. + +Device hierarchy:: + + regionX -> dax_regionX -> daxX.Y + +This is the simplest path for applications that want to manage CXL memory +directly from userspace. + +cxl_dax_kmem_region +------------------- +For kmem mode, CXL provides a two-stage binding process that allows users +to configure memory hotplug policy before memory is added to the system. + +The :code:`cxl_dax_kmem_region` driver then binds a sysram_region +device and creates a dax_region configured for kmem mode. + +The :code:`online_type` policy will be passed from sysram_region to +the dax kmem driver for use when hotplugging the memory. + DAX Device =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D A `DAX Device` is a file-like interface exposed in :code:`/dev/daxN.Y`. A --=20 2.52.0