[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: Grygorii Strashko <grygorii_strashko@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Tue, 5 Aug 2025 14:39:55 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=epam.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • 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=n/GFwuG11RU3d67W2B1HxqwDqa5tYO0dA83nEAnUoNE=; b=Qg6VvYBVFOxF8TO00GPHpaLpTFmfeXIOCvW181l9nTvrGsLD4Shf/ePp6LgyjlYa3Kew0ZuufRrRSPxyipaQx7mWuazF3PEELJvrjx7vDFh0mSKwoT8TRteCwwPs1foVsWozH2g7CbgSLZ0iG98pHDcnaWeBGtX4gvhlMfdRgbCGtvyYVT2kl+l0OWoxl/ykwtBtBDEwMyIaZNV89XrI4GVpXOfOGLT4jkrXh9WMfxgR7cC7dcxF4I394U1GnR3/6fIJYAJWuSfH7EJuH75nLcuOERWuJmpNF5SzywXPn5Lw2151LO6vNAZetOLKLyltf3LdFKx4D+j3b03HJcCTgA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aCm8Oi2Y2+PSklQQtxhVkw5sIBcWhyDpV4W7esTsl9dOIJXRHdaMiYCBRB84pxcKzcVfeLFngE4dgkgN5FFNyyVlIYD1t64+FziiZFyYxilvjectUbvDeohpz08mGZTZvgjgDKH33F6Ek7H+St6u74dYNVE+ya5XtfYnP3PqHpXpCaJRfbBMaZYWqYb1/zUpzJb1kWza9a8c0bto4csWr5Jw2LWVWhifz7PZCIGdHRN/0ZxinrTynnguI0LfrbrYSZ1xw+Z4enHdA/X9wKBCwfFWe9gz+TCUkDKdnyG543S6MnmJK8ma6ZBYJ7I/7tPJGayt9yPb5Gew+PPCyiqNdA==
  • 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:40:08 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2025-08-05 14:38, Grygorii Strashko wrote:
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).

LGTM - Thank you.

-Jason



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.