From: sashiko-bot@kernel.org
To: "Eric Curtin" <ericcurtin17@gmail.com>
Cc: virtualization@lists.linux.dev, v9fs@lists.linux.dev,
"Michael S. Tsirkin" <mst@redhat.com>,
"Eugenio Perez" <eperezma@redhat.com>
Subject: Re: [RFC PATCH v2 11/13] virtio: Handle boot-time PAGE_SIZE in balloon, blk and 9p transport
Date: Thu, 03 Dec 2026 03:17:45 +0000 [thread overview]
Message-ID: <sashiko-outbox-247083@kernel.org> (raw)
In-Reply-To: <20261202031647.1690622-12-ericcurtin17@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] virtio: build failure due to undeclared PAGE_SIZE_MIN/MAX and
helpers
--
commit 372e817e66d93ec892d37cb53402e748098f17ae
Author: Ryan Roberts <ryan.roberts@arm.com>
virtio: Handle boot-time PAGE_SIZE in balloon, blk and 9p transport
This commit updates virtio_blk, virtio_balloon, and the 9p virtio
transport to avoid assuming PAGE_SIZE and PAGE_SHIFT are compile-time
constants.
> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
> index 2b462005cdb68..c1b26c60ccfb2 100644
> --- a/drivers/block/virtio_blk.c
> +++ b/drivers/block/virtio_blk.c
> @@ -904,7 +904,7 @@ static ssize_t serial_show(struct device *dev,
> int err;
>
> /* sysfs gives us a PAGE_SIZE buffer */
> - BUILD_BUG_ON(PAGE_SIZE < VIRTIO_BLK_ID_BYTES);
> + BUILD_BUG_ON(PAGE_SIZE_MIN < VIRTIO_BLK_ID_BYTES);
>
> buf[VIRTIO_BLK_ID_BYTES] = '\0';
> err = virtblk_get_id(disk, buf);
> diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
> index 8c1b47ec17a29..a2c9429586fb0 100644
> --- a/drivers/virtio/virtio_balloon.c
> +++ b/drivers/virtio/virtio_balloon.c
> @@ -26,6 +26,7 @@
> * page units.
> */
> #define VIRTIO_BALLOON_PAGES_PER_PAGE (unsigned int)(PAGE_SIZE >> VIRTIO_BALLOON_PFN_SHIFT)
> +#define VIRTIO_BALLOON_PAGES_PER_PAGE_MAX (unsigned int)(PAGE_SIZE_MAX >> VIRTIO_BALLOON_PFN_SHIFT)
> #define VIRTIO_BALLOON_ARRAY_PFNS_MAX 256
> /* Maximum number of (4k) pages to deflate on OOM notifications. */
> #define VIRTIO_BALLOON_OOM_NR_PAGES 256
> @@ -139,7 +140,7 @@ static u32 page_to_balloon_pfn(struct page *page)
> {
> unsigned long pfn = page_to_pfn(page);
>
> - BUILD_BUG_ON(PAGE_SHIFT < VIRTIO_BALLOON_PFN_SHIFT);
> + BUILD_BUG_ON(PAGE_SHIFT_MIN < VIRTIO_BALLOON_PFN_SHIFT);
> /* Convert pfn from Linux page size to balloon page size. */
> return pfn * VIRTIO_BALLOON_PAGES_PER_PAGE;
> }
> @@ -231,7 +232,7 @@ static void set_page_pfns(struct virtio_balloon *vb,
> {
> unsigned int i;
>
> - BUILD_BUG_ON(VIRTIO_BALLOON_PAGES_PER_PAGE > VIRTIO_BALLOON_ARRAY_PFNS_MAX);
> + BUILD_BUG_ON(VIRTIO_BALLOON_PAGES_PER_PAGE_MAX > VIRTIO_BALLOON_ARRAY_PFNS_MAX);
>
> /*
> * Set balloon pfns pointing at this page.
[ ... ]
> diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
> index 9fa63e3ebf673..181ed87f703fc 100644
> --- a/net/9p/trans_virtio.c
> +++ b/net/9p/trans_virtio.c
> @@ -795,7 +795,7 @@ static struct virtio_driver p9_virtio_drv = {
> .remove = p9_virtio_remove,
> };
>
> -static struct p9_trans_module p9_virtio_trans = {
> +static DEFINE_GLOBAL_PAGE_SIZE_VAR(struct p9_trans_module, p9_virtio_trans, {
> .name = "virtio",
> .create = p9_virtio_create,
> .close = p9_virtio_close,
> @@ -814,7 +814,7 @@ static struct p9_trans_module p9_virtio_trans = {
> .def = true,
> .supports_vmalloc = false,
> .owner = THIS_MODULE,
> -};
> +});
[Severity: High]
Are the prerequisite definitions for PAGE_SIZE_MIN, PAGE_SIZE_MAX,
PAGE_SHIFT_MIN, and DEFINE_GLOBAL_PAGE_SIZE_VAR() missing from the tree?
None of these macros are defined in the kernel headers, so building
virtio_blk, virtio_balloon, or 9p virtio transport fails with undeclared
identifier and syntax errors.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261202031647.1690622-1-ericcurtin17@gmail.com?part=11
next prev parent reply other threads:[~2026-12-03 3:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 3:16 [RFC PATCH v2 00/13] block/storage: Prepare for boot-time page size selection on arm64 Eric Curtin
2026-12-02 3:16 ` [RFC PATCH v2 11/13] virtio: Handle boot-time PAGE_SIZE in balloon, blk and 9p transport Eric Curtin
2026-12-03 3:17 ` sashiko-bot [this message]
2026-12-03 3:17 ` [RFC PATCH v2 00/13] block/storage: Prepare for boot-time page size selection on arm64 sashiko-bot
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-247083@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=eperezma@redhat.com \
--cc=ericcurtin17@gmail.com \
--cc=mst@redhat.com \
--cc=sashiko-reviews@lists.linux.dev \
--cc=v9fs@lists.linux.dev \
--cc=virtualization@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox