mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Thomas Jourdan" <tjourdan@interfaceconcept.com>
To: <linux-kernel@vger.kernel.org>
Subject: [BUG] dmi_scan_machine uses uninitialized address on x86 / EFI
Date: Mon, 23 Feb 2009 16:40:29 +0100	[thread overview]
Message-ID: <342F93DAA55A4EE888FBD256CE6044F4@thje6600v> (raw)

[-- 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,

             reply	other threads:[~2009-02-23 11:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-23 15:40 Thomas Jourdan [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=342F93DAA55A4EE888FBD256CE6044F4@thje6600v \
    --to=tjourdan@interfaceconcept.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®