[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[XEN][PATCH] xen/dom0less: arm: fix hwdom 1:1 low memory allocation
- To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
- Date: Fri, 1 Aug 2025 15:54:30 +0000
- Accept-language: en-US
- 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=1txnkNA9XkWs7+KkGsJh9zAHr2VJctTrXf7Kp842qRk=; b=q5tKUnDHZ7gwNirCIum49D4aVAhbGNPu6MOwq3ffjXji0q7kOi8JggG0EbYoluAwVTaPfltS88iaLEpNyLB6uy0UUUdANH75e8ukCuTX9W7l0lfvSYMtzXiBaVCVwZ0K3uVNtCD+g6LkU+H4BHgqke75JyaikeJDQAWCNsHbzImHB2eikyCqKMWIrwvgCMEQURmxkvyofnfQtDOLLHv/xzmc23SC9HUlTOaQBq50nmvz8Fmm65Ftf2+TCJ6qA+C0AiSu+3n1Q+u/AiWdGBFMgWNOpbtMbGi1P52HrNZ882rpw7E/QbqPZR9WIzyUsrp/zQSf9UDwqFFYLDtE5iaWdQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rLQwBtsgYIOz8TZcIqDyZwEoct7NIFkMebD+w8l3kFJEcK9slvj2CmesjIA2gap718DBfFW5bS7RdvDCdc+AhHzD1E5ggbDpgUbwPglFBdgkYerp9klGrvP9/nzkVIucj6XiLtnV51zDqLdZNoCYpJH6A0J/xzSkD10FaowMAUUtUBjK7SXxwmxJ9UqwynPB9wxkau0TxK3Ep1dA8tQZT6ZFkICf5uh1Bap/1UePVg9/p3uWROeJh6cHah+EyjNREPbjuMd6/631tJaTJ39IvVfkA7ZBB64XrVy+ai1VvLGIrhys4QhN5zln5+vvXPh6jH/opzCO/zYxaf2wPJzILA==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
- Cc: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Grygorii Strashko <grygorii_strashko@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Delivery-date: Fri, 01 Aug 2025 15:54:53 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHcAvyR/OgiYXqFFUajtgPjc1Xchg==
- Thread-topic: [XEN][PATCH] xen/dom0less: arm: fix hwdom 1:1 low memory allocation
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,
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
memory size in both cases: regular dom0 boot and dom0less boot.
Fixes: 43afe6f030244 ("xen/common: dom0less: introduce common dom0less-build.c")
Signed-off-by: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
---
xen/arch/arm/domain_build.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 801a09071a50..0a555d1ae0e5 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -278,7 +278,7 @@ static void __init allocate_memory_11(struct domain *d,
struct kernel_info *kinfo)
{
const unsigned int min_low_order =
- get_order_from_bytes(min_t(paddr_t, dom0_mem, MB(128)));
+ get_order_from_bytes(min_t(paddr_t, kinfo->unassigned_mem, MB(128)));
const unsigned int min_order = get_order_from_bytes(MB(4));
struct membanks *mem = kernel_info_get_mem(kinfo);
struct page_info *pg;
--
2.34.1
|