From patchwork Thu Nov 24 20:40:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kiper X-Patchwork-Id: 9446267 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 C2C7A606DB for ; Thu, 24 Nov 2016 20:43:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E93E27F8F for ; Thu, 24 Nov 2016 20:43:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F11E2807E; Thu, 24 Nov 2016 20:43:01 +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 E88E327F8F for ; Thu, 24 Nov 2016 20:43:00 +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 1cA0pB-0001Nz-VG; Thu, 24 Nov 2016 20:40:53 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cA0pB-0001NK-7A for xen-devel@lists.xenproject.org; Thu, 24 Nov 2016 20:40:53 +0000 Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id B2/50-12362-45057385; Thu, 24 Nov 2016 20:40:52 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLLMWRWlGSWpSXmKPExsXSO6nOVTc4wDz CYNkGdYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNeP531fMBU8UKxYduM/ewDhHuouRi0NIYCKT xIHts1ghnL+MEhfWrGGDcDYySrw8tQjKmcgocfTVTcYuRk4ONgEdiYtfHrKD2CICZhLPZjYwg hQxC2xilJi5bR4rSEJYIE2i8/QGsAYWAVWJg5efsYDYvALuEmePXgCLSwgoSnQ/mwC0gYODU8 BD4t1HSZCwEFDJpUlHoUoMJU4/3MY4gZFvASPDKkaN4tSistQiXUMTvaSizPSMktzEzBxdQwN jvdzU4uLE9NScxKRiveT83E2MwGBhAIIdjCu2ex5ilORgUhLl3SxkHiHEl5SfUpmRWJwRX1Sa k1p8iFGGg0NJglfMHygnWJSanlqRlpkDDFuYtAQHj5II7yVfoDRvcUFibnFmOkTqFKOilDhvr x9QQgAkkVGaB9cGi5VLjLJSwryMQIcI8RSkFuVmlqDKv2IU52BUEuYVAJnCk5lXAjf9FdBiJq DFkt+MQRaXJCKkpBoYmSV97d8Z3nq34QZr/5Kknu4Dm03sJGo2pvQ3irBG7jtw9uz/O56bBIL P/Zv2+OiuSa+e6yl7G2y7w8ed8+p2q39G8guhEiWP3/fOCk1l2aK++miL7cYNxkqnw7fJBl2e oWLNekPqW9f96/bXfKZXzZkrtCycl13OP+2GLlfjs5yXtds/8kjsUWIpzkg01GIuKk4EANLFq 2SQAgAA X-Env-Sender: daniel.kiper@oracle.com X-Msg-Ref: server-3.tower-31.messagelabs.com!1480020050!72782724!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: 9.0.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 5641 invoked from network); 24 Nov 2016 20:40:51 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-3.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 24 Nov 2016 20:40:51 -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 uAOKeks4004642 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Nov 2016 20:40:47 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id uAOKekrh001313 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Nov 2016 20:40:46 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id uAOKejlB025423; Thu, 24 Nov 2016 20:40:45 GMT Received: from olila.local.net-space.pl (/10.175.249.101) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 24 Nov 2016 12:40:45 -0800 From: Daniel Kiper To: grub-devel@gnu.org, xen-devel@lists.xenproject.org Date: Thu, 24 Nov 2016 21:40:06 +0100 Message-Id: <1480020010-18421-8-git-send-email-daniel.kiper@oracle.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1480020010-18421-1-git-send-email-daniel.kiper@oracle.com> References: <1480020010-18421-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 v2 07/11] multiboot2: Add description of support for relocatable images 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 --- v2 - suggestions/fixes: - add missing the articles (suggested by Andrew Cooper), - various minor cleanups and fixes (suggested by Andrew Cooper). --- doc/multiboot.texi | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++ doc/multiboot2.h | 24 ++++++++++++++++++++++ 2 files changed, 80 insertions(+) diff --git a/doc/multiboot.texi b/doc/multiboot.texi index dca3e62..973be9f 100644 --- a/doc/multiboot.texi +++ b/doc/multiboot.texi @@ -359,6 +359,7 @@ executable header. * Console header tags:: * Module alignment tag:: * EFI boot services tag:: +* Relocatable header tag:: @end menu @@ -685,6 +686,47 @@ u32 | size = 8 | This tag indicates that payload supports starting without terminating boot services. +@node Relocatable header tag +@subsection Relocatable header tag + +@example +@group + +-------------------+ +u16 | type = 10 | +u16 | flags | +u32 | size = 24 | +u32 | min_addr | +u32 | max_addr | +u32 | align | +u32 | preference | + +-------------------+ +@end group +@end example + +This tag indicates that image is relocatable. + +The meaning of each field is as follows: + +@table @code +@item min_addr +Lowest possible physical address at which image should be loaded. +The bootloader cannot load any part of image below this address. + +@item max_addr +Highest possible physical address at which loaded image should end. +The bootloader cannot load any part of image above this address. + +@item align +Image alignment in memory, e.g. 4096. + +@item preference +It contains load address placement suggestion for boot loader. +Boot loader should follow it. @samp{0} means none, @samp{1} means +load image at lowest possible address but not lower than min_addr +and @samp{2} means load image at highest possible address but not +higher than max_addr. +@end table + @node Machine state @section MIPS machine state @@ -1316,6 +1358,20 @@ u64 | pointer | This tag contains pointer to EFI amd64 image handle. Usually it is boot loader image handle. +@subsection Image load base physical address +@example +@group + +-------------------+ +u32 | type = 21 | +u32 | size = 12 | +u32 | load_base_addr | + +-------------------+ +@end group +@end example + +This tag contains image load base physical address. It is +provided only if image has relocatable header tag. + @node Examples @chapter Examples diff --git a/doc/multiboot2.h b/doc/multiboot2.h index b85cb13..b181607 100644 --- a/doc/multiboot2.h +++ b/doc/multiboot2.h @@ -62,6 +62,7 @@ #define MULTIBOOT_TAG_TYPE_EFI_BS 18 #define MULTIBOOT_TAG_TYPE_EFI32_IH 19 #define MULTIBOOT_TAG_TYPE_EFI64_IH 20 +#define MULTIBOOT_TAG_TYPE_LOAD_BASE_ADDR 21 #define MULTIBOOT_HEADER_TAG_END 0 #define MULTIBOOT_HEADER_TAG_INFORMATION_REQUEST 1 @@ -73,11 +74,16 @@ #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_HEADER_TAG_RELOCATABLE 10 #define MULTIBOOT_ARCHITECTURE_I386 0 #define MULTIBOOT_ARCHITECTURE_MIPS32 4 #define MULTIBOOT_HEADER_TAG_OPTIONAL 1 +#define MULTIBOOT_LOAD_PREFERENCE_NONE 0 +#define MULTIBOOT_LOAD_PREFERENCE_LOW 1 +#define MULTIBOOT_LOAD_PREFERENCE_HIGH 2 + #define MULTIBOOT_CONSOLE_FLAGS_CONSOLE_REQUIRED 1 #define MULTIBOOT_CONSOLE_FLAGS_EGA_TEXT_SUPPORTED 2 @@ -162,6 +168,17 @@ struct multiboot_header_tag_module_align multiboot_uint32_t size; }; +struct multiboot_header_tag_relocatable +{ + multiboot_uint16_t type; + multiboot_uint16_t flags; + multiboot_uint32_t size; + multiboot_uint32_t min_addr; + multiboot_uint32_t max_addr; + multiboot_uint32_t align; + multiboot_uint32_t preference; +}; + struct multiboot_color { multiboot_uint8_t red; @@ -388,6 +405,13 @@ struct multiboot_tag_efi64_ih multiboot_uint64_t pointer; }; +struct multiboot_tag_load_base_addr +{ + multiboot_uint32_t type; + multiboot_uint32_t size; + multiboot_uint32_t load_base_addr; +}; + #endif /* ! ASM_FILE */ #endif /* ! MULTIBOOT_HEADER */