From patchwork Thu Jun 9 20:30:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kiper X-Patchwork-Id: 9167871 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EA16C607DA for ; Thu, 9 Jun 2016 20:34:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D13C628047 for ; Thu, 9 Jun 2016 20:34:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C520E28359; Thu, 9 Jun 2016 20:34:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 50B0A28047 for ; Thu, 9 Jun 2016 20:34:08 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bB6cV-0004GI-4A; Thu, 09 Jun 2016 20:32:03 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bB6cU-0004F7-90 for xen-devel@lists.xenproject.org; Thu, 09 Jun 2016 20:32:02 +0000 Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id 5A/44-06513-042D9575; Thu, 09 Jun 2016 20:32:00 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHLMWRWlGSWpSXmKPExsXSO6nOVdfhUmS 4wf7PTBbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8a55XtZC5ZqVky5c5ilgfGbYhcjF4eQQCuT xKlth9kgnK+MEtc6e9ghnA2MEjuazrBCOBMZJRbebWfpYuTkYBPQkbj45SE7iC0iYCbxbGYDI 0gRs8AmRomZ2+axgiSEBZIkju3aAlbEIqAqMenCRzCbV8BdYtabV4wgtoSAokT3swlsIDangI fE0cNXmEBsIaCaly//MEPUGEqcfriNcQIj3wJGhlWMGsWpRWWpRbqGBnpJRZnpGSW5iZk5QJ6 xXm5qcXFiempOYlKxXnJ+7iZGYLjUMzAw7mDc1uV8iFGSg0lJlLf+SGS4EF9SfkplRmJxRnxR aU5q8SFGGQ4OJQneiItAOcGi1PTUirTMHGDgwqQlOHiURHgdQNK8xQWJucWZ6RCpU4yKUuK8B iAJAZBERmkeXBssWi4xykoJ8zIyMDAI8RSkFuVmlqDKv2IU52BUEub1BpnCk5lXAjf9FdBiJq DFy4+EgywuSURISTUwxu48wXCDrddLQ1bmz84WBb/ko6Y39W0/nI2ps1WWO9a56MH1rA8eCw6 LxV06k3XQ8vOR+ekR/eytHPvLPh3vmzPR+rp+8Yyuy9bsKzZHmNpY79l3K1o4IPtsolDU/lmu rVW7rY478uS/49h+6aam6exti9TWLX2q+2SGkaaWxccisZ/tqzYfVGIpzkg01GIuKk4EAHDPq xCRAgAA X-Env-Sender: daniel.kiper@oracle.com X-Msg-Ref: server-5.tower-31.messagelabs.com!1465504318!41506384!1 X-Originating-IP: [141.146.126.69] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjc3MjE4\n X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 37965 invoked from network); 9 Jun 2016 20:31:59 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-5.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 9 Jun 2016 20:31:59 -0000 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u59KVlRD024285 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 9 Jun 2016 20:31:48 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u59KVlHW031923 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 9 Jun 2016 20:31:47 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u59KVkpp005372; Thu, 9 Jun 2016 20:31:46 GMT Received: from olila.local.net-space.pl (/10.175.235.163) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 09 Jun 2016 13:31:45 -0700 From: Daniel Kiper To: grub-devel@gnu.org, xen-devel@lists.xenproject.org Date: Thu, 9 Jun 2016 22:30:38 +0200 Message-Id: <1465504244-17175-5-git-send-email-daniel.kiper@oracle.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1465504244-17175-1-git-send-email-daniel.kiper@oracle.com> References: <1465504244-17175-1-git-send-email-daniel.kiper@oracle.com> X-Source-IP: userv0021.oracle.com [156.151.31.71] Cc: jgross@suse.com, eric.snowberg@oracle.com, arvidjaar@gmail.com, andrew.cooper3@citrix.com, seth.goldberg@oracle.com, phcoder@gmail.com Subject: [Xen-devel] [MULTIBOOT2 DOC PATCH 04/10] multiboot2: Add description of support for EFI boot services X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Daniel Kiper --- doc/multiboot.texi | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++- doc/multiboot2.h | 2 + 2 files changed, 108 insertions(+), 2 deletions(-) diff --git a/doc/multiboot.texi b/doc/multiboot.texi index e43df93..1583b76 100644 --- a/doc/multiboot.texi +++ b/doc/multiboot.texi @@ -534,6 +534,62 @@ The physical address to which the boot loader should jump in order to start running the operating system. @end table +@subsection EFI i386 entry address tag of Multiboot header + +@example +@group + +-------------------+ +u16 | type = 8 | +u16 | flags | +u32 | size | +u_virt | entry_addr | + +-------------------+ +@end group +@end example + +All of the address fields in this tag are physical addresses. +The meaning of each is as follows: + +@table @code + +@item entry_addr +The physical address to which the boot loader should jump in order to +start running EFI i386 compatible operating system code. +@end table + +This tag is taken into account only on EFI i386 platforms +when Multiboot image header contains EFI boot services tag. +Then entry point specified in ELF header and the entry address +tag of Multiboot header are ignored. + +@subsection EFI amd64 entry address tag of Multiboot header + +@example +@group + +-------------------+ +u16 | type = 9 | +u16 | flags | +u32 | size | +u_virt | entry_addr | + +-------------------+ +@end group +@end example + +All of the address fields in this tag are physical addresses. +The meaning of each is as follows: + +@table @code + +@item entry_addr +The physical address to which the boot loader should jump in order to +start running EFI amd64 compatible operating system code. +@end table + +This tag is taken into account only on EFI amd64 platforms +when Multiboot image header contains EFI boot services tag. +Then entry point specified in ELF header and the entry address +tag of Multiboot header are ignored. + @node Console header tags @subsection Flags tag @@ -714,12 +770,60 @@ The OS image must leave interrupts disabled until it sets up its own On EFI system boot services must be terminated. +@section EFI i386 machine state with boot services enabled + +When the boot loader invokes the 32-bit operating system on EFI i386 +platform and EFI boot services tag together with EFI i386 entry address +tag are present in the image Multiboot header, the machine must have the +following state: + +@table @samp +@item EAX +Must contain the magic value @samp{0x36d76289}; the presence of this +value indicates to the operating system that it was loaded by a +Multiboot-compliant boot loader (e.g. as opposed to another type of +boot loader that the operating system can also be loaded from). + +@item EBX +Must contain the 32-bit physical address of the Multiboot +information structure provided by the boot loader (@pxref{Boot +information format}). +@end table + +All other processor registers, flag bits and state are set accordingly +to Unified Extensible Firmware Interface Specification, Version 2.6, +section 2.3.2, IA-32 Platforms, boot services. + +@section EFI amd64 machine state with boot services enabled + +When the boot loader invokes the 64-bit operating system on EFI amd64 +platform and EFI boot services tag together with EFI amd64 entry address +tag are present in the image Multiboot header, the machine must have the +following state: + +@table @samp +@item RAX +Must contain the magic value @samp{0x36d76289}; the presence of this +value indicates to the operating system that it was loaded by a +Multiboot-compliant boot loader (e.g. as opposed to another type of +boot loader that the operating system can also be loaded from). + +@item RBX +Must contain the 64-bit physical address of the Multiboot +information structure provided by the boot loader (@pxref{Boot +information format}). +@end table + +All other processor registers, flag bits and state are set accordingly +to Unified Extensible Firmware Interface Specification, Version 2.6, +section 2.3.4, x64 Platforms, boot services. + @node Boot information format @section Boot information @subsection Boot information format -Upon entry to the operating system, the @code{EBX} register contains the -physical address of a @dfn{Multiboot information} data structure, +Upon entry to the operating system, the @code{R5/EBX/RBX} register contains +the physical address of a @dfn{Multiboot information} data structure, through which the boot loader communicates vital information to the operating system. The operating system can use or ignore any parts of the structure as it chooses; all information passed by the boot loader diff --git a/doc/multiboot2.h b/doc/multiboot2.h index 78337f5..240400d 100644 --- a/doc/multiboot2.h +++ b/doc/multiboot2.h @@ -69,6 +69,8 @@ #define MULTIBOOT_HEADER_TAG_FRAMEBUFFER 5 #define MULTIBOOT_HEADER_TAG_MODULE_ALIGN 6 #define MULTIBOOT_HEADER_TAG_EFI_BS 7 +#define MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS_EFI32 8 +#define MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS_EFI64 9 #define MULTIBOOT_ARCHITECTURE_I386 0 #define MULTIBOOT_ARCHITECTURE_MIPS32 4