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

[PATCH v4 33/44] x86/boot: convert initial_images to struct boot_module


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Date: Fri, 30 Aug 2024 17:47:18 -0400
  • 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=1725054497; h=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=mt1dRXz36GBmL3hIsTAQ0JnOmkyCwzbvQkCGLSUmMkc=; b=FJ8YmX0BEzPNKHpNrYWufWrkbbnWhojfiAR5cey0btEdiFOHYip0W0ffEuvAY174ypyu2eOCRDns8f6ZAfNj3oLNotBXqL0kwk3GA5ts+k1c4PfDBkejJF2nJSZff5K5FHNqp8fEXbmnhLDygJa+DA0p+3oB4EXKiyQwHbTQzfM=
  • Arc-seal: i=1; a=rsa-sha256; t=1725054497; cv=none; d=zohomail.com; s=zohoarc; b=Gcr2dQXwBERTqwQcwuFqX+lzCerzO8XkQcP00CFR8FHA7WkZsU5OZl/tSbJ6xokX8yIQaqPwbKPnnKSFU3+FDmPYrroMmTT7EIbRSB1hCj1B2F7Dqdp6jIvuHC+d1QeaBg3Wg3PbaQgGy6VBirYlHZG+6LOLWAGblN6I4dvpv+w=
  • Cc: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, jason.andryuk@xxxxxxx, christopher.w.clark@xxxxxxxxx, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivered-to: dpsmith@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 30 Aug 2024 21:57:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

The variable initial_images is used for tracking the boot modules passed in by
the boot loader. Convert to a struct boot_module and adjust the code that uses
it accordingly.

Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
---
 xen/arch/x86/setup.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 8ba32c6b6bfa..77c0833dd441 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -281,7 +281,7 @@ static const char *cmdline_cook(const char *p, const char 
*loader_name);
 /* Max number of boot modules a bootloader can provide in addition to Xen */
 #define MAX_NR_BOOTMODS 63
 
-static const module_t *__initdata initial_images;
+static const struct boot_module *__initdata initial_images;
 static struct boot_info __initdata *boot_info;
 
 static void __init multiboot_to_bootinfo(multiboot_info_t *mbi, module_t *mods)
@@ -337,8 +337,9 @@ unsigned long __init initial_images_nrpages(nodeid_t node)
 
     for ( nr = i = 0; i < boot_info->nr_mods; ++i )
     {
-        unsigned long start = initial_images[i].mod_start;
-        unsigned long end = start + PFN_UP(initial_images[i].mod_end);
+        unsigned long start = initial_images[i].early_mod->mod_start;
+        unsigned long end = start +
+                            PFN_UP(initial_images[i].early_mod->mod_end);
 
         if ( end > node_start && node_end > start )
             nr += min(node_end, end) - max(node_start, start);
@@ -353,10 +354,12 @@ void __init discard_initial_images(void)
 
     for ( i = 0; i < boot_info->nr_mods; ++i )
     {
-        uint64_t start = (uint64_t)initial_images[i].mod_start << PAGE_SHIFT;
+        uint64_t start =
+            (uint64_t)initial_images[i].early_mod->mod_start << PAGE_SHIFT;
 
         init_domheap_pages(start,
-                           start + PAGE_ALIGN(initial_images[i].mod_end));
+                           start +
+                           PAGE_ALIGN(initial_images[i].early_mod->mod_end));
     }
 
     boot_info->nr_mods = 0;
@@ -1396,7 +1399,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long 
mbi_p)
     set_kexec_crash_area_size((u64)nr_pages << PAGE_SHIFT);
     kexec_reserve_area();
 
-    initial_images = boot_info->mods[0].early_mod;
+    initial_images = boot_info->mods;
 
     for ( i = 0; !efi_enabled(EFI_LOADER) && i < boot_info->nr_mods; i++ )
     {
-- 
2.30.2




 


Rackspace

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