[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XEN][PATCH] xen/dom0less: arm: fix hwdom 1:1 low memory allocation
- To: Jason Andryuk <jason.andryuk@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
- Date: Tue, 5 Aug 2025 21:38:19 +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=iA7n9sbPzi96niBfSOn2Vx2h/mbvxcfxyCsxxpvUEJk=; b=k8Nv9KL41KPs4SXIjWtcehRTs8IGI2nbZj6kJPWq2dhJRUJfPwIraJh0UBTfAxF8tYyvpMFHybGir7Nykro5XGzaI7Gjg3QF7gAWG/62Zwb+ytp168dhrIHoo/miqhnb5ce6YCvxrZ9e+Om/aaAkPWecVGcOD64/UcdM1vu2/0wx5TPDB+klllklLYrvpsFArZBLDx1URS+r/oHkQElbuzEMInl+rkwT7/nGBEx41QtxV2KBFn7rfOg0XwQen0EhMqbqZJT4XUzHlUDBXX0yGR3fP0sXbw5lWDzYpfvcqhlWEDWdI4dWZut7C2dAClnw7/BiTzIdckmdvK4at755cQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DtvAXMesZBJFFvO4IZ6UBqQ3hbgoIO7oJlTEzVJCk8ZlWSiTDoIsDiWisknpOLMf3fEINcq82Z5VUM9oIE+GL4gnOwVrGAry23YgKpJ9wXM69yitBGLXXiypTViEV3pMHSyAwCfWIf11R3cxCoYphqO+yxyyBAXsCytGG1RDO9Vom6kOu4+ksvNmbVDtmheuUiFU+er+wuLATM4br0OC2LrZdeVTY0FywOxbBzq+A/6+0yTHAGW0g6p3EbLm4+OJAg0GfCMxbByvonaZ+LIGalyjk2JKWg/FUOAOwmb17HCexe5s9iB03joWcxtZpZFEGmWr2R27F9obDBUPAAN5Bw==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
- Cc: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, 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: Tue, 05 Aug 2025 18:38:40 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Hi Jason,
On 05.08.25 20:21, Jason Andryuk wrote:
On 2025-08-01 11:54, 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,
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")
I think I introduced this bug with the dom0less hwdom support, and the correct
fixes is:
Fixes: 52cb53f1816a ("xen/arm: dom0less hwdom construction")
Signed-off-by: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
dom0_mem is also mentioned in the comment on line 252. With that changed as
well:
Reviewed-by: Jason Andryuk <jason.andryuk@xxxxxxx>
Will smth like below be ok?
* We first allocate the largest allocation we can as low as we
* can. This then becomes the first bank. This bank must be at least
- * 128MB (or dom0_mem if that is smaller).
+ * 128MB (or memory size requested for domain if that is smaller).
--
Best regards,
-grygorii
|