[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 02/18] loader/linux: support passing rsdp address via boot par
From: |
Juergen Gross |
Subject: |
[PATCH v2 02/18] loader/linux: support passing rsdp address via boot params |
Date: |
Tue, 9 Oct 2018 13:03:01 +0200 |
Xen PVH guests will have the RSDP at an arbitrary address. Support that
by passing the RSDP address via the boot parameters to Linux.
The new protocol version 2.14 requires to set version to 0x8000 ored
with the actually use protocol version (the minimum of the kernel
supplied protocol version and the grub2 supported protocol version)
if 2.14 or higher are in effect.
Signed-off-by: Juergen Gross <address@hidden>
---
V2: add oring 0x8000 to version field
---
grub-core/loader/i386/linux.c | 9 +++++++++
include/grub/i386/linux.h | 5 ++++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c
index 4eab55a2d..f96309476 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+");
@@ -750,6 +751,14 @@ 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 (grub_le_to_cpu16 (lh.version) >= 0x020e)
+ lh.version = grub_le_to_cpu16 (LINUX_LOADER_VERSION_TAG | 0x020e);
+
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 60c7c3b5e..5cbcfbe5a 100644
--- a/include/grub/i386/linux.h
+++ b/include/grub/i386/linux.h
@@ -87,7 +87,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_i386_kernel_header
{
grub_uint8_t code1[0x0020];
@@ -105,6 +105,7 @@ struct linux_i386_kernel_header
grub_uint16_t jump; /* Jump instruction */
grub_uint32_t header; /* Magic signature "HdrS" */
grub_uint16_t version; /* Boot protocol version supported */
+#define LINUX_LOADER_VERSION_TAG 0x8000
grub_uint32_t realmode_swtch; /* Boot loader hook */
grub_uint16_t start_sys; /* The load-low segment (obsolete) */
grub_uint16_t kernel_version; /* Points to kernel version
string */
@@ -142,6 +143,8 @@ struct linux_i386_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.16.4
- Re: [PATCH v2 05/18] xen: add some dummy headers for PVH mode, (continued)
- [PATCH v2 11/18] xen: get memory map from hypervisor for PVH, Juergen Gross, 2018/10/09
- [PATCH v2 10/18] xen: setup hypercall page for PVH, Juergen Gross, 2018/10/09
- [PATCH v2 02/18] loader/linux: support passing rsdp address via boot params,
Juergen Gross <=
- Re: [PATCH v2 02/18] loader/linux: support passing rsdp address via boot params, Daniel Kiper, 2018/10/18
- Re: [PATCH v2 02/18] loader/linux: support passing rsdp address via boot params, Juergen Gross, 2018/10/18
- Re: [PATCH v2 02/18] loader/linux: support passing rsdp address via boot params, Daniel Kiper, 2018/10/18
- Re: [PATCH v2 02/18] loader/linux: support passing rsdp address via boot params, Juergen Gross, 2018/10/18
- Re: [PATCH v2 02/18] loader/linux: support passing rsdp address via boot params, Daniel Kiper, 2018/10/18
- Re: [PATCH v2 02/18] loader/linux: support passing rsdp address via boot params, Juergen Gross, 2018/10/18
- Re: [PATCH v2 02/18] loader/linux: support passing rsdp address via boot params, Daniel Kiper, 2018/10/18
[PATCH v2 03/18] xen: carve out grant tab initialization into dedicated function, Juergen Gross, 2018/10/09
[PATCH v2 07/18] xen: add PVH specific defines to offset.h, Juergen Gross, 2018/10/09