[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] xen/dom0less: arm: fix hwdom 1:1 low memory allocation
- To: Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
- Date: Wed, 6 Aug 2025 11:19:03 +0300
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uvpL7XG2GprW38k8gYMIjil0wGmknDKbK+7V1fyoHCk=; b=PQq6mrXqJzDnGA7ikVHqvVBa+xF2r5Bo5LUNYHULFscdn8D2AtdyVkERoxXrusplsulZ/8s68GlEl2g/bj8UGIjOxiSTb2FLft7swOsVffCZkEMene80tYk3A+e3Ln7rlxCU3LuITdN/qmy1m1uQ9RUjAibur5Qzo2Irxw6WbHaDr5Ny3mtg5wqDS5bKhTxPOIlwoh1zmby7DoDxNZ1hl9JlTP2GKIduS8pNw3+Fl6hcW2xE2805KqMkXzxzBd53DNw37NM0k0+KzjNCSsU8sZtf2yvSjqBsAbcXNd0eicyQxziO7Ayje4zU4Q5RiBXNr5FHDFpvDsfPD/qyOxxpNA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ooa35SPJscvg/Mtjpl90nQFoP6mp+AaXpKpBNJgZYW3yQ8ucsYi3BhEpic8tP5Tm7rpZUJi+IjsX3a/98YTVhGtyvdgjKGZdpEU0pmlrFIWHpDAgjSLu6LPzlJ2NriHg7MpUN2UgqbIpMPdfoT3uWKSzwCyBD3r2SkXt/EVAL7OV4MJJ8039y3q7gbq0GOQdBzp+yT+zw1bL8HpHJdlhNhD8UeXVubklLc4HX6q9/kQC3Ugw+Tv19Tje0ZQbzmeyfjOVrC4s/DcLl9+5X50dW2Rg10dRgHWdpFT/ZDVm80h8sdpvbtN/IEhZck7QdyLY4DlEMOGX4cvLMpGAQ6gTOw==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Denis Mukhin <dmukhin@xxxxxxxx>, Jason Andryuk <jason.andryuk@xxxxxxx>
- Delivery-date: Wed, 06 Aug 2025 08:19:12 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Hi Julien,
On 06.08.25 00:07, Julien Grall wrote:
Hi Grygorii,
On 05/08/2025 20:00, Grygorii Strashko wrote:
From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
Call stack for dom0less hwdom case (1:1) memory:
create_domUs
|-construct_domU
|-construct_hwdom()
|-allocate_memory_11()
And allocate_memory_11() uses "dom0_mem" as:
min_low_order =
get_order_from_bytes(min_t(paddr_t, dom0_mem, MB(128)));
In case of dom0less boot the "dom0_mem" is not used and defaulted to 0,
From docs/mics/xen-command-linux.pandoc:
---
### dom0_mem (ARM)
> `= <size>`
Set the amount of memory for the initial domain (dom0). It must be
greater than zero. This parameter is required.
---
If dom0_mem is effectively optional, then shouldn't the doc be updated?
No. I think doc is correct because when regular Dom0(hwdom)(initial domain)
is created code goes through regular Dom0 path and "dom0_mem" is accounted for.
create_dom0()->construct_dom0()
kinfo.unassigned_mem = dom0_mem;
construct_hwdom()->allocate_memory_11()
The issue happens in dom0less mode when hwdom is created and domain's
configuration parameters
are obtained from DT.
which causes min_low_order to get high value > order and so no allocations
happens from low memory.
> > Fix it, by using kinfo->unassigned_mem instead of "dom0_mem" has correct
Right, it should be "which has"
memory size in both cases: regular dom0 boot and dom0less boot.
Fixes: 52cb53f1816a ("xen/arm: dom0less hwdom construction")
Signed-off-by: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
Reviewed-by: Denis Mukhin <dmukhin@xxxxxxxx>
Reviewed-by: Jason Andryuk <jason.andryuk@xxxxxxx>
Acked-by: Julien Grall <jgrall@xxxxxxxxxx>
Cheers,
--
Best regards,
-grygorii
|