From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.198 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796170827; b=OgOY7+Jt/IKHM3/aQ+du5S7ct1/wnwj4xH8hnHMtQafh1UNhJoSGOy4sJop6940A8YtZ 6RjhlVTgpLCMd0Sj1hFOGf82q7Rvp1yHl3YsYuDSYg2bLOCk7r2NUMUqACDFoLNZZLadk sTVcWPIkzkXdXseuDm8PYodoSYSf+K5v43WeKspRQmdoCXih3cytbzBQagcsMhnLfTB6a y27dr8NNitWcE9midCCtBmlwbqJoHNDsm3EWcT7psLRICvETIrBSyQUOtB+gEQ3P89XJt HiousouWnnTfTLfgY3sY+HTX/KAC6HeyB6WOJivURskG3MBneVnPHFmTqN88hkAvk0g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796170827; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:In-Reply-To: Mime-Version:References:X-Mailer:Message-ID:Subject:From:To:Cc: Content-Type; bh=4+30iyl4mLO4DQ+DvO7qM/KmVRjgolAkbYMXOQY9MCU=; b=Tqo358CzZDO55POQRaxXLTw9mMI06/p+EdQxNG3W9eCWNy15JzxVN10yjtHQRqUygpST eWnYGy4f+IADkvUbrR+rhN7GswaUQIxL0OUTKaRctseAJgv4zWslvgld2EuEj5nkh9OIx ewvLvwbkwEd+JsfOYb5/ec2bSxo+l7ePCNIj4VsDh5hvvcExAUAK4HOCf4rX+vloDy2XS 9fpUy/K9woSkfRckTJWXwHrL66dusIUy0YPbB1o4gjlB4ZFxPeIRzDKOqRL7v9ETZ4aNy dO18gS9p+XSOaYhVO1rMXBs1QeYW4TL5m83gqSYgRGzR72J8exwH27QOxIzzbIhjxCA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--suseendranb.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=IWlYyxoO; arc=none smtp.remote-ip=209.85.214.198 Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D351C60A2619 for ; Wed, 2 Dec 2026 00:20:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D351C60A2619 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--suseendranb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=IWlYyxoO Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2f040c6e0ceso113702955ad.1 for ; Tue, 01 Dec 2026 16:20:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796170825; x=1796775625; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=4+30iyl4mLO4DQ+DvO7qM/KmVRjgolAkbYMXOQY9MCU=; b=IWlYyxoOm6lTRj4rEt5b4gGYbHBBtwk6wD4QwsQfW8GO28csIXmblBgpi/Cv1trItg QPskT8IrwOTBpRTcFHrDJ3GhC1VJiVNOdpXzZ4326DksqFZqyP1cB71DJn9DSD9winqt y/DpQ9zrKZ7dfY1YCQBElZcWFTnhFUvG3JjicBkSr8AJJoRYQgxLA731sMcf+WlwXvaS cviQX/u03SC8A+xZDtFR0K4pDFzuLOU42jbUDv+YW9wU7KJ8ROeteXT88islCC/9dNeT BhtDPLgI1fueK8rWt9N1UDLeQtQTGljbPQ4q5MEVHO/ZK6P3KMtpTz13+c/PsL6fX7mj bjQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796170825; x=1796775625; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=4+30iyl4mLO4DQ+DvO7qM/KmVRjgolAkbYMXOQY9MCU=; b=eTTZEpuLQlJZeK2Lugka9aG60mpXvTfoHfhCtoKRvjIpFDx6itFXr4tG9NYLIx5Q8m LRQoqs4i49WM/TcB6le6Qg8VRXKmAbZS21Zk/dEWGXh/J2OenvGSQ3ey1A02aH10ZUZW stQkFxVcvbx6o6UUPsWTnO/pu9KDmvdNP6/gyLZQ5t3YFIdo2cmRuIWvvNyPq6vlZdAD PlyVtMiTAC17o3iUDJbQwfjET2uO1diBcGG5cQT73p5ytfIau+udZXnj/vWcy9dRN5dJ 9Ysn97wcKHUT7xYogRtPivheMjWXLQ94kwUljzLZEW5fvP4X/Ce7K4r3H+tSPadOfrH0 IW6A== X-Forwarded-Encrypted: i=1; AL+hErHHQIyjP0tHqimUbEcFPWPPp7SHt4MW7jk2valw3RK7/V8GMJP47nrTf3Oi71efU+6ivGZ+jLc/X9Aq3iY=@vger.kernel.org X-Gm-Message-State: APuU4Z8L0T1UW8tHo9FtSBcGe9G0ne0mMcr+7Aign//Z7kgvuwB1Na9p t+bhMsYNtVMBjsz22Sy5xeZYqCQI+4DOj+x7vyrLZjZ2vGe1fdMP89AYxfEuA5qhF+WW06j89FK QkMsd7OaM6crJDObuevUW5kSFUw== X-Received: from pgcjt8-n2.prod.google.com ([2002:a05:6a02:8b08:20b0:cdb:4f65:709a]) (user=suseendranb job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:24b:b0:2e9:9bac:2e90 with SMTP id d9443c01a7336-2f03f1aa1d0mr344405095ad.65.1796170824809; Tue, 01 Dec 2026 16:20:24 -0800 (PST) Date: Wed, 2 Dec 2026 00:19:44 +0000 In-Reply-To: <20261202001946.1226273-1-suseendranb@google.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 References: <20261202001946.1226273-1-suseendranb@google.com> X-Mailer: git-send-email 2.56.1.911.g883d8bcb20-goog Message-ID: <20261202001946.1226273-10-suseendranb@google.com> Subject: [RFC PATCH 09/11] nvdimm/ramdax: support binding extmem platform devices From: Suseendran Bhaskaran To: Andrew Morton , Mike Rapoport , Dan Williams , David Hildenbrand Cc: Alexander Graf , Alison Schofield , Andy Lutomirski , Borislav Petkov , Catalin Marinas , Changyuan Lyu , Dave Hansen , Dave Jiang , David Rientjes , Frank van der Linden , "H. Peter Anvin" , Ingo Molnar , Ira Weiny , Jonathan Corbet , "Liam R. Howlett" , Mark Rutland , Michal Hocko , Oscar Salvador , Pasha Tatashin , Peter Zijlstra , Pratyush Yadav , Randy Dunlap , Shuah Khan , Thomas Gleixner , Vishal Verma , Vlastimil Babka , Will Deacon , kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-cxl@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, nvdimm@lists.linux.dev, x86@kernel.org, Suseendran Bhaskaran Content-Type: text/plain; charset="UTF-8" Block-backed fsdax filesystems (such as XFS or ext4 mounted with -o dax) need /dev/pmemX block devices on the libnvdimm bus rather than character drivers/dax devices. Allow CONFIG_RAMDAX when CONFIG_EXTMEM is enabled (including x86_64 configs without X86_PMEM_LEGACY or OF) and match "extmem" platform devices via driver_override alongside OF pmem-region and e820_pmem (also enabling ACPI arm64 hosts), registering each IORESOURCE_MEM range as a labeled NVDIMM DIMM. Signed-off-by: Suseendran Bhaskaran --- Documentation/admin-guide/kernel-parameters.txt | 4 +++- drivers/nvdimm/Kconfig | 14 +++++++------- drivers/nvdimm/ramdax.c | 7 ++++--- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index e75b35d9a66b..d25265bb0095 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -1704,7 +1704,9 @@ Kernel parameters dax_hmem matches "extmem" devices by default, exposing device_dax instances at PUD or PMD alignment (configurable via daxctl, or left idle at boot with - dax_hmem.region_idle=1). + dax_hmem.region_idle=1). Regions can also be bound to the + ramdax driver via driver_override to expose libnvdimm + /dev/pmemX block devices for fsdax filesystems. defaults to and must be at least the sparsemem section size (128 MiB on 4K/16K pages, 512 MiB on 64K pages), and must be a multiple of . diff --git a/drivers/nvdimm/Kconfig b/drivers/nvdimm/Kconfig index 33d83623bfc0..2a094ed1dba0 100644 --- a/drivers/nvdimm/Kconfig +++ b/drivers/nvdimm/Kconfig @@ -99,21 +99,21 @@ config OF_PMEM config RAMDAX tristate "Support persistent memory interfaces on RAM carveouts" - depends on X86_PMEM_LEGACY || OF || COMPILE_TEST + depends on X86_PMEM_LEGACY || OF || EXTMEM || COMPILE_TEST select NUMA_KEEP_MEMINFO if NUMA_MEMBLKS default LIBNVDIMM help Allows creation of DAX devices on RAM carveouts. Memory ranges that are manually specified by the - 'memmap=nn[KMG]!ss[KMG]' kernel command line or defined by dummy - pmem-region device tree nodes would be managed by this driver as DIMM - devices with support for dynamic layout of namespaces. - The driver steals 128K in the end of the memmap range for the + 'memmap=nn[KMG]!ss[KMG]' or 'extmem=' kernel command line or defined + by dummy pmem-region device tree nodes would be managed by this driver + as DIMM devices with support for dynamic layout of namespaces. + The driver steals 128K in the end of the range for the namespace management. This allows supporting up to 509 namespaces (see 'ndctl create-namespace --help'). - The driver should be force bound to e820_pmem or pmem-region platform - devices using 'driver_override' device attribute. + The driver should be force bound to e820_pmem, extmem, or pmem-region + platform devices using 'driver_override' device attribute. Select N if unsure. diff --git a/drivers/nvdimm/ramdax.c b/drivers/nvdimm/ramdax.c index 4efffc3ee5a0..4fb90e8cc018 100644 --- a/drivers/nvdimm/ramdax.c +++ b/drivers/nvdimm/ramdax.c @@ -206,7 +206,8 @@ static int ramdax_probe(struct platform_device *pdev) if (np) { if (!of_match_node(ramdax_of_matches, np)) return -ENODEV; - } else if (strcmp(pdev->name, "e820_pmem") != 0) { + } else if (strcmp(pdev->name, "extmem") != 0 && + strcmp(pdev->name, "e820_pmem") != 0) { return -ENODEV; } @@ -224,7 +225,7 @@ static int ramdax_probe(struct platform_device *pdev) platform_set_drvdata(pdev, nvdimm_bus); - if (np) { + if (np || strcmp(pdev->name, "extmem") == 0) { for (unsigned int i = 0; i < pdev->num_resources; i++) { if (resource_type(&pdev->resource[i]) != IORESOURCE_MEM) continue; @@ -253,6 +254,6 @@ static struct platform_driver ramdax_driver = { module_platform_driver(ramdax_driver); -MODULE_DESCRIPTION("NVDIMM support for e820 type-12 memory and OF pmem-region"); +MODULE_DESCRIPTION("NVDIMM support for e820 type-12, OF pmem-region, and extmem"); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Microsoft Corporation");