linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Daniel Kiper <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
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
Subject: [tip:efi/core] efi: Process the MEMATTR table only if EFI_MEMMAP is enabled
Date: Fri, 23 Jun 2017 07:02:43 -0700	[thread overview]
Message-ID: <tip-457ea3f7e97881f937136ce0ba1f29f82b9abdb0@git.kernel.org> (raw)
In-Reply-To: <1498128697-12943-2-git-send-email-daniel.kiper@oracle.com>

Commit-ID:  457ea3f7e97881f937136ce0ba1f29f82b9abdb0
Gitweb:     http://git.kernel.org/tip/457ea3f7e97881f937136ce0ba1f29f82b9abdb0
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Thu, 22 Jun 2017 12:51:36 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
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 <daniel.kiper@oracle.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
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 <mingo@kernel.org>
---
 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) {

  reply	other threads:[~2017-06-23 14:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-22 10:51 [PATCH v2 0/2] xen/efi: Fixes Daniel Kiper
2017-06-22 10:51 ` [PATCH v2 1/2] efi: Process MEMATTR table only if EFI_MEMMAP Daniel Kiper
2017-06-23 14:02   ` tip-bot for Daniel Kiper [this message]
2017-06-22 10:51 ` [PATCH v2 2/2] x86/xen/efi: Init only efi struct members used by Xen Daniel Kiper
2017-06-22 19:25   ` Boris Ostrovsky
2017-06-23 14:03   ` [tip:efi/core] x86/xen/efi: Initialize only the EFI " tip-bot for Daniel Kiper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-457ea3f7e97881f937136ce0ba1f29f82b9abdb0@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=daniel.kiper@oracle.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).