From patchwork Thu Jun 22 10:51:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kiper X-Patchwork-Id: 9804007 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 8F69760386 for ; Thu, 22 Jun 2017 10:54:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F805285A8 for ; Thu, 22 Jun 2017 10:54:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7422C285CE; Thu, 22 Jun 2017 10:54:33 +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 1ABF4285A8 for ; Thu, 22 Jun 2017 10:54:33 +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 1dNzik-00006a-Qo; Thu, 22 Jun 2017 10:52:18 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dNzii-00005y-MR for xen-devel@lists.xenproject.org; Thu, 22 Jun 2017 10:52:16 +0000 Received: from [193.109.254.147] by server-3.bemta-6.messagelabs.com id 1C/49-03058-061AB495; Thu, 22 Jun 2017 10:52:16 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprIIsWRWlGSWpSXmKPExsXSO6nOVTd+oXe kwffTihbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8a6w38ZCw6zVRx6cYWpgfEsaxcjF4eQwEQm iZZ7c5khnN+MEp0XdrFAOBsZJRbvfMkG4UxglOjYvZO9i5GTg01AR+Lil4fsIAkRgW5GiTkzl zOCOMwCRxgl/t57wwhSJSzgKnF31T5WEJtFQFWi98o/ZhCbV8Bd4vrhr2wgtoSAokT3swlgNq eAh8SsdV/AbCGgmlsnF7BD1BhKfN64lHkCI98CRoZVjBrFqUVlqUW6hhZ6SUWZ6RkluYmZObq GBmZ6uanFxYnpqTmJScV6yfm5mxiBAcMABDsYb24MOMQoycGkJMq7udg7UogvKT+lMiOxOCO+ qDQntfgQowwHh5IEr/sCoJxgUWp6akVaZg4wdGHSEhw8SiK8G7uA0rzFBYm5xZnpEKlTjMYcd /o2fGHiaPqw5QuTEEtefl6qlDjvk/lApQIgpRmleXCDYDF1iVFWSpiXEeg0IZ6C1KLczBJU+V eM4hyMSsK8L0Gm8GTmlcDtewV0ChPQKS+OeICcUpKIkJJqYOxR/8y452jlbf+LhuENpWcUns+ WKvow89y2WU883EO+aLY7ftObvmH+v8ceykInXgbJe/I7KUVq/F3b+TZ2ygzFva+sav9x2NUz uF5yj+o/dFwl1flUZ5vNml0nbBbzi3nejpg1qU8wdFng44nqc2avPv/8nau4ROmkjslHXuzdL a+58GLc939KLMUZiYZazEXFiQBvTBBepAIAAA== X-Env-Sender: daniel.kiper@oracle.com X-Msg-Ref: server-5.tower-27.messagelabs.com!1498128733!103466331!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.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 57369 invoked from network); 22 Jun 2017 10:52:15 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-5.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 22 Jun 2017 10:52:15 -0000 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v5MApuUe031918 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Jun 2017 10:51:57 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v5MApuBa018077 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Jun 2017 10:51:56 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v5MApsAJ009707; Thu, 22 Jun 2017 10:51:54 GMT Received: from olila.local.net-space.pl (/10.175.242.62) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 22 Jun 2017 03:51:53 -0700 From: Daniel Kiper To: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, stable@vger.kernel.org, xen-devel@lists.xenproject.org Date: Thu, 22 Jun 2017 12:51:36 +0200 Message-Id: <1498128697-12943-2-git-send-email-daniel.kiper@oracle.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1498128697-12943-1-git-send-email-daniel.kiper@oracle.com> References: <1498128697-12943-1-git-send-email-daniel.kiper@oracle.com> X-Source-IP: userv0022.oracle.com [156.151.31.74] Cc: jgross@suse.com, ard.biesheuvel@linaro.org, matt@codeblueprint.co.uk, andrew.cooper3@citrix.com, mingo@redhat.com, hpa@zytor.com, boris.ostrovsky@oracle.com, tglx@linutronix.de Subject: [Xen-devel] [PATCH v2 1/2] efi: Process MEMATTR table only if EFI_MEMMAP 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 Otherwise e.g. Xen dom0 on x86_64 EFI platforms crashes. In theory we can check EFI_PARAVIRT too, however, EFI_MEMMAP looks more generic and covers more cases. Signed-off-by: Daniel Kiper Reviewed-by: Ard Biesheuvel --- drivers/firmware/efi/efi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index b372aad..045d6d3 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -528,7 +528,8 @@ int __init efi_config_parse_tables(void *config_tables, int count, int sz, } } - efi_memattr_init(); + if (efi_enabled(EFI_MEMMAP)) + efi_memattr_init(); /* Parse the EFI Properties table if it exists */ if (efi.properties_table != EFI_INVALID_TABLE_ADDR) {