From: sashiko-bot@kernel.org
To: "Pengpeng Hou" <hppiscas@163.com>
Cc: nvdimm@lists.linux.dev
Subject: Re: [PATCH] nvdimm: add missing prompt for NVDIMM_KMSAN
Date: Fri, 04 Dec 2026 02:28:29 +0000 [thread overview]
Message-ID: <sashiko-outbox-248972@kernel.org> (raw)
In-Reply-To: <179635015160.74470.1493242467117928008@163.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] nvdimm: undersized altmap reservation in nd_pfn_init() with
NVDIMM_KMSAN
- [Low] nvdimm: NVDIMM_KMSAN prompt lacks depends on NVDIMM_PFN
--
commit 56c04a3394507617001fb5a7be4447d1a5e74f98
Author: Pengpeng Hou <hppiscas@163.com>
nvdimm: add missing prompt for NVDIMM_KMSAN
This commit adds a Kconfig prompt string to NVDIMM_KMSAN so the option can
be selected when KMSAN is enabled.
> diff --git a/drivers/nvdimm/Kconfig b/drivers/nvdimm/Kconfig
> index 44ab929a1ad54..7db8fb321279c 100644
> --- a/drivers/nvdimm/Kconfig
> +++ b/drivers/nvdimm/Kconfig
> @@ -122,7 +122,7 @@ config NVDIMM_KEYS
> depends on (LIBNVDIMM=ENCRYPTED_KEYS) || LIBNVDIMM=m
>
> config NVDIMM_KMSAN
> - bool
> + bool "Support KMSAN debug builds with oversized struct page"
[Severity: Medium]
Does making NVDIMM_KMSAN selectable expose an undersized altmap reservation
in nd_pfn_init() that fails namespace creation with -ENOMEM?
With KMSAN enabled on x86_64, sizeof(struct page) is 80 bytes, so a 128 MiB
section needs 2.5 MiB of vmemmap across two 2 MiB PMDs. For a 128 MiB
namespace with 2 MiB alignment, nd_pfn_init() rounds offset to 4 MiB and
__nvdimm_setup_pfn() sets altmap->free to 1022 pages after the SZ_8K reserve.
When devm_memremap_pages() calls vmemmap_populate_hugepages(), the first
2 MiB PMD in altmap_alloc_block_buf() consumes 510 pages for PMD alignment
plus 512 pages for the PMD itself. That exhausts altmap->free before the
second PMD is allocated, returning -ENOMEM.
Because nd_pfn_init() persists pfn_sb via nvdimm_write_bytes() before
devm_memremap_pages() runs, the undersized dataoff remains on pmem and
subsequent probes keep failing until the superblock is cleared.
> depends on KMSAN
[Severity: Low]
Should NVDIMM_KMSAN also depend on NVDIMM_PFN, like NVDIMM_DAX does? The
only consumer is page_struct_override in drivers/nvdimm/pfn_devs.c, which
drivers/nvdimm/Makefile only builds when CONFIG_NVDIMM_PFN is enabled.
--
Sashiko AI review · https://sashiko.dev/#/patchset/179635015160.74470.1493242467117928008@163.com?part=1
next prev parent reply other threads:[~2026-12-04 2:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 2:09 [PATCH] nvdimm: add missing prompt for NVDIMM_KMSAN Pengpeng Hou
2026-12-04 2:28 ` sashiko-bot [this message]
2026-12-04 2:52 ` Alison Schofield
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=sashiko-outbox-248972@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=hppiscas@163.com \
--cc=nvdimm@lists.linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.