* [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
* Re: [BUG] dmi_scan_machine uses uninitialized address on x86 / EFI
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-25 12:28 ` Thomas Jourdan
2009-02-25 22:04 ` H. Peter Anvin
1 sibling, 2 replies; 7+ messages in thread
From: H. Peter Anvin @ 2009-02-24 21:12 UTC (permalink / raw)
To: Thomas Jourdan; +Cc: linux-kernel, Huang Ying, Peter Jones, Yinghai Lu
Thomas Jourdan wrote:
>
> 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.
>
Hi Thomas,
What is the concrete manifestation of the bug (i.e. how critical is it?)
We are late in the 2.6.29-rc cycle, and this patch seems to have some
risk associated with it.
Huang, Peter, Yinghai: any opinions?
-hpa
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [BUG] dmi_scan_machine uses uninitialized address on x86 / EFI
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-25 12:28 ` Thomas Jourdan
1 sibling, 1 reply; 7+ messages in thread
From: Yinghai Lu @ 2009-02-24 21:38 UTC (permalink / raw)
To: H. Peter Anvin; +Cc: Thomas Jourdan, linux-kernel, Huang Ying, Peter Jones
H. Peter Anvin wrote:
> Thomas Jourdan wrote:
>> 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.
>>
>
> Hi Thomas,
>
> What is the concrete manifestation of the bug (i.e. how critical is it?)
> We are late in the 2.6.29-rc cycle, and this patch seems to have some
> risk associated with it.
>
> Huang, Peter, Yinghai: any opinions?
>
should be ok for 2.6.29
YH
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [BUG] dmi_scan_machine uses uninitialized address on x86 / EFI
2009-02-24 21:38 ` Yinghai Lu
@ 2009-02-24 21:42 ` H. Peter Anvin
2009-02-24 21:44 ` Yinghai Lu
0 siblings, 1 reply; 7+ messages in thread
From: H. Peter Anvin @ 2009-02-24 21:42 UTC (permalink / raw)
To: Yinghai Lu; +Cc: Thomas Jourdan, linux-kernel, Huang Ying, Peter Jones
Yinghai Lu wrote:
> should be ok for 2.6.29
Got a feel for what the impact of deferring it to .30 would be?
-hpa
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [BUG] dmi_scan_machine uses uninitialized address on x86 / EFI
2009-02-24 21:42 ` H. Peter Anvin
@ 2009-02-24 21:44 ` Yinghai Lu
0 siblings, 0 replies; 7+ messages in thread
From: Yinghai Lu @ 2009-02-24 21:44 UTC (permalink / raw)
To: H. Peter Anvin; +Cc: Thomas Jourdan, linux-kernel, Huang Ying, Peter Jones
H. Peter Anvin wrote:
> Yinghai Lu wrote:
>> should be ok for 2.6.29
>
> Got a feel for what the impact of deferring it to .30 would be?
>
Not sure, wonder if someone try 2.6.29-rc6 on EFI 32/64 sytem...
YH
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [BUG] dmi_scan_machine uses uninitialized address on x86 / EFI
2009-02-24 21:12 ` H. Peter Anvin
2009-02-24 21:38 ` Yinghai Lu
@ 2009-02-25 12:28 ` Thomas Jourdan
1 sibling, 0 replies; 7+ messages in thread
From: Thomas Jourdan @ 2009-02-25 12:28 UTC (permalink / raw)
To: 'H. Peter Anvin', 'Thomas Jourdan'
Cc: linux-kernel, 'Huang Ying', 'Peter Jones',
'Yinghai Lu'
Hi guys
The bug is not critical. Vanilla kernel works fine without the patch, except for the DMI sysfs stuffs.
Without the patch, if CONFIG_DMI is enabled, I got the "DMI not present or invalid." error message on boot. Then later, if CONFIG_DMIID is enabled, DMI system identification informations won't be exported via sysfs to userspace. The /sys/class/dmi/id entry is not present.
Regards,
Thomas
-----Message d'origine-----
De : H. Peter Anvin [mailto:hpa@zytor.com]
Envoyé : mar. 24 février 2009 22:12
À : Thomas Jourdan
Cc : linux-kernel@vger.kernel.org; Huang Ying; Peter Jones; Yinghai Lu
Objet : Re: [BUG] dmi_scan_machine uses uninitialized address on x86 /
EFI
Thomas Jourdan wrote:
>
> 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.
>
Hi Thomas,
What is the concrete manifestation of the bug (i.e. how critical is it?)
We are late in the 2.6.29-rc cycle, and this patch seems to have some
risk associated with it.
Huang, Peter, Yinghai: any opinions?
-hpa
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.
__________ Information NOD32 3887 (20090224) __________
Ce message a ete verifie par NOD32 Antivirus System.
http://www.nod32.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [BUG] dmi_scan_machine uses uninitialized address on x86 / EFI
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-25 22:04 ` H. Peter Anvin
1 sibling, 0 replies; 7+ messages in thread
From: H. Peter Anvin @ 2009-02-25 22:04 UTC (permalink / raw)
To: Thomas Jourdan; +Cc: linux-kernel
Thomas Jourdan wrote:
> 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.
>
Hi Thomas,
Could you please resend both this patch and the phys_efi_get_time patch
with a Signed-off-by: line so I can apply them?
Thanks,
-hpa
^ 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