Skip to contentSkip to conversation

uefi boot hang (bisected)

PATCH Dave Young 2 participants 3 messages Jul 10, 2013 – Jul 11, 2013 EFI

lore
Share & tools
lore

Dave Young

author
#0 lore raw

Hi,

latest linus tree kernel hangs on my Thinkpad T420.

I bisected this issue, culprit commit is below:

commit 1acba98f810a14b1255e34bc620594f83de37e36

Author: Matthew Garrett <[email protected]>
Date:   Sun Jun 2 18:12:25 2013 -0400

UEFI: Don't pass boot services regions to SetVirtualAddressMap()

We need to map boot services regions during startup in order to avoid firmware bugs, but we shouldn't be passing those regions to SetVirtualAddressMap(). Ensure that we're only passing regions that are marked as being mapped at runtime.

Reverting this patch, the kernel boot just fine.

Another problem is: With this patch applied I tried noefi boot, but kernel paniced, looks like efivar_init depends on efi runtime. Below patches works for me about noefi boot though I'm not sure if it's a right fix, please review.

drivers/firmware/efi/vars.c +2 -0
@@ -370,6 +370,8 @@ int efivar_init(int (*func)(efi_char16_t
 	efi_guid_t vendor_guid;
 	int err = 0;
 
+	if (! efi_enabled(EFI_RUNTIME_SERVICES))
+		return -ENODEV;
 	variable_name = kzalloc(variable_name_size, GFP_KERNEL);
 	if (!variable_name) {
 		printk(KERN_ERR "efivars: Memory allocation failed.\n");
Signature · 2 lines
Thanks
Dave
#1 lore raw
Quoted 4 lines · Dave Young

Another problem is: With this patch applied I tried noefi boot, but kernel paniced, looks like efivar_init depends on efi runtime. Below patches works for me about noefi boot though I'm not sure if it's a right fix, please review.

It makes more sense to check in efivars.c, since none of that file can function without runtime serivces.

Could you try the following patch?

---

drivers/firmware/efi/efivars.c +3 -0
index 8bd1bb6..8a7432a 100644
@@ -583,6 +583,9 @@ int efivars_sysfs_init(void)
 	struct kobject *parent_kobj = efivars_kobject();
 	int error = 0;
 
+	if (!efi_enabled(EFI_RUNTIME_SERVICES))
+		return -ENODEV;
+
 	/* No efivars has been registered yet */
 	if (!parent_kobj)
 		return 0;
author Tested-by
#2 lore raw
Quoted 10 lines · Matt Fleming
Quoted 4 lines · Dave Young

Another problem is: With this patch applied I tried noefi boot, but kernel paniced, looks like efivar_init depends on efi runtime. Below patches works for me about noefi boot though I'm not sure if it's a right fix, please review.

It makes more sense to check in efivars.c, since none of that file can function without runtime serivces.

Could you try the following patch?

It works, thanks for the patch.

Quoted 18 lines

---

drivers/firmware/efi/efivars.c +3 -0
index 8bd1bb6..8a7432a 100644
@@ -583,6 +583,9 @@ int efivars_sysfs_init(void)
 	struct kobject *parent_kobj = efivars_kobject();
 	int error = 0;
 
+	if (!efi_enabled(EFI_RUNTIME_SERVICES))
+		return -ENODEV;
+
 	/* No efivars has been registered yet */
 	if (!parent_kobj)
 		return 0;
Signature · 2 lines
Thanks
Dave