public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Kiper <daniel.kiper@oracle.com>
To: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org,
	x86@kernel.org, stable@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: boris.ostrovsky@oracle.com, jgross@suse.com, tglx@linutronix.de,
	mingo@redhat.com, hpa@zytor.com, matt@codeblueprint.co.uk,
	ard.biesheuvel@linaro.org
Subject: [PATCH 1/2] efi: Process MEMATTR table only if EFI_MEMMAP
Date: Tue, 20 Jun 2017 22:14:27 +0200	[thread overview]
Message-ID: <1497989668-6238-2-git-send-email-daniel.kiper@oracle.com> (raw)
In-Reply-To: <1497989668-6238-1-git-send-email-daniel.kiper@oracle.com>

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 <daniel.kiper@oracle.com>
---
 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) {
-- 
1.7.10.4

  reply	other threads:[~2017-06-20 20:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-20 20:14 [PATCH 0/2] xen/efi: Fixes Daniel Kiper
2017-06-20 20:14 ` Daniel Kiper [this message]
2017-06-21  7:48   ` [PATCH 1/2] efi: Process MEMATTR table only if EFI_MEMMAP Ard Biesheuvel
2017-06-20 20:14 ` [PATCH 2/2] x86/xen/efi: Init only efi struct members used by Xen Daniel Kiper
2017-06-21  7:53   ` Ard Biesheuvel
2017-06-21  8:10   ` [Xen-devel] " Andrew Cooper
2017-06-21  9:29     ` Daniel Kiper
2017-06-21  9:24   ` Ingo Molnar
2017-06-21  9:32     ` 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=1497989668-6238-2-git-send-email-daniel.kiper@oracle.com \
    --to=daniel.kiper@oracle.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=boris.ostrovsky@oracle.com \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@codeblueprint.co.uk \
    --cc=mingo@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xenproject.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