public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [BUG] dmi_scan_machine uses uninitialized address on x86 / EFI
@ 2009-02-23 15:40 Thomas Jourdan
  2009-02-24 21:12 ` H. Peter Anvin
  2009-02-25 22:04 ` H. Peter Anvin
  0 siblings, 2 replies; 7+ messages in thread
From: Thomas Jourdan @ 2009-02-23 15:40 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 462 bytes --]

Hi

On x86/EFI platforms, if efi_enabled is true, the dmi_scan_machine function
fails, even if valid DMI table is present. In the setup_arch function,
efi_init is called after dmi_scan_machine. But this is efi_init which will
initialize the smbios address, needed by dmi_scan_machine.

This leads to dmi_scan_machine ioremapping physical address 0, instead of
the address provided by the EFI system table. The following patch fixes the
problem.

Regards,
Thomas

[-- Attachment #2: dmi_scan.patch --]
[-- Type: application/octet-stream, Size: 989 bytes --]

On x86 / EFI platforms, the SMBIOS table address is available in the EFI
system table. During the setup_arch function, the dmi_scan_machine function
will detect valid DMI table or not. 

If CONFIG_EFI is set, the dmi_scan_table function will use the address provided
by the EFI system table. But it is inialized later, in the efi_init function. 

This patch fixes the call order.

--- linux-2.6.28.6/arch/x86/kernel/setup.c	2009-02-17 18:29:27.000000000 +0100
+++ linux-2.6.28.6/arch/x86/kernel/setup.c	2009-02-23 09:57:57.000000000 +0100
@@ -903,6 +903,9 @@
 
 	finish_e820_parsing();
 
+	if (efi_enabled)
+		efi_init();
+
 	dmi_scan_machine();
 
 	dmi_check_system(bad_bios_dmi_table);
@@ -916,9 +919,6 @@
 	insert_resource(&iomem_resource, &data_resource);
 	insert_resource(&iomem_resource, &bss_resource);
 
-	if (efi_enabled)
-		efi_init();
-
 #ifdef CONFIG_X86_32
 	if (ppro_with_ram_bug()) {
 		e820_update_range(0x70000000ULL, 0x40000ULL, E820_RAM,

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-02-25 22:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-23 15:40 [BUG] dmi_scan_machine uses uninitialized address on x86 / EFI Thomas Jourdan
2009-02-24 21:12 ` H. Peter Anvin
2009-02-24 21:38   ` Yinghai Lu
2009-02-24 21:42     ` H. Peter Anvin
2009-02-24 21:44       ` Yinghai Lu
2009-02-25 12:28   ` Thomas Jourdan
2009-02-25 22:04 ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox