[PATCH 3/3] virtio_balloon: Set pr_dev.order to new default

From: Yuvraj Sakshith

Date: Thu Feb 26 2026 - 02:03:42 EST


Drivers registering with page reporting used zero
as a way to signal page_reporting_order to be set
as a default value (either passed as a param or
MAX_PAGE_ORDER).

Since page_reporting_order can now have zero as
valid order, default fallback value send by drivers
to page reporting is now -1.

Signed-off-by: Yuvraj Sakshith <yuvraj.sakshith@xxxxxxxxxxxxxxxx>
---
drivers/virtio/virtio_balloon.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 74fe59f5a..3cc3dc28a 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -1044,6 +1044,20 @@ static int virtballoon_probe(struct virtio_device *vdev)
goto out_unregister_oom;
}

+ /*
+ * page_reporting_register() takes the order either
+ * from the driver or the commandline. If neither
+ * are provided, it falls back to MAX_PAGE_ORDER.
+ *
+ * Order given by the driver is required to be in the
+ * range [0, MAX_PAGE_ORDER].
+ *
+ * One way for the driver to not provide any order
+ * is by setting it to -1.
+ */
+
+ vb->pr_dev_info.order = -1;
+
/*
* The default page reporting order is @pageblock_order, which
* corresponds to 512MB in size on ARM64 when 64KB base page
--
2.34.1