From patchwork Fri Apr 15 12:33:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kiper X-Patchwork-Id: 8850711 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C71E6C0553 for ; Fri, 15 Apr 2016 12:36:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E9629202DD for ; Fri, 15 Apr 2016 12:36:03 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id A646C20379 for ; Fri, 15 Apr 2016 12:36:01 +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 1ar2wx-0005Id-IC; Fri, 15 Apr 2016 12:34:15 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ar2ww-0005HR-VH for xen-devel@lists.xenproject.org; Fri, 15 Apr 2016 12:34:15 +0000 Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id 64/66-03443-6CFD0175; Fri, 15 Apr 2016 12:34:14 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrNLMWRWlGSWpSXmKPExsXSO6nOVffofYF wg/9TtC2+b5nM5MDocfjDFZYAxijWzLyk/IoE1oxrDXkFD3grrixbxdzAuJ+7i5GLQ0igg0ni U+NcZgjnG6PE73MHmCCcDYwS336fZoFwJjJKHOw7zt7FyMnBJqAjcfHLQzBbREBJ4t6qyWAdz ALnmSSmdV5mAUkIC4RJ3O29DVbEIqAqcenWfDCbV8BDYv6kb4wgtoSAokT3swlsIDYnUHx1Zx NQLwfQNneJf1NFIEqMJdrfXmSbwMi3gJFhFaN6cWpRWWqRrqleUlFmekZJbmJmjq6hgbFebmp xcWJ6ak5iUrFecn7uJkZgoNQzMDDuYLz81ekQoyQHk5Io79y9AuFCfEn5KZUZicUZ8UWlOanF hxhlODiUJHhr7gHlBItS01Mr0jJzgCELk5bg4FES4V0HkuYtLkjMLc5Mh0idYlSUEufNB0kIg CQySvPg2mBxcolRVkqYl5GBgUGIpyC1KDezBFX+FaM4B6OSMO96kCk8mXklcNNfAS1mAlpc9o 4XZHFJIkJKqoHxUfCKsypXJzft3pF2f45/UKp750MhG08eh9Zl3295SgTfKPosEVWy8FLBAS3 fszoT11an6K85dGaxp6H2+nZ550Dhu0Jdmgts4psP/DxyYUu/oKzB31k28msiNdj39B7Il+N4 yqGget5dLWGXl+ryo/Z/3sxeb+eiGiaZ1+Wfv/FQU7N8iaUSS3FGoqEWc1FxIgBHTW8HjgIAA A== X-Env-Sender: daniel.kiper@oracle.com X-Msg-Ref: server-9.tower-31.messagelabs.com!1460723651!6448986!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.28; banners=-,-,- X-VirusChecked: Checked Received: (qmail 37208 invoked from network); 15 Apr 2016 12:34:13 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-9.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 15 Apr 2016 12:34:13 -0000 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u3FCY6Bi027296 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 15 Apr 2016 12:34:07 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u3FCY6pB016850 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 15 Apr 2016 12:34:06 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u3FCY4fG018636; Fri, 15 Apr 2016 12:34:05 GMT Received: from olila.local.net-space.pl (/10.175.160.106) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 15 Apr 2016 05:34:03 -0700 From: Daniel Kiper To: xen-devel@lists.xenproject.org Date: Fri, 15 Apr 2016 14:33:09 +0200 Message-Id: <1460723596-13261-10-git-send-email-daniel.kiper@oracle.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1460723596-13261-1-git-send-email-daniel.kiper@oracle.com> References: <1460723596-13261-1-git-send-email-daniel.kiper@oracle.com> X-Source-IP: aserv0022.oracle.com [141.146.126.234] Cc: jgross@suse.com, andrew.cooper3@citrix.com, stefano.stabellini@eu.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 v3 09/16] efi: explicitly define efi struct in xen/arch/x86/efi/stub.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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Existing solution does not allocate space for this symbol and any references to acpi20, etc. does not make sense. As I saw any efi.* references are protected by relevant ifs but we should not do that because it makes code very fragile. If somebody does not know how efi symbol is created he/she may assume that it always represent valid structure and do invalid references somewhere. Additionally, following 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, define efi struct in xen/arch/x86/efi/stub.c and remove efi symbol from ld script. Signed-off-by: Daniel Kiper --- xen/arch/x86/efi/stub.c | 8 ++++++++ xen/arch/x86/xen.lds.S | 2 -- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/efi/stub.c b/xen/arch/x86/efi/stub.c index 07c2bd0..e6c99b5 100644 --- a/xen/arch/x86/efi/stub.c +++ b/xen/arch/x86/efi/stub.c @@ -8,6 +8,14 @@ const bool_t efi_enabled = 0; #endif +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 +}; + void __init efi_init_memory(void) { } void efi_update_l4_pgtable(unsigned int l4idx, l4_pgentry_t l4e) { } diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index 6802da1..6376bfa 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -227,8 +227,6 @@ SECTIONS .pad : { . = ALIGN(MB(16)); } :text -#else - efi = .; #endif /* Sections to be discarded */