grub-devel
[Top][All Lists]
Advanced

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

[PATCH 2/8] loader/linux: support passing rsdp address via boot params


From: Juergen Gross
Subject: [PATCH 2/8] loader/linux: support passing rsdp address via boot params
Date: Wed, 29 Nov 2017 14:46:44 +0100

Xen PVH guests will have the RSDP at an arbitrary address. Support that
by passing the RSDP address via the boot parameters to Linux.

Signed-off-by: Juergen Gross <address@hidden>
---
 grub-core/loader/i386/linux.c | 6 ++++++
 include/grub/i386/linux.h     | 4 +++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c
index 083f9417c..14722d059 100644
--- a/grub-core/loader/i386/linux.c
+++ b/grub-core/loader/i386/linux.c
@@ -35,6 +35,7 @@
 #include <grub/i18n.h>
 #include <grub/lib/cmdline.h>
 #include <grub/linux.h>
+#include <grub/machine/kernel.h>
 
 GRUB_MOD_LICENSE ("GPLv3+");
 
@@ -793,6 +794,11 @@ grub_cmd_linux (grub_command_t cmd __attribute__ 
((unused)),
       prot_init_space = page_align (prot_size) * 3;
     }
 
+#ifdef GRUB_KERNEL_USE_RSDP_ADDR
+  if (grub_le_to_cpu16 (lh.version) >= 0x020e)
+    lh.acpi_rsdp_addr = grub_le_to_cpu64 (grub_rsdp_addr);
+#endif
+
   if (allocate_pages (prot_size, &align,
                      min_align, relocatable,
                      preferred_address))
diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h
index da0ca3b83..7194e8297 100644
--- a/include/grub/i386/linux.h
+++ b/include/grub/i386/linux.h
@@ -84,7 +84,7 @@ enum
     GRUB_VIDEO_LINUX_TYPE_SIMPLE = 0x70    /* Linear framebuffer without any 
additional functions.  */
   };
 
-/* For the Linux/i386 boot protocol version 2.10.  */
+/* For the Linux/i386 boot protocol version 2.14.  */
 struct linux_kernel_header
 {
   grub_uint8_t code1[0x0020];
@@ -139,6 +139,8 @@ struct linux_kernel_header
   grub_uint64_t setup_data;
   grub_uint64_t pref_address;
   grub_uint32_t init_size;
+  grub_uint32_t handover_offset;
+  grub_uint64_t acpi_rsdp_addr;
 } GRUB_PACKED;
 
 /* Boot parameters for Linux based on 2.6.12. This is used by the setup
-- 
2.12.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]