From patchwork Thu Feb 2 22:41:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kiper X-Patchwork-Id: 9553307 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 B627460424 for ; Thu, 2 Feb 2017 22:44:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AEA1328491 for ; Thu, 2 Feb 2017 22:44:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A00B228499; Thu, 2 Feb 2017 22:44:57 +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=-3.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM,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 190D9284BC for ; Thu, 2 Feb 2017 22:44:57 +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 1cZQ58-0008Sw-Dh; Thu, 02 Feb 2017 22:42:22 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZQ57-0008Sq-C2 for xen-devel@lists.xenproject.org; Thu, 02 Feb 2017 22:42:21 +0000 Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id 95/0E-14551-CC5B3985; Thu, 02 Feb 2017 22:42:20 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrMIsWRWlGSWpSXmKPExsXSO6nOVffM1sk RBv1NbBbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8auKeuYCq4JVXxatIqxgXEjfxcjF4eQQDuT xIP2k+xdjJxAzmdGidbduhCJ9YwSX1bvYIRwJjJKXLs7jwmkikVAReLz271sIDabgI7ExS8Pw bpFBJQk7q2azATSwCywj0li0ZodYEXCAjYSyzfuZQaxeQVsJfae+skCMbWFUeLoiW1MEAlBiZ Mzn7CA2MwCWhI3/r0EinMA2dISy/9xgJicAh4SLw5GgVSIAt0w5eQ2sPESAsYSfbP6WCYwCs5 CMmgWkkGzEAYtYGRexahRnFpUllqka2Sil1SUmZ5RkpuYmaNraGCsl5taXJyYnpqTmFSsl5yf u4kRGLj1DAyMOxhfHfc7xCjJwaQkyvtz4eQIIb6k/JTKjMTijPii0pzU4kOMMhwcShK8+7cA5 QSLUtNTK9Iyc4AxBJOW4OBREuHdCZLmLS5IzC3OTIdInWJUlBLnXQ+SEABJZJTmwbXB4vYSo6 yUMC8jAwODEE9BalFuZgmq/CtGcQ5GJWHeOpApPJl5JXDTXwEtZgJa/PPxJJDFJYkIKakGRv+ HTT8uxl4MV/cRlp+XYmvV+dM699HRrrq7rIudl5zllZCuEpY4zJOuvnj7nRaNAB39Px+3iJ5l 4I3POSg39ebSvfXtU7uK09e47OfZ9DPMaMuGgBwGjzf5EeXtgrrHNX50Brk7HCho/Vz6Pfp82 w2ztxqR69lnhhYmmnQskNV2Wu3lLairxFKckWioxVxUnAgAAqoITdYCAAA= X-Env-Sender: daniel.kiper@oracle.com X-Msg-Ref: server-12.tower-31.messagelabs.com!1486075338!66947063!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.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 25267 invoked from network); 2 Feb 2017 22:42:19 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-12.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 2 Feb 2017 22:42:19 -0000 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v12Mg1bK011898 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 2 Feb 2017 22:42:02 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.13.8/8.14.4) with ESMTP id v12Mg1iY001893 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 2 Feb 2017 22:42:01 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v12Mfxgp023016; Thu, 2 Feb 2017 22:41:59 GMT Received: from olila.local.net-space.pl (/10.175.161.206) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 02 Feb 2017 14:41:59 -0800 Date: Thu, 2 Feb 2017 23:41:53 +0100 From: Daniel Kiper To: xen-devel@lists.xenproject.org Message-ID: <20170202224153.GX16671@olila.local.net-space.pl> References: <1486072879-31637-1-git-send-email-daniel.kiper@oracle.com> <1486072879-31637-3-git-send-email-daniel.kiper@oracle.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1486072879-31637-3-git-send-email-daniel.kiper@oracle.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0021.oracle.com [141.146.126.233] Cc: jgross@suse.com, sstabellini@kernel.org, andrew.cooper3@citrix.com, cardoe@cardoe.com, marcos.matsunaga@oracle.com, pgnet.dev@gmail.com, ning.sun@intel.com, julien.grall@arm.com, jbeulich@suse.com, qiaowei.ren@intel.com, gang.wei@intel.com, fu.wei@linaro.org Subject: Re: [Xen-devel] [PATCH v14 2/9] efi: build xen.gz with EFI code 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: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Feb 02, 2017 at 11:01:12PM +0100, Daniel Kiper wrote: > Build xen.gz with EFI code. We need this to support multiboot2 > protocol on EFI platforms. > > If we wish to load non-ELF file using multiboot (v1) or multiboot2 then > it must contain "linear" (or "flat") representation of code and data. > This is requirement of both boot protocols. Currently, PE file contains > many sections which are not "linear" (one after another without any holes) > or even do not have representation in a file (e.g. BSS). From EFI point > of view everything is OK and works. However, this file layout cannot be > properly interpreted by multiboot protocols family. In theory there is > a chance that we could build proper PE file (from multiboot protocols POV) > using current build system. However, it means that xen.efi further diverge > from Xen ELF file (in terms of contents and build method). On the other > hand ELF has all needed properties. So, it means that this is good starting > point for further development. Additionally, I think that this is also good > starting point for further xen.efi code and build optimizations. It looks > that there is a chance that finally we can generate xen.efi directly from > Xen ELF using just simple objcopy or other tool. This way we will have one > Xen binary which can be loaded by three boot protocols: EFI native loader, > multiboot (v1) and multiboot2. > > Signed-off-by: Daniel Kiper > Acked-by: Jan Beulich > Reviewed-by: Doug Goldstein > --- > v14 - suggestions/fixes: > - at least GNU Make 4.1 does not build efi/buildid.o if nothing > depends on it; so, add "boot.init.o: buildid.o" dependency to > force efi/buildid.o on some versions of make; I hope that this > small change does not invalidate Acked-by/Reviewed-by; however, > I am dropping Tested-by > (discovered by Konrad Rzeszutek Wilk and Marcos Matsunaga). Diff as Doug asked: Reviewed-by: Daniel Kiper diff --git a/xen/arch/x86/efi/Makefile b/xen/arch/x86/efi/Makefile index 442f3fc..3edff1c 100644 --- a/xen/arch/x86/efi/Makefile +++ b/xen/arch/x86/efi/Makefile @@ -8,6 +8,8 @@ efi := $(if $(efi),$(shell rm disabled)y) %.o: %.ihex $(OBJCOPY) -I ihex -O binary $< $@ +boot.init.o: buildid.o + obj-y := stub.o obj-$(efi) := boot.init.o compat.o relocs-dummy.o runtime.o extra-$(efi) += buildid.o