From patchwork Fri Aug 5 23:04:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kiper X-Patchwork-Id: 9265783 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 BC14760839 for ; Fri, 5 Aug 2016 23:08:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABAE228462 for ; Fri, 5 Aug 2016 23:08:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A091C284A0; Fri, 5 Aug 2016 23:08:19 +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 1CEF828462 for ; Fri, 5 Aug 2016 23:08:19 +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 1bVoBb-0003I1-BO; Fri, 05 Aug 2016 23:05:51 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bVoBa-0003CM-7b for xen-devel@lists.xenproject.org; Fri, 05 Aug 2016 23:05:50 +0000 Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id 9D/E3-10347-DCB15A75; Fri, 05 Aug 2016 23:05:49 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLLMWRWlGSWpSXmKPExsUyZ7p8oO5Z6aX hBr2/2C2+b5nM5MDocfjDFZYAxijWzLyk/IoE1owt3YuZClpFKv5Onc3YwHhHoIuRk0NIoJ1J YtXVhC5GLiD7M6PEzklrWCGcDYwSjxY8YYFwJjJKzNnSxQzSwiagI3Hxy0N2EFtEQEni3qrJT CBFzAJHmST+T37MCpIQFgiU+D3nMRuIzSKgKvFn3lUwm1fAXeJYexvYIAkBRYnuZxPA4pxA8X kbn7NB3OQm8bF7PitEjbFE36w+lgmMfAsYGVYxahSnFpWlFukaWeglFWWmZ5TkJmbm6BoamOr lphYXJ6an5iQmFesl5+duYgQGSz0DA+MOxr5VfocYJTmYlER5z19eEi7El5SfUpmRWJwRX1Sa k1p8iFGGg0NJgneq1NJwIcGi1PTUirTMHGDYwqQlOHiURHivgKR5iwsSc4sz0yFSpxgVpcR5z 4EkBEASGaV5cG2wWLnEKCslzMvIwMAgxFOQWpSbWYIq/4pRnINRSZj3EsgUnsy8Erjpr4AWMw Et/mi1BGRxSSJCSqqBsUB6eueHqtoDF89fy885tt+oKOv5qU+OjGkd0xJcj0g+XF2xYP7TCTs fPTMXFIvW1qs/axR/IHTJRJbntt9Xfl/+3vrTqrOPNtrHdr1c5HbOSlGSv+RU7Y4nyfenH9VT iVGOWNS1d6mLkJ7FnbfHChozt35XEuFJel7wyf1ultXPU73acztZZJRYijMSDbWYi4oTARVVh PuQAgAA X-Env-Sender: daniel.kiper@oracle.com X-Msg-Ref: server-8.tower-206.messagelabs.com!1470438347!53028772!1 X-Originating-IP: [156.151.31.81] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAyODgzMzk=\n X-StarScan-Received: X-StarScan-Version: 8.77; banners=-,-,- X-VirusChecked: Checked Received: (qmail 11295 invoked from network); 5 Aug 2016 23:05:48 -0000 Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by server-8.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 5 Aug 2016 23:05:48 -0000 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u75N5eSf015865 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 5 Aug 2016 23:05:41 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u75N5eEL026824 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 5 Aug 2016 23:05:40 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u75N5dJB024898; Fri, 5 Aug 2016 23:05:39 GMT Received: from olila.local.net-space.pl (/10.175.255.156) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 05 Aug 2016 16:05:39 -0700 From: Daniel Kiper To: xen-devel@lists.xenproject.org Date: Sat, 6 Aug 2016 01:04:33 +0200 Message-Id: <1470438282-4226-11-git-send-email-daniel.kiper@oracle.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1470438282-4226-1-git-send-email-daniel.kiper@oracle.com> References: <1470438282-4226-1-git-send-email-daniel.kiper@oracle.com> X-Source-IP: aserv0021.oracle.com [141.146.126.233] Cc: jgross@suse.com, sstabellini@kernel.org, andrew.cooper3@citrix.com, cardoe@cardoe.com, pgnet.dev@gmail.com, ning.sun@intel.com, david.vrabel@citrix.com, jbeulich@suse.com, qiaowei.ren@intel.com, richard.l.maliszewski@intel.com, gang.wei@intel.com, fu.wei@linaro.org Subject: [Xen-devel] [PATCH v4 10/19] efi: move efi struct initialization to xen/common/lib.c 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 A subsequent patch adds efi struct flags member which is used during runtime to differentiate between legacy BIOS and EFI platforms and multiboot2 and EFI native loader. So, efi symbol have to proper representation in ELF and PE Xen image. Hence, move efi struct initialization to xen/common/lib.c and remove efi symbol from ld script. Signed-off-by: Daniel Kiper --- v4 - suggestions/fixes: - move efi struct initialization to xen/common/lib.c and drop one from xen/arch/x86/efi/stub.c (suggested by Jan Beulich), - improve commit message (suggested by Jan Beulich). --- xen/arch/x86/xen.lds.S | 2 -- xen/common/efi/runtime.c | 8 -------- xen/common/lib.c | 10 +++++++++- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index 0970299..b1b15b7 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -265,8 +265,6 @@ SECTIONS .pad : { . = ALIGN(MB(16)); } :text -#else - efi = .; #endif /* Sections to be discarded */ diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c index c256814..82c45bc 100644 --- a/xen/common/efi/runtime.c +++ b/xen/common/efi/runtime.c @@ -43,14 +43,6 @@ UINT64 __read_mostly efi_boot_max_var_store_size; UINT64 __read_mostly efi_boot_remain_var_store_size; UINT64 __read_mostly efi_boot_max_var_size; -struct efi __read_mostly efi = { - .acpi = EFI_INVALID_TABLE_ADDR, - .acpi20 = EFI_INVALID_TABLE_ADDR, - .mps = EFI_INVALID_TABLE_ADDR, - .smbios = EFI_INVALID_TABLE_ADDR, - .smbios3 = EFI_INVALID_TABLE_ADDR, -}; - const struct efi_pci_rom *__read_mostly efi_pci_roms; #ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */ diff --git a/xen/common/lib.c b/xen/common/lib.c index ae0bbb3..32f21e2 100644 --- a/xen/common/lib.c +++ b/xen/common/lib.c @@ -1,4 +1,4 @@ - +#include #include #include #include @@ -32,6 +32,14 @@ const unsigned char _ctype[] = { _L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L, /* 224-239 */ _L,_L,_L,_L,_L,_L,_L,_P,_L,_L,_L,_L,_L,_L,_L,_L}; /* 240-255 */ +struct efi __read_mostly efi = { + .acpi = EFI_INVALID_TABLE_ADDR, + .acpi20 = EFI_INVALID_TABLE_ADDR, + .mps = EFI_INVALID_TABLE_ADDR, + .smbios = EFI_INVALID_TABLE_ADDR, + .smbios3 = EFI_INVALID_TABLE_ADDR, +}; + /* * A couple of 64 bit operations ported from FreeBSD. * The code within the '#if BITS_PER_LONG == 32' block below, and no other