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

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


  • To: Jason Andryuk <jason.andryuk@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Date: Wed, 11 Dec 2024 09:19:38 -0500
  • Arc-authentication-results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@xxxxxxxxxxxxxxxxxxxx; dmarc=pass header.from=<dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733926781; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=M7nuzwWoGz53YA2QOgeNmV/5BGs45A7H+bZyTd1aieQ=; b=j3Q8uoQoL7oZhBTG2kR5B4TVMT4g0RL9Lny8stMtPfLFDK1aLfKlZOvvbPW+nqV97FKsqqibZUwaekqelCo71VzfZ9W55D9r1ImIS7PAl//kWjP/eKHaWV3CN5qoVwmUL3KgNgGDdLs0/2tqdCXFStwNBt1daytt8RFhW38/k/8=
  • Arc-seal: i=1; a=rsa-sha256; t=1733926781; cv=none; d=zohomail.com; s=zohoarc; b=AGDApV+s5XYq8WBtDCHZkkpxMwiI+Urp/Rm1OFgVcgdwDV1GhNHBl0MaZETJGMjDS7EKCqLrApWwYq9lNXt57+zayz2AcoMMt3FMxtbuV+rOJvZLDB8aRkAeKvafPLJQ1ltgrXo0FLLh5DPeSVXTfezP74/i+Y/xftxNFRZ9xo0=
  • 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: Wed, 11 Dec 2024 14:20:03 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 11/25/24 17:54, Jason Andryuk wrote:
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.

ack.

  }
  /*
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...

Sure.

+    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?

Per our discussion, I will update appropriately.

v/r,
dps





 


Rackspace

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