blob: c2802229a9061d78df431f0a7108057b18622c5d [file] [log] [blame]
From 48cf128e7b03658b3841e837d413e83e07f0b6e0 Mon Sep 17 00:00:00 2001
From: Ard Biesheuvel <>
Date: Wed, 2 Oct 2019 18:58:59 +0200
Subject: [PATCH] efivar/ssdt: Don't iterate over EFI vars if no SSDT override
was specified
commit c05f8f92b701576b615f30aac31fabdc0648649b upstream.
The kernel command line option efivar_ssdt= allows the name to be
specified of an EFI variable containing an ACPI SSDT table that should
be loaded into memory by the OS, and treated as if it was provided by
the firmware.
Currently, that code will always iterate over the EFI variables and
compare each name with the provided name, even if the command line
option wasn't set to begin with.
So bail early when no variable name was provided. This works around a
boot regression on the 2012 Mac Pro, as reported by Scott.
Tested-by: Scott Talbert <>
Signed-off-by: Ard Biesheuvel <>
Cc: <> # v4.9+
Cc: Ben Dooks <>
Cc: Dave Young <>
Cc: Jarkko Sakkinen <>
Cc: Jerry Snitselaar <>
Cc: Linus Torvalds <>
Cc: Lukas Wunner <>
Cc: Lyude Paul <>
Cc: Matthew Garrett <>
Cc: Octavian Purdila <>
Cc: Peter Jones <>
Cc: Peter Zijlstra <>
Cc: Thomas Gleixner <>
Fixes: 475fb4e8b2f4 ("efi / ACPI: load SSTDs from EFI variables")
Signed-off-by: Ingo Molnar <>
Signed-off-by: Paul Gortmaker <>
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
index 4b7cf7bc0ded..b338e799e00d 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -281,6 +281,9 @@ static __init int efivar_ssdt_load(void)
void *data;
int ret;
+ if (!efivar_ssdt[0])
+ return 0;
ret = efivar_init(efivar_ssdt_iter, &entries, true, &entries);
list_for_each_entry_safe(entry, aux, &entries, list) {