]> xenbits.xensource.com Git - people/aperard/xen-unstable.git/commitdiff
x86/boot: move mmap info to boot info
authorDaniel P. Smith <dpsmith@apertussolutions.com>
Thu, 17 Oct 2024 17:02:44 +0000 (13:02 -0400)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 17 Oct 2024 22:42:51 +0000 (23:42 +0100)
Transition the memory map info to be held in struct boot_info.

No functional change intended.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/include/asm/bootinfo.h
xen/arch/x86/setup.c

index c980f0bdb74b8078f3de3a4032f7202184acc237..e7821e0603f8e9cf3c878eadccaf760de62eca71 100644 (file)
@@ -8,6 +8,8 @@
 #ifndef X86_BOOTINFO_H
 #define X86_BOOTINFO_H
 
+#include <xen/types.h>
+
 /*
  * Xen internal representation of information provided by the
  * bootloader/environment, or derived from the information.
@@ -16,6 +18,9 @@ struct boot_info {
     const char *loader;
     const char *cmdline;
 
+    paddr_t memmap_addr;
+    size_t memmap_length;
+
     unsigned int nr_modules;
 };
 
index 01e35b965956330c01cffa5deb67018de3520cd1..163f5620da4c7ba8f0054dffad376f052050f9a2 100644 (file)
@@ -297,6 +297,12 @@ static struct boot_info *__init multiboot_fill_boot_info(unsigned long mbi_p)
     if ( mbi->flags & MBI_CMDLINE )
         bi->cmdline = cmdline_cook(__va(mbi->cmdline), bi->loader);
 
+    if ( mbi->flags & MBI_MEMMAP )
+    {
+        bi->memmap_addr   = mbi->mmap_addr;
+        bi->memmap_length = mbi->mmap_length;
+    }
+
     return bi;
 }
 
@@ -1187,13 +1193,13 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
     {
         memmap_type = "Xen-e820";
     }
-    else if ( mbi->flags & MBI_MEMMAP )
+    else if ( bi->memmap_length )
     {
         memmap_type = "Multiboot-e820";
-        while ( bytes < mbi->mmap_length &&
+        while ( bytes < bi->memmap_length &&
                 e820_raw.nr_map < ARRAY_SIZE(e820_raw.map) )
         {
-            memory_map_t *map = __va(mbi->mmap_addr + bytes);
+            memory_map_t *map = __va(bi->memmap_addr + bytes);
 
             /*
              * This is a gross workaround for a BIOS bug. Some bootloaders do