[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 13/15] x86/hyperlaunch: add memory parsing to domain config


  • To: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Wed, 15 Jan 2025 11:55:40 -0500
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=apertussolutions.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=B0PKYXo3UQpMtUn9vNyPhmzpYAnpUNlYmbDApzfUiow=; b=H+oAPymXIeohUBVJrO5XFEl/QfqSC0jxcgBvz6OqmdZo4Zc5IPlSpEufAeZfyQr6Fo1y15L5iABOelBucto1PhDxMp2IKMwxl19c3N0sn9B59sIh55eOtG2me1YdCNCF5mdMSwIHhxB0qIcqzUlflJDIAjGVhyydUuQeiYPFDGzcmwMFLIS6xoOiaYcYYLEVWM7efTdDrasNJlQmImdYYpNiGJ961too5Y10OB+4urJn9q8ylNR3Xr8aUpHhjs5H6jxy+ynhQ+vFKIxoWM+a0N9VWPcSpV3hghdqeFwmcGP8oRbv95m9EBStg2Ox/VIuIY6nVrUlX/etG2lXizjKOQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cU6yn63JYUT2lhDwqiDcDqh06TD+gVaCAGsjiDctryCjXujfM2CH5dN6zl3ESkcUMdNyYpb1kRPOGaF1cHwaAuHj4IqKy91FQZGlwOZYg0ACq15p8CGXNjPx2qCnztm2WlaXe45z8iejQq3uIOC/sCOdu2kF3R/OHzl9Ky6lCYTAzIKH5/VvuGiXBYVjmAL4ykGeTgGyCRmYis7KM6CjWVGuHOph7TGtWpLZZmW4a5T9VTKXvh+x+dMo5/CoAF/G5KpyniyV6pFq2BrzPDCEw/agtBpek9eVpZ0jkZaWJJJ8y7FckjPVdudrg86BcYtFWSC+7AXjRibO5y0jFiEipQ==
  • Cc: <christopher.w.clark@xxxxxxxxx>, <stefano.stabellini@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • Delivery-date: Wed, 15 Jan 2025 16:56:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2024-12-26 11:57, Daniel P. Smith wrote:
Add three properties, memory, mem-min, and mem-max, to the domain node device
tree parsing to define the memory allocation for a domain. All three fields are
expressed in kb and written as a u64 in the device tree entries.

Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>

diff --git a/xen/arch/x86/domain-builder/fdt.c 
b/xen/arch/x86/domain-builder/fdt.c
index db584ba78e92..aff1b8c3235d 100644
--- a/xen/arch/x86/domain-builder/fdt.c
+++ b/xen/arch/x86/domain-builder/fdt.c
@@ -6,6 +6,7 @@
  #include <xen/init.h>
  #include <xen/lib.h>
  #include <xen/libfdt/libfdt.h>
+#include <xen/sizes.h>
#include <asm/bootinfo.h>
  #include <asm/guest.h>
@@ -113,6 +114,39 @@ static int __init process_domain_node(
              else
                  printk("PV\n");
          }
+        else if ( strncmp(prop_name, "memory", name_len) == 0 )
+        {
+            uint64_t kb;
+            if ( fdt_prop_as_u64(prop, &kb) != 0 )
+            {
+                printk("  failed processing memory for domain %s\n", name);
+                return -EINVAL;
+            }
+            bd->mem_pages = PFN_DOWN(kb * SZ_1K);
+            printk("  memory: %ld kb\n", kb);
+        }
+        else if ( strncmp(prop_name, "mem-min", name_len) == 0 )
+        {
+            uint64_t kb;
+            if ( fdt_prop_as_u64(prop, &kb) != 0 )
+            {
+                printk("  failed processing memory for domain %s\n", name);

s/memory/mem-min/

+                return -EINVAL;
+            }
+            bd->min_pages = PFN_DOWN(kb * SZ_1K);
+            printk("  min memory: %ld kb\n", kb);
+        }
+        else if ( strncmp(prop_name, "mem-max", name_len) == 0 )
+        {
+            uint64_t kb;
+            if ( fdt_prop_as_u64(prop, &kb) != 0 )
+            {
+                printk("  failed processing memory for domain %s\n", name);

s/memory/mem-max/

With that,

Reviewed-by: Jason Andryuk <jason.andryuk@xxxxxxx>

+                return -EINVAL;
+            }
+            bd->max_pages = PFN_DOWN(kb * SZ_1K);
+            printk("  max memory: %ld kb\n", kb);
+        }
      }
fdt_for_each_subnode(node, fdt, dom_node)



 


Rackspace

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