Skip to contentSkip to conversation

/sys/firmware/efi/systab giving incorrect value for smbios

PATCH In review Matthew Garrett 2 participants 5 messages Mar 4, 2006 EFI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 /sys/firmware/efi/systab giving incorrect value for smbios

On my Intel imac, /sys/firmware/efi/systab is the following:

ACPI20=0x1fefd014
ACPI=0x1fefd000
SMBIOS=0x9fec9000

if I have a kernel with a 2:2 user/kernel split, and

SMBIOS=0x5fec9000

if I have a kernel with a 3:1 split. The correct value is 0x1fec9000, which is what the kernel prints at boot time. The following trivial patch seems to fix things.

arch/i386/kernel/efi.c +1 -1
index ecad519..6be705e 100644
@@ -391,7 +391,7 @@ void __init efi_init(void)
 			printk(KERN_INFO " ACPI=0x%lx ", config_tables[i].table);
 		} else
 		    if (efi_guidcmp(config_tables[i].guid, SMBIOS_TABLE_GUID) == 0) {
-			efi.smbios = (void *) config_tables[i].table;
+			efi.smbios = __va(config_tables[i].table);
 			printk(KERN_INFO " SMBIOS=0x%lx ", config_tables[i].table);
 		} else
 		    if (efi_guidcmp(config_tables[i].guid, HCDP_TABLE_GUID) == 0) {
Signature · 1 line
Matthew Garrett | [email protected]
#1 lore raw

PATCH 1/1 Remove __init from efi_get_time

The comment above efi_get_time claims:

Note, this call isn't used later, so mark it __init.

Unfortunately, it's not true - it's called during suspend as well, leading to nasty explosions.

arch/i386/kernel/efi.c +2 -2
index ecad519..6be705e 100644
@@ -193,9 +193,9 @@ inline int efi_set_rtc_mmss(unsigned lon
 /*
  * This should only be used during kernel init and before runtime
  * services have been remapped, therefore, we'll need to call in physical
- * mode.  Note, this call isn't used later, so mark it __init.
+ * mode.
  */
-inline unsigned long __init efi_get_time(void)
+inline unsigned long efi_get_time(void)
 {
 	efi_status_t status;
 	efi_time_t eft;
include/linux/efi.h +1 -1
index c7c5dd3..9e97bc2 100644
@@ -295,7 +295,7 @@ extern u64 efi_mem_attributes (unsigned 
 extern int __init efi_uart_console_only (void);
 extern void efi_initialize_iomem_resources(struct resource *code_resource,
 					struct resource *data_resource);
-extern unsigned long __init efi_get_time(void);
+extern unsigned long efi_get_time(void);
 extern int __init efi_set_rtc_mmss(unsigned long nowtime);
 extern struct efi_memory_map memmap;
 
Signature · 1 line
Matthew Garrett | [email protected]
#2 lore raw
In reply to Matthew Garrett

Or, as an alternative, remove the virtual to physical mapping that efivars does. This requires fixing up IA64 to match. I've no idea which approach is right.

drivers/firmware/efivars.c +1 -1
index bda5bce..ba598af 100644
@@ -575,7 +575,7 @@ systab_read(struct subsystem *entry, cha
 	if (efi.acpi)
 		str += sprintf(str, "ACPI=0x%lx\n", __pa(efi.acpi));
 	if (efi.smbios)
-		str += sprintf(str, "SMBIOS=0x%lx\n", __pa(efi.smbios));
+		str += sprintf(str, "SMBIOS=0x%lx\n", efi.smbios);
 	if (efi.hcdp)
 		str += sprintf(str, "HCDP=0x%lx\n", __pa(efi.hcdp));
 	if (efi.boot_info)
arch/ia64/kernel/efi.c +1 -1
index a3aa45c..ff3795b 100644
@@ -451,7 +451,7 @@ efi_init (void)
 			efi.acpi = __va(config_tables[i].table);
 			printk(" ACPI=0x%lx", config_tables[i].table);
 		} else if (efi_guidcmp(config_tables[i].guid, SMBIOS_TABLE_GUID) == 0) {
-			efi.smbios = __va(config_tables[i].table);
+			efi.smbios = config_tables[i].table;
 			printk(" SMBIOS=0x%lx", config_tables[i].table);
 		} else if (efi_guidcmp(config_tables[i].guid, SAL_SYSTEM_TABLE_GUID) == 0) {
 			efi.sal_systab = __va(config_tables[i].table);
Signature · 1 line
Matthew Garrett | [email protected]
#3 lore raw

Hi.

Do you have any idea why the kernel crashes on machines with more then 512 MB ram ?

cu

gimli

Quoted 33 lines · Matthew Garrett

Or, as an alternative, remove the virtual to physical mapping that efivars does. This requires fixing up IA64 to match. I've no idea which approach is right.

drivers/firmware/efivars.c +1 -1
index bda5bce..ba598af 100644
@@ -575,7 +575,7 @@ systab_read(struct subsystem *entry, cha
 	if (efi.acpi)
 		str += sprintf(str, "ACPI=0x%lx\n", __pa(efi.acpi));
 	if (efi.smbios)
-		str += sprintf(str, "SMBIOS=0x%lx\n", __pa(efi.smbios));
+		str += sprintf(str, "SMBIOS=0x%lx\n", efi.smbios);
 	if (efi.hcdp)
 		str += sprintf(str, "HCDP=0x%lx\n", __pa(efi.hcdp));
 	if (efi.boot_info)
arch/ia64/kernel/efi.c +1 -1
index a3aa45c..ff3795b 100644
@@ -451,7 +451,7 @@ efi_init (void)
 			efi.acpi = __va(config_tables[i].table);
 			printk(" ACPI=0x%lx", config_tables[i].table);
 		} else if (efi_guidcmp(config_tables[i].guid, SMBIOS_TABLE_GUID) == 0) {
-			efi.smbios = __va(config_tables[i].table);
+			efi.smbios = config_tables[i].table;
 			printk(" SMBIOS=0x%lx", config_tables[i].table);
 		} else if (efi_guidcmp(config_tables[i].guid, SAL_SYSTEM_TABLE_GUID) == 0) {
 			efi.sal_systab = __va(config_tables[i].table);
#4 lore raw
Quoted 3 lines · gimli

Hi.

Do you have any idea why the kernel crashes on machines with more then 512 MB ram ?

As yet, absolutely none. I don't have access to a 1GB machine - if it's practical to add more, then I'll see what I can do.

Signature · 1 line
Matthew Garrett | [email protected]