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

Re: [PATCH 07/15] x86/hyperlaunch: initial support for hyperlaunch device tree


  • To: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Mon, 25 Nov 2024 15:11:18 -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=cOkL4Ftoq3m9YfETrTq4SDo/nceuuCAqJDazHjut+Sw=; b=KwjAXA6v6GTRaWxgwfYRqpatplPznHa4x0RumnAzftFyGAwlXZ2Ev8pxgV8aBliK/woKi9mwK/ibhknNYhLe8H5y0bbq9Hxg4x/1/yYhWsOiGB0nEtRAsJ9m6JrirWora+TSwWZN/QgTD37JiJVoSd0oMb/ps+lKqf+wi+dV7LdfXKvuiQYjULbrH8dKyYoGb8v/xj4/sddcHxxdKtfn0OCXPOr28t5MVV7KJOi3yCnsRcrne+qcYccJxm6pbi43e2MZ7stFuT07JKHvUCVuIP3CYH8n81P4QBmfQ7ZIqGNdFGhYHUdrkYA3SQbs3c0TuekOhvKjX6Ogw+DvqrZhXQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xB+U9jxqvCZN3SfHS8hUxQ0t9XQkDh0T/hu+UYlmhwaXrMPnBZX68TNp+eoWoH/LPqiEpync8X/v4/Etwrze3XeAQ5xM/PjP4xkRjSqnUKUTjjNmI5Z2YEHxPwaguBFYy5sbyroImIriSZY7JAGnT1FIX7Kg7s3/8KOfYOHm14PD2zsYJgQfqwnZPYgLytQYZiCKku5GuPeH26oe13fDNc7PdWNZ1mei12guVajFNAHqVuexlX2E5ZGtNW8wdZ8lRQEYyO4oqytlLNr9Z7ULbFn+5rIcwJP0thPUgBXutaa4mj6qI5EVIranR0vTope7OjCOKLK7msorACfemlb4OQ==
  • 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: Mon, 25 Nov 2024 20:12:03 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2024-11-23 13:20, Daniel P. Smith wrote:
Add the ability to detect both a formal hyperlaunch device tree or a dom0less
device tree. If the hyperlaunch device tree is found, then count the number of
domain entries, reporting if more than one is found.

Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
---
  xen/arch/x86/domain_builder/core.c  | 14 +++++++
  xen/arch/x86/domain_builder/fdt.c   | 64 ++++++++++++++++++++++++++++-
  xen/arch/x86/domain_builder/fdt.h   |  5 +++
  xen/arch/x86/include/asm/bootinfo.h |  1 +
  4 files changed, 83 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/domain_builder/core.c 
b/xen/arch/x86/domain_builder/core.c
index 211359895d84..a80f3711c306 100644
--- a/xen/arch/x86/domain_builder/core.c
+++ b/xen/arch/x86/domain_builder/core.c
@@ -40,7 +40,21 @@ void __init builder_init(struct boot_info *bi)
                     ret);
              bi->hyperlaunch_enabled = false;
          }
+    }
+
+    if ( bi->hyperlaunch_enabled )
+    {
+        int ret;
+
+        printk(XENLOG_INFO "Hyperlauch configuration:\n");

Hyperlaunch

+        if ( (ret = walk_hyperlaunch_fdt(bi)) < 0 )
+        {
+            printk(XENLOG_INFO "  walk of device tree failed (%d)\n", ret);
+            bi->hyperlaunch_enabled = false;
+            return;
+        }
+ printk(XENLOG_INFO " Number of domains: %d\n", bi->nr_domains);
      }
  }
diff --git a/xen/arch/x86/domain_builder/fdt.c b/xen/arch/x86/domain_builder/fdt.c
index 3f9dda8c34c3..ff1ba58b6907 100644
--- a/xen/arch/x86/domain_builder/fdt.c
+++ b/xen/arch/x86/domain_builder/fdt.c

+int __init walk_hyperlaunch_fdt(struct boot_info *bi)
+{
+    int ret = 0, hv_node, node;
+    void *fdt = bootstrap_map_bm(&bi->mods[HYPERLAUNCH_MODULE_IDX]);
+
+    if ( unlikely(!fdt) )
+        return -EINVAL;
+
+    hv_node = find_hyperlaunch_node(fdt);
+    if ( hv_node < 0 )
+    {
+        ret = hv_node;
+        goto err_out;
+    }
+
+    fdt_for_each_subnode(node, fdt, hv_node)
+    {
+        ret = fdt_node_check_compatible(fdt, node, "xen,domain");
+        if ( ret == 0 )
+            bi->nr_domains++;
+    }
+
+    /* Until multi-domain construction is added, throw an error */
+    if ( !bi->nr_domains || bi->nr_domains > 1 )
+        printk(XENLOG_ERR "Hyperlaunch only supports dom0 construction\n");

You continue execution - is that intended? It'll take the next module as the kernel and try to boot? Would you rather panic?

Regards,
Jason

+ err_out:
      bootstrap_unmap();
return ret;



 


Rackspace

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