All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Rob Bradford <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: hpa@zytor.com, linux-kernel@vger.kernel.org,
	blackgod016574@gmail.com, peterz@infradead.org, mingo@kernel.org,
	ard.biesheuvel@linaro.org, torvalds@linux-foundation.org,
	robert.bradford@intel.com, tglx@linutronix.de
Subject: [tip:efi/urgent] efi: Allow the number of EFI configuration tables entries to be zero
Date: Sat, 25 May 2019 04:53:05 -0700	[thread overview]
Message-ID: <tip-88447c5b93d98be847f428c39ba589779a59eb83@git.kernel.org> (raw)
In-Reply-To: <20190525112559.7917-3-ard.biesheuvel@linaro.org>

Commit-ID:  88447c5b93d98be847f428c39ba589779a59eb83
Gitweb:     https://git.kernel.org/tip/88447c5b93d98be847f428c39ba589779a59eb83
Author:     Rob Bradford <robert.bradford@intel.com>
AuthorDate: Sat, 25 May 2019 13:25:59 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Sat, 25 May 2019 13:48:17 +0200

efi: Allow the number of EFI configuration tables entries to be zero

Only try and access the EFI configuration tables if there there are any
reported. This allows EFI to be continued to used on systems where there
are no configuration table entries.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Gen Zhang <blackgod016574@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/20190525112559.7917-3-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/platform/efi/quirks.c | 3 +++
 drivers/firmware/efi/efi.c     | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c
index feb77777c8b8..632b83885867 100644
--- a/arch/x86/platform/efi/quirks.c
+++ b/arch/x86/platform/efi/quirks.c
@@ -513,6 +513,9 @@ int __init efi_reuse_config(u64 tables, int nr_tables)
 	void *p, *tablep;
 	struct efi_setup_data *data;
 
+	if (nr_tables == 0)
+		return 0;
+
 	if (!efi_setup)
 		return 0;
 
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
index 55b77c576c42..521a541d02ad 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -636,6 +636,9 @@ int __init efi_config_init(efi_config_table_type_t *arch_tables)
 	void *config_tables;
 	int sz, ret;
 
+	if (efi.systab->nr_tables == 0)
+		return 0;
+
 	if (efi_enabled(EFI_64BIT))
 		sz = sizeof(efi_config_table_64_t);
 	else

      reply	other threads:[~2019-05-25 11:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-25 11:25 [GIT PULL 0/2] EFI fixes for v5.2 Ard Biesheuvel
2019-05-25 11:25 ` [PATCH 1/2] efi/x86: Add missing error handling to old_memmap 1:1 mapping code Ard Biesheuvel
2019-05-25 11:52   ` [tip:efi/urgent] efi/x86/Add " tip-bot for Gen Zhang
2019-05-25 11:25 ` [PATCH 2/2] efi: Allow the number of EFI configuration tables entries to be zero Ard Biesheuvel
2019-05-25 11:53   ` tip-bot for Rob Bradford [this message]

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-88447c5b93d98be847f428c39ba589779a59eb83@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=blackgod016574@gmail.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=robert.bradford@intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.