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

Re: [PATCH 08/15] x86/hyperlaunch: locate dom0 kernel with hyperlaunch


  • To: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Mon, 25 Nov 2024 17:54:08 -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=lIKEUq1ELeWIZJcSQKrc2rPPYKcO9OvXXkFaJHCJ0ZQ=; b=MTSnv7mblCKKle5ANa2T4QB+BbpFglbDpDApZF9wD8PXTJ1slT1odnC/YjWke4GYQQkNiaa7rdqcBHMzDsBdJKOIJi7mrof+u2khCM4iVQFhkU7EW7kKKWVEfalK8VG+8E3owxBL7gjxFJz3vYpQgzbutwS5Rr1tVdgBK3Fs68byd00O+GakgtUfpROg1Bw2+pLI6O631M42pWhvuiaw1azkYcB6ECx5o0Qp2Czs082d6X1tLGNfa/fKQanZopn0vJ5fbKCbF5NExz7gD/DV+gn0LUlZfIKyyLX3EdYWHrTKiXqM8hhxS0GeMElnw3/m25M11X7670JisPU2fXTJHA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=d/RgejOrOcO7a6JoRx6mnkFbvNyUvndsxiBJfL32ApAi/3RmqWLFdOdaxbRXczj6ALk4EtVgsSVBBJLyeDYkbHiV3bUE4MRxTLAVHBeKzKpLffjJMS2F0MRtHNuEsKDvVmDPF4jH9GbtLOe10knZ5WJ4Nemr8srUBcRrYUyn7Qqogs/pOD4WjYwycmnqLEacvnhZJ3HUCkSQ6Se61JLtNW82BfwbAN3x4/NJ7f/KKI2KKVEiLxhNp2uAb1SKw95m3pTjh/JXBV8u6mtdJtGBUaiaiiSxEBkOpRdqhjvJcRG8W/Pt/oPXH/eMrmpXUF4WPzHh4uyQjvKqo77Eh7xTVQ==
  • 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 00:36:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2024-11-23 13:20, Daniel P. Smith wrote:
Look for a subnode of type `multiboot,kernel` within a domain node. If found,
process the reg property for the MB1 module index. If the bootargs property is
present and there was not an MB1 string, then use the command line from the
device tree definition.

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

diff --git a/xen/arch/x86/domain_builder/core.c 
b/xen/arch/x86/domain_builder/core.c
index a80f3711c306..9335f3a9ebef 100644
--- a/xen/arch/x86/domain_builder/core.c
+++ b/xen/arch/x86/domain_builder/core.c
@@ -56,6 +56,18 @@ void __init builder_init(struct boot_info *bi)
printk(XENLOG_INFO " Number of domains: %d\n", bi->nr_domains);
      }
+    else
+    {
+        int i;
+
+        /* Find first unknown boot module to use as Dom0 kernel */
+        printk("Falling back to using first boot module as dom0\n");
+        i = first_boot_module_index(bi, BOOTMOD_UNKNOWN);
+        bi->mods[i].type = BOOTMOD_KERNEL;
+        bi->domains[0].kernel = &bi->mods[i];
+        bi->nr_domains = 1;
+    }
+

extra newline.

  }
/*
diff --git a/xen/arch/x86/domain_builder/fdt.c 
b/xen/arch/x86/domain_builder/fdt.c
index ff1ba58b6907..6bf1c4a297fe 100644
--- a/xen/arch/x86/domain_builder/fdt.c
+++ b/xen/arch/x86/domain_builder/fdt.c

+static int __init process_domain_node(
+    struct boot_info *bi, void *fdt, int dom_node)
+{
+    int node;
+    struct boot_domain *bd = &bi->domains[bi->nr_domains];
+    const char *name = fdt_get_name(fdt, dom_node, NULL);

const char *name = fdt_get_name(fdt, dom_node, NULL) ?: "unknown";

to avoid...

+    int address_size = fdt_address_cells(fdt, dom_node);
+    int size_size = fdt_size_cells(fdt, dom_node);
+
+    if ( address_size < 0 || size_size < 0 )
+    {
+        printk("  failed processing #address or #size for domain %s)\n",
+               name == NULL ? "unknown" : name);

...all this duplication in the following patches.

+        return -EINVAL;
+    }
+
+    fdt_for_each_subnode(node, fdt, dom_node)
+    {
+        if ( fdt_node_check_compatible(fdt, node, "multiboot,kernel") == 0 )

I thought you were going to use "module,kernel" and "module,index" as u32s for multiboot2?

Regards,
Jason

+        {
+            int idx = dom0less_module_node(fdt, node, size_size, address_size);
+            if ( idx < 0 )
+            {
+                printk("  failed processing kernel module for domain %s)\n",
+                       name == NULL ? "unknown" : name);
+                return idx;
+            }
+
+            if ( idx > bi->nr_modules )
+            {
+                printk("  invalid kernel module index for domain node (%d)\n",
+                       bi->nr_domains);
+                return -EINVAL;
+            }
+
+            printk("  kernel: boot module %d\n", idx);
+            bi->mods[idx].type = BOOTMOD_KERNEL;
+            bd->kernel = &bi->mods[idx];
+        }
+    }
+
+    if ( !bd->kernel )
+    {
+        printk(XENLOG_ERR "ERR: no kernel assigned to domain\n");
+        return -EFAULT;
+    }
+
+    return 0;
+}
+
  static int __init find_hyperlaunch_node(void *fdt)
  {
      int hv_node = fdt_path_offset(fdt, "/chosen/hypervisor");




 


Rackspace

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