Skip to contentSkip to conversation

efi: Clear EFI_RUNTIME_SERVICES rather than EFI_BOOT by "noefi" boot parameter

PATCH In review Satoru Takeuchi 3 participants 4 messages Feb 14, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi: Clear EFI_RUNTIME_SERVICES rather than EFI_BOOT by "noefi" boot parameter

From: Satoru Takeuchi <[email protected]>

There was a serious problem in samsung-laptop that its platform driver is designed to run under BIOS and running under EFI can cause the machine to become bricked or can cause Machine Check Exceptions.

Discussion about this problem:
https://bugs.launchpad.net/ubuntu-cdimage/+bug/1040557
https://bugzilla.kernel.org/show_bug.cgi?id=47121

The patches to fix this problem:
efi: Make 'efi_enabled' a function to query EFI facilities 83e68189745ad931c2afd45d8ee3303929233e7f

samsung-laptop: Disable on EFI hardware
e0094244e41c4d0c7ad69920681972fc45d8ce34

Unfortunately this problem comes back again if users specify "noefi" option. This parameter clears EFI_BOOT and that driver continues to run even if running under EFI. Refer to the document, this parameter should clear EFI_RUNTIME_SERVICES instead.

Documentation/kernel-parameters.txt:
===============================================================================
...
noefi [X86] Disable EFI runtime services support.
...
===============================================================================

Documentation/x86/x86_64/uefi.txt:
===============================================================================
...
- If some or all EFI runtime services don't work, you can try following kernel command line parameters to turn off some or all EFI runtime services.
noefi turn off all EFI runtime services
...
===============================================================================

Cc Matt Fleming <[email protected]>
Cc David Airlie <[email protected]>
Cc Corentin Chary <[email protected]>
Cc Matthew Garrett <[email protected]>
Cc Dave Jiang <[email protected]>
Cc Olof Johansson <[email protected]>
Cc Peter Jones <[email protected]>
Cc Colin Ian King <[email protected]>
Cc Steve Langasek <[email protected]>
Cc Tony Luck <[email protected]>
Cc Konrad Rzeszutek Wilk <[email protected]>
Cc Rafael J. Wysocki <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc H. Peter Anvin <hpa-VuQAYsv1563Yd54FQh9/[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 arch/x86/platform/efi/efi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/platform/efi/efi.c +1 -1
index 77cf009..928bf83 100644
@@ -87,7 +87,7 @@ EXPORT_SYMBOL(efi_enabled);
 
 static int __init setup_noefi(char *arg)
 {
-	clear_bit(EFI_BOOT, &x86_efi_facility);
+	clear_bit(EFI_RUNTIME_SERVICES, &x86_efi_facility);
 	return 0;
 }
 early_param("noefi", setup_noefi);

-- 1.7.10.4

#1 lore raw
Quoted 6 lines · Satoru Takeuchi

From: Satoru Takeuchi <[email protected]>

There was a serious problem in samsung-laptop that its platform driver is designed to run under BIOS and running under EFI can cause the machine to become bricked or can cause Machine Check Exceptions.

Matt, unless you object I'll pick this one up as urgent, please take the cleanup patch in normal order.

-hpa

#2 lore raw
Quoted 10 lines · H. Peter Anvin
Quoted 6 lines · Satoru Takeuchi

From: Satoru Takeuchi <[email protected]>

There was a serious problem in samsung-laptop that its platform driver is designed to run under BIOS and running under EFI can cause the machine to become bricked or can cause Machine Check Exceptions.

Matt, unless you object I'll pick this one up as urgent, please take the cleanup patch in normal order.

No objection from me, this looks correct.

#3 lore raw
In reply to Satoru Takeuchi
Commit-ID:  1de63d60cd5b0d33a812efa455d5933bf1564a51
Gitweb:     http://git.kernel.org/tip/1de63d60cd5b0d33a812efa455d5933bf1564a51
Author:     Satoru Takeuchi <[email protected]>
AuthorDate: Thu, 14 Feb 2013 09:12:52 +0900
Committer:  H. Peter Anvin <[email protected]>
CommitDate: Wed, 13 Feb 2013 17:24:11 -0800

efi: Clear EFI_RUNTIME_SERVICES rather than EFI_BOOT by "noefi" boot parameter

There was a serious problem in samsung-laptop that its platform driver is designed to run under BIOS and running under EFI can cause the machine to become bricked or can cause Machine Check Exceptions.

Discussion about this problem:
https://bugs.launchpad.net/ubuntu-cdimage/+bug/1040557
https://bugzilla.kernel.org/show_bug.cgi?id=47121

The patches to fix this problem:
efi: Make 'efi_enabled' a function to query EFI facilities 83e68189745ad931c2afd45d8ee3303929233e7f

samsung-laptop: Disable on EFI hardware
e0094244e41c4d0c7ad69920681972fc45d8ce34

Unfortunately this problem comes back again if users specify "noefi" option. This parameter clears EFI_BOOT and that driver continues to run even if running under EFI. Refer to the document, this parameter should clear EFI_RUNTIME_SERVICES instead.

Documentation/kernel-parameters.txt:
===============================================================================
...
noefi [X86] Disable EFI runtime services support.
...
===============================================================================

Documentation/x86/x86_64/uefi.txt:
===============================================================================
...
- If some or all EFI runtime services don't work, you can try following kernel command line parameters to turn off some or all EFI runtime services.
noefi turn off all EFI runtime services
...
===============================================================================

---
 arch/x86/platform/efi/efi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/platform/efi/efi.c +1 -1
index 77cf009..928bf83 100644
@@ -87,7 +87,7 @@ EXPORT_SYMBOL(efi_enabled);
 
 static int __init setup_noefi(char *arg)
 {
-	clear_bit(EFI_BOOT, &x86_efi_facility);
+	clear_bit(EFI_RUNTIME_SERVICES, &x86_efi_facility);
 	return 0;
 }
 early_param("noefi", setup_noefi);