* [RFC PATCH v2 00/13] block/storage: Prepare for boot-time page size selection on arm64
@ 2026-12-02 3:16 Eric Curtin
2026-12-02 3:16 ` [RFC PATCH v2 05/13] zram: Remove PAGE_SIZE use in preprocessor conditionals Eric Curtin
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Eric Curtin @ 2026-12-02 3:16 UTC (permalink / raw)
To: linux-kernel
Cc: Eric Curtin, Ryan Roberts, cgroups, dm-devel, linux-arm-kernel,
linux-block, linux-fsdevel, linux-ide, linux-mm, linux-mtd,
nvdimm, v9fs, virtualization
From: Eric Curtin <eric.curtin@docker.com>
This series is part of the boot-time page size selection work for arm64,
posted as RFC [1]. With CONFIG_ARM64_BOOT_TIME_PAGE_SIZE=y, PAGE_SIZE,
PAGE_SHIFT and PAGE_MASK are variables chosen at boot with arm64.pagesize=,
so code that needs a compile-time constant (array sizes, struct layouts,
static initialisers, BUILD_BUG_ON(), case labels, #if) has to use the new
PAGE_SIZE_MIN/PAGE_SIZE_MAX limits or a run-time value instead. For fixed
page sizes both limits equal PAGE_SIZE, so behaviour should not change.
The patches here convert block, MD, NVMe, SCSI, ATA, MTD and MMC code. They apply on top of the core series
[1], whose patch 1 adds PAGE_SIZE_MIN/MAX, and are otherwise independent
of each other. Patches authored by Ryan Roberts come from his v1 [2],
updated for v7.4-rc5. The full tree is at:
https://github.com/ericcurtin/linux/tree/boot-time-page-size-v2
Testing: allmodconfig with the option enabled builds cleanly on arm64
with all of these applied, and the defconfig kernel boots to userspace
with 4K, 16K and 64K pages under QEMU/KVM (details in [1]). The code in
this series is not otherwise exercised on hardware.
Tool use: these conversions were prepared with an LLM coding assistant
(opencode with Claude Sonnet), driven by build errors and followed by an
automated review pass. I have not hand-audited every patch, so please
review with that in mind and tell me where you would prefer a different
approach for your subsystem.
[1] https://lore.kernel.org/all/20261201015240.1017259-1-ericcurtin17@gmail.com/
[2] https://lore.kernel.org/all/20241014105514.3206191-1-ryan.roberts@arm.com/
Eric Curtin (8):
scsi: core: Add dma_boundary_page for page-size DMA boundaries
mtd: mtdswap: Initialise mtdswap_ops with a page size variable
mmc: mmc_test: Allocate the scratch buffer with the test buffer
md: Remove compile-time PAGE_SIZE use in md, dm and bcache
zram: Remove PAGE_SIZE use in preprocessor conditionals
xen/blkback: Size indirect_pages for the largest page size
null_blk: Size the nullb_page bitmap for PAGE_SIZE_MAX
drbd: Use PAGE_SHIFT_MIN in preprocessor checks
Ryan Roberts (5):
nvme: Check the DSM range buffer against PAGE_SIZE_MIN
dm: Initialise swap_bios from the runtime PAGE_SIZE
virtio: Handle boot-time PAGE_SIZE in balloon, blk and 9p transport
ata: sata_sil24: Use flexible arrays for the command block SGEs
mm: Use PAGE_SIZE_MIN/MAX where a compile-time constant is required
^ permalink raw reply [flat|nested] 6+ messages in thread
* [RFC PATCH v2 05/13] zram: Remove PAGE_SIZE use in preprocessor conditionals
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 ` Eric Curtin
2026-12-02 3:16 ` [RFC PATCH v2 06/13] xen/blkback: Size indirect_pages for the largest page size Eric Curtin
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Eric Curtin @ 2026-12-02 3:16 UTC (permalink / raw)
To: linux-kernel
Cc: Eric Curtin, Minchan Kim, Sergey Senozhatsky, Jens Axboe,
linux-block
From: Eric Curtin <eric.curtin@docker.com>
With arm64 boot-time page size selection PAGE_SIZE and PAGE_SHIFT are
not compile-time constants, so they cannot be used in #if or to size
arrays.
Turn the "#if PAGE_SIZE != 4096" is_partial_io() and the
ZRAM_PARTIAL_IO define into ordinary C conditions on PAGE_SIZE, and set
max_write_zeroes_sectors with a conditional expression instead of
#if. Size the pp_buckets array with a new NUM_PP_BUCKETS_MAX based on
PAGE_SIZE_MAX, and base ZRAM_FLAG_SHIFT on PAGE_SHIFT_MAX so that the
flag bits do not overlap the size bits for any page size.
The compiler still folds the conditions when the page size is fixed, so
there is no functional change for compile-time page sizes.
Signed-off-by: Eric Curtin <eric.curtin@docker.com>
---
drivers/block/zram/zram_drv.c | 20 ++++++--------------
drivers/block/zram/zram_drv.h | 2 +-
2 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index ab064c84b092..11a2341a0764 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -209,18 +209,10 @@ static bool zram_can_store_page(struct zram *zram)
return !zram->limit_pages || alloced_pages <= zram->limit_pages;
}
-#if PAGE_SIZE != 4096
static inline bool is_partial_io(struct bio_vec *bvec)
{
- return bvec->bv_len != PAGE_SIZE;
+ return PAGE_SIZE != 4096 && bvec->bv_len != PAGE_SIZE;
}
-#define ZRAM_PARTIAL_IO 1
-#else
-static inline bool is_partial_io(struct bio_vec *bvec)
-{
- return false;
-}
-#endif
#if defined CONFIG_ZRAM_WRITEBACK || defined CONFIG_ZRAM_MULTI_COMP
struct zram_pp_slot {
@@ -234,9 +226,10 @@ struct zram_pp_slot {
*/
#define PP_BUCKET_SIZE_RANGE 64
#define NUM_PP_BUCKETS ((PAGE_SIZE / PP_BUCKET_SIZE_RANGE) + 1)
+#define NUM_PP_BUCKETS_MAX ((PAGE_SIZE_MAX / PP_BUCKET_SIZE_RANGE) + 1)
struct zram_pp_ctl {
- struct list_head pp_buckets[NUM_PP_BUCKETS];
+ struct list_head pp_buckets[NUM_PP_BUCKETS_MAX];
};
static struct zram_pp_ctl *init_pp_ctl(void)
@@ -1519,7 +1512,7 @@ static int read_from_bdev(struct zram *zram, struct page *page,
{
atomic64_inc(&zram->stats.bd_reads);
if (!parent) {
- if (WARN_ON_ONCE(!IS_ENABLED(ZRAM_PARTIAL_IO)))
+ if (WARN_ON_ONCE(PAGE_SIZE == 4096))
return -EIO;
return read_from_bdev_sync(zram, page, index, blk_idx);
}
@@ -3078,9 +3071,8 @@ static int zram_add(void)
* aligned to physical block size. So we can't ensure that all
* discarded logical blocks are zeroed.
*/
-#if ZRAM_LOGICAL_BLOCK_SIZE == PAGE_SIZE
- .max_write_zeroes_sectors = UINT_MAX,
-#endif
+ .max_write_zeroes_sectors =
+ ZRAM_LOGICAL_BLOCK_SIZE == PAGE_SIZE ? UINT_MAX : 0,
.features = BLK_FEAT_STABLE_WRITES |
BLK_FEAT_SYNCHRONOUS,
};
diff --git a/drivers/block/zram/zram_drv.h b/drivers/block/zram/zram_drv.h
index 7a55d751417e..b92d81fafd3f 100644
--- a/drivers/block/zram/zram_drv.h
+++ b/drivers/block/zram/zram_drv.h
@@ -37,7 +37,7 @@
*
* We use BUILD_BUG_ON() to make sure that zram pageflags don't overflow.
*/
-#define ZRAM_FLAG_SHIFT (PAGE_SHIFT + 1)
+#define ZRAM_FLAG_SHIFT (PAGE_SHIFT_MAX + 1)
/* Only 2 bits are allowed for comp priority index */
#define ZRAM_COMP_PRIORITY_MASK 0x3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [RFC PATCH v2 06/13] xen/blkback: Size indirect_pages for the largest page size
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 05/13] zram: Remove PAGE_SIZE use in preprocessor conditionals Eric Curtin
@ 2026-12-02 3:16 ` Eric Curtin
2026-12-02 3:16 ` [RFC PATCH v2 07/13] null_blk: Size the nullb_page bitmap for PAGE_SIZE_MAX Eric Curtin
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Eric Curtin @ 2026-12-02 3:16 UTC (permalink / raw)
To: linux-kernel
Cc: Eric Curtin, Roger Pau Monné, Jens Axboe, xen-devel,
linux-block
From: Eric Curtin <eric.curtin@docker.com>
With arm64 boot-time page size selection PAGE_SIZE is not a
compile-time constant. MAX_INDIRECT_PAGES depends on the number of
segments that fit in an indirect frame, which depends on the guest page
size, so it cannot size the indirect_pages array in struct pending_req.
Add SEGS_PER_INDIRECT_FRAME_MIN, computed with the largest page size
(the fewest segments per frame), and MAX_INDIRECT_PAGES_MAX derived from
it, and use that for the array. Check the maximum against
BLKIF_MAX_INDIRECT_PAGES_PER_REQUEST in xen_blkif_alloc().
No functional change for compile-time page sizes.
Signed-off-by: Eric Curtin <eric.curtin@docker.com>
---
drivers/block/xen-blkback/common.h | 7 ++++++-
drivers/block/xen-blkback/xenbus.c | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback/common.h
index f5890b3f1df9..14c244aa8807 100644
--- a/drivers/block/xen-blkback/common.h
+++ b/drivers/block/xen-blkback/common.h
@@ -65,6 +65,11 @@ extern unsigned int xenblk_max_queues;
#define MAX_INDIRECT_PAGES \
((MAX_INDIRECT_SEGMENTS + SEGS_PER_INDIRECT_FRAME - 1)/SEGS_PER_INDIRECT_FRAME)
+#define SEGS_PER_INDIRECT_FRAME_MIN \
+ (XEN_PAGES_PER_INDIRECT_FRAME / XEN_PFN_PER_PAGE_MAX)
+#define MAX_INDIRECT_PAGES_MAX \
+ ((MAX_INDIRECT_SEGMENTS + SEGS_PER_INDIRECT_FRAME_MIN - 1) / \
+ SEGS_PER_INDIRECT_FRAME_MIN)
#define INDIRECT_PAGES(_segs) DIV_ROUND_UP(_segs, XEN_PAGES_PER_INDIRECT_FRAME)
/* Not a real protocol. Used to generate ring structs which contain
@@ -353,7 +358,7 @@ struct pending_req {
struct list_head free_list;
struct grant_page *segments[MAX_INDIRECT_SEGMENTS];
/* Indirect descriptors */
- struct grant_page *indirect_pages[MAX_INDIRECT_PAGES];
+ struct grant_page *indirect_pages[MAX_INDIRECT_PAGES_MAX];
struct seg_buf seg[MAX_INDIRECT_SEGMENTS];
struct bio *biolist[MAX_INDIRECT_SEGMENTS];
struct gnttab_unmap_grant_ref unmap[MAX_INDIRECT_SEGMENTS];
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
index 8d0ff8fcac22..d2d51fe6081d 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -174,7 +174,7 @@ static struct xen_blkif *xen_blkif_alloc(domid_t domid)
{
struct xen_blkif *blkif;
- BUILD_BUG_ON(MAX_INDIRECT_PAGES > BLKIF_MAX_INDIRECT_PAGES_PER_REQUEST);
+ BUILD_BUG_ON(MAX_INDIRECT_PAGES_MAX > BLKIF_MAX_INDIRECT_PAGES_PER_REQUEST);
blkif = kmem_cache_zalloc(xen_blkif_cachep, GFP_KERNEL);
if (!blkif)
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [RFC PATCH v2 07/13] null_blk: Size the nullb_page bitmap for PAGE_SIZE_MAX
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 05/13] zram: Remove PAGE_SIZE use in preprocessor conditionals Eric Curtin
2026-12-02 3:16 ` [RFC PATCH v2 06/13] xen/blkback: Size indirect_pages for the largest page size Eric Curtin
@ 2026-12-02 3:16 ` Eric Curtin
2026-12-02 3:16 ` [RFC PATCH v2 08/13] drbd: Use PAGE_SHIFT_MIN in preprocessor checks 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
4 siblings, 0 replies; 6+ messages in thread
From: Eric Curtin @ 2026-12-02 3:16 UTC (permalink / raw)
To: linux-kernel; +Cc: Eric Curtin, Jens Axboe, linux-block
From: Eric Curtin <eric.curtin@docker.com>
With arm64 boot-time page size selection PAGE_SIZE is not a
compile-time constant, but struct nullb_page embeds a bitmap with one
bit per sector of a page plus two flag bits.
Add MAP_SZ_MAX, based on PAGE_SIZE_MAX, and use it to declare the
bitmap. The runtime logic (NULLB_PAGE_LOCK and NULLB_PAGE_FREE) keeps
using MAP_SZ, derived from the actual page size, so the extra bitmap
space is simply unused on smaller pages.
No functional change for compile-time page sizes.
Signed-off-by: Eric Curtin <eric.curtin@docker.com>
---
drivers/block/null_blk/main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
index ec0d7ba4d938..f5a02a861daf 100644
--- a/drivers/block/null_blk/main.c
+++ b/drivers/block/null_blk/main.c
@@ -46,6 +46,7 @@ enum nullb_device_flags {
};
#define MAP_SZ ((PAGE_SIZE >> SECTOR_SHIFT) + 2)
+#define MAP_SZ_MAX ((PAGE_SIZE_MAX >> SECTOR_SHIFT) + 2)
/*
* nullb_page is a page in memory for nullb devices.
*
@@ -60,7 +61,7 @@ enum nullb_device_flags {
*/
struct nullb_page {
struct page *page;
- DECLARE_BITMAP(bitmap, MAP_SZ);
+ DECLARE_BITMAP(bitmap, MAP_SZ_MAX);
};
#define NULLB_PAGE_LOCK (MAP_SZ - 1)
#define NULLB_PAGE_FREE (MAP_SZ - 2)
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [RFC PATCH v2 08/13] drbd: Use PAGE_SHIFT_MIN in preprocessor checks
2026-12-02 3:16 [RFC PATCH v2 00/13] block/storage: Prepare for boot-time page size selection on arm64 Eric Curtin
` (2 preceding siblings ...)
2026-12-02 3:16 ` [RFC PATCH v2 07/13] null_blk: Size the nullb_page bitmap for PAGE_SIZE_MAX Eric Curtin
@ 2026-12-02 3:16 ` 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
4 siblings, 0 replies; 6+ messages in thread
From: Eric Curtin @ 2026-12-02 3:16 UTC (permalink / raw)
To: linux-kernel
Cc: Eric Curtin, Philipp Reisner, Lars Ellenberg,
Christoph Böhmwalder, Jens Axboe, drbd-dev, linux-block
From: Eric Curtin <eric.curtin@docker.com>
With arm64 boot-time page size selection PAGE_SHIFT is not a
compile-time constant and cannot be evaluated by the preprocessor.
Check the AL extent/bitmap block relationship in drbd_actlog.c and the
DRBD_MAX_BIO_SIZE limit in drbd_int.h against PAGE_SHIFT_MIN, so that
the build fails if the assumption could be violated by any supported
page size.
Drop the "ambiguous BITS_PER_PAGE" #error from drbd_bitmap.c. It
compared a macro against an expression of PAGE_SHIFT in #if, which can
no longer be evaluated, and it only guarded against a conflicting
definition of BITS_PER_PAGE in other headers.
Signed-off-by: Eric Curtin <eric.curtin@docker.com>
---
drivers/block/drbd/drbd_actlog.c | 2 +-
drivers/block/drbd/drbd_bitmap.c | 4 ----
drivers/block/drbd/drbd_int.h | 2 +-
3 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/block/drbd/drbd_actlog.c b/drivers/block/drbd/drbd_actlog.c
index b3dbf6c76e98..086b8efce9ae 100644
--- a/drivers/block/drbd/drbd_actlog.c
+++ b/drivers/block/drbd/drbd_actlog.c
@@ -277,7 +277,7 @@ bool drbd_al_begin_io_prepare(struct drbd_device *device, struct drbd_interval *
return need_transaction;
}
-#if (PAGE_SHIFT + 3) < (AL_EXTENT_SHIFT - BM_BLOCK_SHIFT)
+#if (PAGE_SHIFT_MIN + 3) < (AL_EXTENT_SHIFT - BM_BLOCK_SHIFT)
/* Currently BM_BLOCK_SHIFT, BM_EXT_SHIFT and AL_EXTENT_SHIFT
* are still coupled, or assume too much about their relation.
* Code below will not work if this is violated.
diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c
index 65ea6ec66bfd..7d715dcaf982 100644
--- a/drivers/block/drbd/drbd_bitmap.c
+++ b/drivers/block/drbd/drbd_bitmap.c
@@ -473,10 +473,6 @@ void drbd_bm_cleanup(struct drbd_device *device)
#ifndef BITS_PER_PAGE
#define BITS_PER_PAGE (1UL << (PAGE_SHIFT + 3))
#define BITS_PER_PAGE_MASK (BITS_PER_PAGE - 1)
-#else
-# if BITS_PER_PAGE != (1UL << (PAGE_SHIFT + 3))
-# error "ambiguous BITS_PER_PAGE"
-# endif
#endif
#define BITS_PER_LONG_MASK (BITS_PER_LONG - 1)
static int bm_clear_surplus(struct drbd_bitmap *b)
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index 48b45c3142f7..2db7f596a68d 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -1261,7 +1261,7 @@ struct bm_extent {
* A followup commit may allow even bigger BIO sizes,
* once we thought that through. */
#define DRBD_MAX_BIO_SIZE (1U << 20)
-#if DRBD_MAX_BIO_SIZE > (BIO_MAX_VECS << PAGE_SHIFT)
+#if DRBD_MAX_BIO_SIZE > (BIO_MAX_VECS << PAGE_SHIFT_MIN)
#error Architecture not supported: DRBD_MAX_BIO_SIZE > BIO_MAX_SIZE
#endif
#define DRBD_MAX_BIO_SIZE_SAFE (1U << 12) /* Works always = 4k */
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [RFC PATCH v2 11/13] virtio: Handle boot-time PAGE_SIZE in balloon, blk and 9p transport
2026-12-02 3:16 [RFC PATCH v2 00/13] block/storage: Prepare for boot-time page size selection on arm64 Eric Curtin
` (3 preceding siblings ...)
2026-12-02 3:16 ` [RFC PATCH v2 08/13] drbd: Use PAGE_SHIFT_MIN in preprocessor checks Eric Curtin
@ 2026-12-02 3:16 ` Eric Curtin
4 siblings, 0 replies; 6+ messages in thread
From: Eric Curtin @ 2026-12-02 3:16 UTC (permalink / raw)
To: linux-kernel
Cc: Ryan Roberts, Michael S. Tsirkin, Jason Wang, Eugenio Pérez,
Xuan Zhuo, Paolo Bonzini, Stefan Hajnoczi, Jens Axboe,
David Hildenbrand, Eric Van Hensbergen, Latchesar Ionkov,
Dominique Martinet, Christian Schoenebeck, virtualization,
linux-block, v9fs
From: Ryan Roberts <ryan.roberts@arm.com>
With boot-time page size selection PAGE_SIZE is not a compile-time
constant.
- virtio_blk: check the serial_show() buffer size against PAGE_SIZE_MIN.
- virtio_balloon: check PAGE_SHIFT_MIN in page_to_balloon_pfn(), and
compare the new VIRTIO_BALLOON_PAGES_PER_PAGE_MAX, based on
PAGE_SIZE_MAX, with VIRTIO_BALLOON_ARRAY_PFNS_MAX in set_page_pfns().
Select the free page reporting order of 5 with a run-time
PAGE_SIZE == SZ_64K test on arm64, instead of
CONFIG_ARM64_64K_PAGES.
- 9p: define p9_virtio_trans with DEFINE_GLOBAL_PAGE_SIZE_VAR() so that
it is initialised at boot.
No functional change for compile-time page sizes.
Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
Signed-off-by: Eric Curtin <eric.curtin@docker.com>
---
drivers/block/virtio_blk.c | 2 +-
drivers/virtio/virtio_balloon.c | 10 ++++++----
net/9p/trans_virtio.c | 4 ++--
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 2b462005cdb6..c1b26c60ccfb 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 8c1b47ec17a2..a2c9429586fb 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.
@@ -1040,8 +1041,9 @@ static int virtballoon_probe(struct virtio_device *vdev)
* host's base page size. However, it needs more work to report
* that value. The hard-coded order would be fine currently.
*/
-#if defined(CONFIG_ARM64) && defined(CONFIG_ARM64_64K_PAGES)
- vb->pr_dev_info.order = 5;
+#if defined(CONFIG_ARM64)
+ if (PAGE_SIZE == SZ_64K)
+ vb->pr_dev_info.order = 5;
#endif
vb->pr_dev_info.capacity = capacity;
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index 9fa63e3ebf67..181ed87f703f 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,
-};
+});
/* The standard init function */
static int __init p9_virtio_init(void)
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-12-02 3:17 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 05/13] zram: Remove PAGE_SIZE use in preprocessor conditionals Eric Curtin
2026-12-02 3:16 ` [RFC PATCH v2 06/13] xen/blkback: Size indirect_pages for the largest page size Eric Curtin
2026-12-02 3:16 ` [RFC PATCH v2 07/13] null_blk: Size the nullb_page bitmap for PAGE_SIZE_MAX Eric Curtin
2026-12-02 3:16 ` [RFC PATCH v2 08/13] drbd: Use PAGE_SHIFT_MIN in preprocessor checks 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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox