From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1eK2hd-0002zp-Tx for mharc-grub-devel@gnu.org; Wed, 29 Nov 2017 08:47:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51288) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eK2hY-0002wn-R2 for grub-devel@gnu.org; Wed, 29 Nov 2017 08:47:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eK2hV-0006wu-Lk for grub-devel@gnu.org; Wed, 29 Nov 2017 08:47:00 -0500 Received: from mx2.suse.de ([195.135.220.15]:40350) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eK2hV-0006v0-FB for grub-devel@gnu.org; Wed, 29 Nov 2017 08:46:57 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 6A73FADD8; Wed, 29 Nov 2017 13:46:54 +0000 (UTC) From: Juergen Gross To: grub-devel@gnu.org Cc: xen-devel@lists.xen.org, phcoder@gmail.com, daniel.kiper@oracle.com, Juergen Gross Subject: [PATCH 2/8] loader/linux: support passing rsdp address via boot params Date: Wed, 29 Nov 2017 14:46:44 +0100 Message-Id: <20171129134650.20102-3-jgross@suse.com> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20171129134650.20102-1-jgross@suse.com> References: <20171129134650.20102-1-jgross@suse.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 195.135.220.15 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Nov 2017 13:47:02 -0000 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 --- 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 #include #include +#include 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