Skip to contentSkip to conversation

i386 need to pass virtual address to smp_read_mpc()

PATCH In review Daniel Yeisley 2 participants 3 messages Feb 17, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i386 need to pass virtual address to smp_read_mpc()

I'm seeing a kernel panic on an ES7000-600 when booting in virtual wire mode. The panic happens because smp_read_mpc() is passed a physical address, and it should be virtual. I tested the attached patch on the ES7000-600 and on a 2 cpu Dell box, and saw no problems on either.

---

arch/i386/kernel/mpparse.c 2006-02-16 04:51:35.551014272 -0500 renamed from arch/i386/kernel/mpparse.c 2006-01-30 18:38:18.000000000 -0500 +1 -1
diff -Naur -p linux-2.6.16-rc1-git3-7/arch/i386/kernel/mpparse.c linux-2.6.16-rc1-git3-7-a/arch/i386/kernel/mpparse.c
@@ -710,7 +710,7 @@ void __init get_smp_config (void)
                 * Read the physical hardware table.  Anything here will
                 * override the defaults.
                 */
-               if (!smp_read_mpc((void *)mpf->mpf_physptr)) {
+               if (!smp_read_mpc(phys_to_virt(mpf->mpf_physptr)))
                        smp_found_config = 0;
                        printk(KERN_ERR "BIOS bug, MP table errors detected!...\n");
                        printk(KERN_ERR "... disabling SMP support. (tell your hw vendor)\n");
#1 lore raw
Quoted 4 lines · Daniel Yeisley

I'm seeing a kernel panic on an ES7000-600 when booting in virtual wire mode. The panic happens because smp_read_mpc() is passed a physical address, and it should be virtual. I tested the attached patch on the ES7000-600 and on a 2 cpu Dell box, and saw no problems on either.

Looks obviously correct. Should probably be in 2.6.16

-Andi

Quoted 19 lines

---

diff -Naur -p linux-2.6.16-rc1-git3-7/arch/i386/kernel/mpparse.c linux-2.6.16-rc1-git3-7-a/arch/i386/kernel/mpparse.c

arch/i386/kernel/mpparse.c 2006-02-16 04:51:35.551014272 -0500 renamed from arch/i386/kernel/mpparse.c 2006-01-30 18:38:18.000000000 -0500 +1 -1
@@ -710,7 +710,7 @@ void __init get_smp_config (void)
                 * Read the physical hardware table.  Anything here will
                 * override the defaults.
                 */
-               if (!smp_read_mpc((void *)mpf->mpf_physptr)) {
+               if (!smp_read_mpc(phys_to_virt(mpf->mpf_physptr)))
                        smp_found_config = 0;
                        printk(KERN_ERR "BIOS bug, MP table errors detected!...\n");
                        printk(KERN_ERR "... disabling SMP support. (tell your hw vendor)\n");
#2 lore raw
In reply to Daniel Yeisley
Quoted 12 lines · Daniel Yeisley

I'm seeing a kernel panic on an ES7000-600 when booting in virtual wire mode. The panic happens because smp_read_mpc() is passed a physical address, and it should be virtual. I tested the attached patch on the ES7000-600 and on a 2 cpu Dell box, and saw no problems on either.

---

diff -Naur -p linux-2.6.16-rc1-git3-7/arch/i386/kernel/mpparse.c linux-2.6.16-rc1-git3-7-a/arch/i386/kernel/mpparse.c

arch/i386/kernel/mpparse.c 2006-02-16 04:51:35.551014272 -0500 void __init get_smp_config (void) · line 713

Quoted 5 lines
arch/i386/kernel/mpparse.c 2006-02-16 04:51:35.551014272 -0500 renamed from arch/i386/kernel/mpparse.c 2006-01-30 18:38:18.000000000 -0500 +1 -1
@@ -710,7 +710,7 @@ void __init get_smp_config (void)
                 * Read the physical hardware table.  Anything here will
                 * override the defaults.
                 */
-               if (!smp_read_mpc((void *)mpf->mpf_physptr)) {
+               if (!smp_read_mpc(phys_to_virt(mpf->mpf_physptr)))

Actually the patch is broken. Andrew, if you merge it please add the missing { here.

Dan, please only submit patches that are compile tested at least.

-Andi

Quoted 6 lines
arch/i386/kernel/mpparse.c 2006-02-16 04:51:35.551014272 -0500 renamed from arch/i386/kernel/mpparse.c 2006-01-30 18:38:18.000000000 -0500 +0 -0
                        smp_found_config = 0;
                        printk(KERN_ERR "BIOS bug, MP table errors detected!...\n");
                        printk(KERN_ERR "... disabling SMP support. (tell your hw vendor)\n");