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

Re: [PATCH 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: Mon, 25 Nov 2024 19:03:39 -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=cj8GRGoNPlvKgmlv/8K9gQzsnT7rvHE3xiVnJPqYCuM=; b=GwrSV0iFQfF9iEMZ7/ZnOepbnSPlw9d3WsR+MT3EiNgt8P1YqC6Qqz6KhWN+auSNWyzCF1C3yxD4FdgSvzG2n8hL+D1c3iSumNZXjc8D+gXd8f/Vj0aVjH9guRAjZU04lt70Nraeo5EMJwueTdxKhip6VTrCixbhH2QzeG4uhuF1Y2ryIouROD8HuIpfRM6d78rCsnWoePGJjASeo9m1CNuthCsyLg8r8IV79Ht0JMRhIPcRpo5HLwc6WcMRtN3ej5Vz2Zh2kUdFsk6uckoTTfczALOB7LXzp3CfXJsRsvHcOTtLcOVqnA14Ucbj3Y0NSKOZX4E2cawlma3fdHMQ5w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fRWoFvxg8dk8WeMN0SoZjKwM7FUHjYjob++XpdrOCP0rlHpci8DSAnHSD0lY5jPZSmdUVj28c7fS0n2YvYZrAN1r+Bw4fCHcDkquGNwUQMhLn4nuozTTn0RHCrF3H0LhQqBE/0wyEEI+SBkGbZAL3JqJ+EQAWZ43JZjos8GxYKYehp1lHrCM80VRqmvNAoP4QMu7L9tHqoem0JWUIAzDokT3ekNrMmNq4vx5jcOn1udGDQmYDFizJesrfsP1cc8CWZI3+6EAE5xA8gN+7480sLOoqodN58L4778M0lDtvujC+gBV70JFMaiK1/VY20G0V6v3bn91/g6bVnygu8TYZg==
  • Cc: <christopher.w.clark@xxxxxxxxx>, <stefano.stabellini@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 26 Nov 2024 01:46:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2024-11-23 13:20, 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/dom0_build.c b/xen/arch/x86/dom0_build.c
index c231191faec7..1c3b7ff0e658 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -609,6 +609,14 @@ int __init construct_dom0(struct boot_domain *bd)
process_pending_softirqs(); + /* If param dom0_size was not set and HL config provided memory size */
+    if ( !get_memsize(&dom0_size, LONG_MAX) && bd->mem_pages )
+        dom0_size.nr_pages = bd->mem_pages;
+    if ( !get_memsize(&dom0_min_size, LONG_MAX) && bd->min_pages )
+        dom0_size.nr_pages = bd->min_pages;
+    if ( !get_memsize(&dom0_max_size, LONG_MAX) && bd->max_pages )
+        dom0_size.nr_pages = bd->max_pages;
+

This placement seems a little random. Can this move into dom0_compute_nr_pages()?

      if ( is_hvm_domain(d) )
          rc = dom0_construct_pvh(bd);
      else if ( is_pv_domain(d) )



 


Rackspace

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