[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d6e91265-b045-4257-8a41-6cb77a785924@amd.com>
Date: Wed, 21 Jan 2026 12:21:33 -0500
From: Jason Andryuk <jason.andryuk@....com>
To: Roger Pau Monné <roger.pau@...rix.com>
CC: <xen-devel@...ts.xenproject.org>, <linux-kernel@...r.kernel.org>, James
Dingwall <james@...gwall.me.uk>, Juergen Gross <jgross@...e.com>, Stefano
Stabellini <sstabellini@...nel.org>, Oleksandr Tyshchenko
<oleksandr_tyshchenko@...m.com>
Subject: Re: [PATCH] Partial revert "x86/xen: fix balloon target
initialization for PVH dom0"
On 2026-01-21 06:17, Roger Pau Monné wrote:
> On Tue, Jan 20, 2026 at 03:10:06PM -0500, Jason Andryuk wrote:
>> On 2026-01-20 09:06, Roger Pau Monne wrote:
>>> This partially reverts commit 87af633689ce16ddb166c80f32b120e50b1295de so
>>> the current memory target for PV guests is still fetched from
>>> start_info->nr_pages, which matches exactly what the toolstack sets the
>>> initial memory target to.
>>>
>>> Using get_num_physpages() is possible on PV also, but needs adjusting to
>>> take into account the ISA hole and the PFN at 0 not considered usable
>>> memory depite being populated, and hence would need extra adjustments.
>>> Instead of carrying those extra adjustments switch back to the previous
>>> code. That leaves Linux with a difference in how current memory target is
>>> obtained for HVM vs PV, but that's better than adding extra logic just for
>>> PV.
>>>
>>> Also, for HVM the target is not (and has never been) accurately calculated,
>>> as in that case part of what starts as guest memory is reused by hvmloader
>>> and possibly other firmware to store ACPI tables and similar firmware
>>> information, thus the memory is no longer being reported as RAM in the
>>> memory map.
>>>
>>> Reported-by: James Dingwall <james@...gwall.me.uk>
>>> Signed-off-by: Roger Pau Monné <roger.pau@...rix.com>
>>
>> Reviewed-by: Jason Andryuk <jason.andryuk@....com>
>
> Thanks.
>
> I've been considering what we discussed and as a separate follow up we
> might want to attempt to switch to using `XENMEM_current_reservation`
> for dom0? It might make the accounting in PVH dom0 better, as that's
> what the toolstack uses to set the xenstore target when initializing
> dom0 values.
Yes, I thought that could be a follow on. I've attached what I have
tested, but it is based on a branch pre-dating xen_released_pages.
xenmem_current_reservation with PVH dom0 seemed good without the
xen_released_pages adjustment, but I don't know what that would be for a
PVH dom0.
Regards,
Jason
View attachment "0001-xen-balloon-Initialize-dom0-with-XENMEM_current_rese.patch" of type "text/x-patch" (3965 bytes)
Powered by blists - more mailing lists