Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754570AbdFWOG1 (ORCPT ); Fri, 23 Jun 2017 10:06:27 -0400 Received: from terminus.zytor.com ([65.50.211.136]:41279 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754150AbdFWOGY (ORCPT ); Fri, 23 Jun 2017 10:06:24 -0400 Date: Fri, 23 Jun 2017 07:02:43 -0700 From: tip-bot for Daniel Kiper Message-ID: Cc: mingo@kernel.org, peterz@infradead.org, tglx@linutronix.de, ard.biesheuvel@linaro.org, torvalds@linux-foundation.org, daniel.kiper@oracle.com, hpa@zytor.com, linux-kernel@vger.kernel.org Reply-To: linux-kernel@vger.kernel.org, hpa@zytor.com, daniel.kiper@oracle.com, tglx@linutronix.de, peterz@infradead.org, mingo@kernel.org, torvalds@linux-foundation.org, ard.biesheuvel@linaro.org In-Reply-To: <1498128697-12943-2-git-send-email-daniel.kiper@oracle.com> References: <1498128697-12943-2-git-send-email-daniel.kiper@oracle.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:efi/core] efi: Process the MEMATTR table only if EFI_MEMMAP is enabled Git-Commit-ID: 457ea3f7e97881f937136ce0ba1f29f82b9abdb0 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1667 Lines: 46 Commit-ID: 457ea3f7e97881f937136ce0ba1f29f82b9abdb0 Gitweb: http://git.kernel.org/tip/457ea3f7e97881f937136ce0ba1f29f82b9abdb0 Author: Daniel Kiper AuthorDate: Thu, 22 Jun 2017 12:51:36 +0200 Committer: Ingo Molnar CommitDate: Fri, 23 Jun 2017 11:11:02 +0200 efi: Process the MEMATTR table only if EFI_MEMMAP is enabled Otherwise e.g. Xen dom0 on x86_64 EFI platforms crashes. In theory we can check EFI_PARAVIRT too, however, EFI_MEMMAP looks more targeted and covers more cases. Signed-off-by: Daniel Kiper Reviewed-by: Ard Biesheuvel Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: andrew.cooper3@citrix.com Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Cc: linux-efi@vger.kernel.org Cc: matt@codeblueprint.co.uk Cc: stable@vger.kernel.org Cc: xen-devel@lists.xenproject.org Link: http://lkml.kernel.org/r/1498128697-12943-2-git-send-email-daniel.kiper@oracle.com Signed-off-by: Ingo Molnar --- 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) {