On 21.01.2026 18:49, Roger Pau Monné wrote:
> --- a/drivers/xen/balloon.c
> +++ b/drivers/xen/balloon.c
> @@ -724,7 +724,8 @@ static int __init balloon_add_regions(void)
> static int __init balloon_init(void)
> {
> struct task_struct *task;
> - unsigned long current_pages;
> + unsigned long current_pages = 0;
With this, ...
> @@ -732,8 +733,13 @@ static int __init balloon_init(void)
>
> pr_info("Initialising balloon driver\n");
>
> - current_pages = xen_pv_domain() ? min(xen_start_info->nr_pages, max_pfn)
> - : get_num_physpages();
> + if (xen_initial_domain())
> + current_pages = HYPERVISOR_memory_op(XENMEM_current_reservation,
> + &domid);
> + if (current_pages <= 0)
... why <= ? Gives the impression you may mean to cover HYPERVISOR_memory_op()
returning an error, yet that'll require a signed long variable then.
Jan
> + current_pages =
> + xen_pv_domain() ? min(xen_start_info->nr_pages, max_pfn)
> + : get_num_physpages();
>
> if (xen_released_pages >= current_pages) {
> WARN(1, "Released pages underflow current target");
>