[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 02/18] loader/linux: support passing rsdp address via boot par
From: |
Juergen Gross |
Subject: |
[PATCH v3 02/18] loader/linux: support passing rsdp address via boot params |
Date: |
Wed, 24 Oct 2018 16:54:11 +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
V3: move including machine/kernel.h to patch 8 (Daniel Kiper)
---
grub-core/loader/i386/linux.c | 8 ++++++++
include/grub/i386/linux.h | 5 ++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c
index 4eab55a2d..51920896e 100644
--- a/grub-core/loader/i386/linux.c
+++ b/grub-core/loader/i386/linux.c
@@ -750,6 +750,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
- [PATCH v3 00/18] xen: add pvh guest support, Juergen Gross, 2018/10/24
- [PATCH v3 05/18] xen: add some dummy headers for PVH mode, Juergen Gross, 2018/10/24
- [PATCH v3 04/18] xen: prepare common code for Xen PVH support, Juergen Gross, 2018/10/24
- [PATCH v3 03/18] xen: carve out grant tab initialization into dedicated function, Juergen Gross, 2018/10/24
- [PATCH v3 07/18] xen: add PVH specific defines to offset.h, Juergen Gross, 2018/10/24
- [PATCH v3 10/18] xen: setup hypercall page for PVH, Juergen Gross, 2018/10/24
- [PATCH v3 06/18] xen: rearrange xen/init.c to prepare it for Xen PVH mode, Juergen Gross, 2018/10/24
- [PATCH v3 08/18] xen: add basic hooks for PVH in current code, Juergen Gross, 2018/10/24
- [PATCH v3 02/18] loader/linux: support passing rsdp address via boot params,
Juergen Gross <=
- [PATCH v3 15/18] grub-module-verifier: Ignore all_video for xenpvh, Juergen Gross, 2018/10/24
- [PATCH v3 11/18] xen: get memory map from hypervisor for PVH, Juergen Gross, 2018/10/24
- [PATCH v3 17/18] xen_pvh: support grub-install for xen_pvh, Juergen Gross, 2018/10/24
- [PATCH v3 14/18] xen_pvh: add build runes for grub-core, Juergen Gross, 2018/10/24
- [PATCH v3 13/18] xen: init memory regions for PVH, Juergen Gross, 2018/10/24
- [PATCH v3 18/18] xen_pvh: add support to configure, Juergen Gross, 2018/10/24
- [PATCH v3 09/18] xen: add PVH boot entry code, Juergen Gross, 2018/10/24
- [PATCH v3 12/18] xen: setup Xen specific data for PVH, Juergen Gross, 2018/10/24
- [PATCH v3 16/18] xen_pvh: support building a standalone image, Juergen Gross, 2018/10/24
- [PATCH v3 01/18] xen: add some xen headers, Juergen Gross, 2018/10/24