Skip to contentSkip to conversation

Fix initialization of wakeup_cpu.

BUGFIX/x86 New Alok Kataria 3 participants 9 messages Feb 10, 2009 – Feb 11, 2009 x86

lore
Share & tools
lore
#0 lore raw

Was originally reported in the..
"Re: [PARAVIRT/x86] BUGFIX: Put a missing paravirt_release_pmd in pgd_dtor" thread

--
With the patches for refactoring of wake_cpu macros, the 32bit code in tip doesn't execute generic_apic_probe if CONFIG_X86_32_NON_STANDARD is not set.

Even on a x86 STANDARD cpu we need to execute the generic_apic_probe function, as we rely on this function to execute the update_genapic quirk which initilizes apic->wakeup_cpu.

Failing to do so results in we making a call to a null function in do_boot_cpu.

The stack trace without the patch goes like this.

Booting processor 1 APIC 0x1 ip 0x6000

BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [<(null)>] (null)
*pdpt = 0000000000839001 *pde = 0000000000c97067 *pte = 0000000000000163 
Oops: 0000 [#1] SMP 
last sysfs file: 
Modules linked in:

Pid: 1, comm: swapper Not tainted (2.6.29-rc4-tip #18) VMware Virtual Platform
EIP: 0062:[<00000000>] EFLAGS: 00010293 CPU: 0
EIP is at 0x0
EAX: 00000001 EBX: 00006000 ECX: c077ed00 EDX: 00006000
ESI: 00000001 EDI: 00000001 EBP: ef04cf40 ESP: ef04cf1c
DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 006a
Process swapper (pid: 1, ti=ef04c000 task=ef050000 task.ti=ef04c000)

Stack:
 c0644e52 00000000 ef04cf24 ef04cf24 c064468d c0886dc0 00000000 c0702aea
 ef055480 00000001 00000101 dead4ead ffffffff ffffffff c08af530 00000000
 c0709715 ef04cf60 ef04cf60 00000001 00000000 00000000 dead4ead ffffffff
Call Trace:
 [<c0644e52>] ? native_cpu_up+0x2de/0x45b
 [<c064468d>] ? do_fork_idle+0x0/0x19
 [<c0645c5e>] ? _cpu_up+0x88/0xe8
 [<c0645d20>] ? cpu_up+0x42/0x4e
 [<c07e7462>] ? kernel_init+0x99/0x14b
 [<c07e73c9>] ? kernel_init+0x0/0x14b
 [<c040375f>] ? kernel_thread_helper+0x7/0x10
Code:  Bad EIP value.

EIP: [<00000000>] 0x0 SS:ESP 006a:ef04cf1c

I think we should call generic_apic_probe unconditionally now.

arch/x86/kernel/setup.c +0 -2
Index: linux-tip-master/arch/x86/kernel/setup.c
===================================================================
@@ -936,9 +936,7 @@
 	map_vsyscall();
 #endif
 
-#if defined(CONFIG_X86_32_NON_STANDARD) || defined(CONFIG_X86_BIGSMP)
 	generic_apic_probe();
-#endif
 
 	early_quirks();
 
#1 lore raw
Quoted 55 lines · Alok Kataria

Was originally reported in the..
"Re: [PARAVIRT/x86] BUGFIX: Put a missing paravirt_release_pmd in pgd_dtor" thread

--
With the patches for refactoring of wake_cpu macros, the 32bit code in tip doesn't execute generic_apic_probe if CONFIG_X86_32_NON_STANDARD is not set.

Even on a x86 STANDARD cpu we need to execute the generic_apic_probe function, as we rely on this function to execute the update_genapic quirk which initilizes apic->wakeup_cpu.

Failing to do so results in we making a call to a null function in do_boot_cpu.

The stack trace without the patch goes like this.

Booting processor 1 APIC 0x1 ip 0x6000

BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [<(null)>] (null)
*pdpt = 0000000000839001 *pde = 0000000000c97067 *pte = 0000000000000163
Oops: 0000 [#1] SMP
last sysfs file:
Modules linked in:

Pid: 1, comm: swapper Not tainted (2.6.29-rc4-tip #18) VMware Virtual Platform
EIP: 0062:[<00000000>] EFLAGS: 00010293 CPU: 0
EIP is at 0x0
EAX: 00000001 EBX: 00006000 ECX: c077ed00 EDX: 00006000
ESI: 00000001 EDI: 00000001 EBP: ef04cf40 ESP: ef04cf1c
DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 006a
Process swapper (pid: 1, ti=ef04c000 task=ef050000 task.ti=ef04c000)

Stack:
 c0644e52 00000000 ef04cf24 ef04cf24 c064468d c0886dc0 00000000 c0702aea
 ef055480 00000001 00000101 dead4ead ffffffff ffffffff c08af530 00000000
 c0709715 ef04cf60 ef04cf60 00000001 00000000 00000000 dead4ead ffffffff
Call Trace:
 [<c0644e52>] ? native_cpu_up+0x2de/0x45b
 [<c064468d>] ? do_fork_idle+0x0/0x19
 [<c0645c5e>] ? _cpu_up+0x88/0xe8
 [<c0645d20>] ? cpu_up+0x42/0x4e
 [<c07e7462>] ? kernel_init+0x99/0x14b
 [<c07e73c9>] ? kernel_init+0x0/0x14b
 [<c040375f>] ? kernel_thread_helper+0x7/0x10
Code:  Bad EIP value.

EIP: [<00000000>] 0x0 SS:ESP 006a:ef04cf1c

I think we should call generic_apic_probe unconditionally now.

Index: linux-tip-master/arch/x86/kernel/setup.c
===================================================================

arch/x86/kernel/setup.c 2009-02-10 11:50:37.000000000 -0800 line 942

Quoted 9 lines
arch/x86/kernel/setup.c 2009-02-10 11:50:37.000000000 -0800 renamed from arch/x86/kernel/setup.c 2009-02-10 11:37:31.000000000 -0800 +0 -2
@@ -936,9 +936,7 @@
       map_vsyscall();
 #endif
 
-#if defined(CONFIG_X86_32_NON_STANDARD) || defined(CONFIG_X86_BIGSMP)
       generic_apic_probe();
-#endif
 
       early_quirks();
 

1. only es7000 and numaq has update_genapic() ==> they need X86_32_NON_STANDARD..
2. also will break 64 bit....

YH

#2 lore raw
Quoted 63 lines · Yinghai Lu
Quoted 62 lines · Alok Kataria

Was originally reported in the..
"Re: [PARAVIRT/x86] BUGFIX: Put a missing paravirt_release_pmd in pgd_dtor" thread

--
With the patches for refactoring of wake_cpu macros, the 32bit code in tip doesn't execute generic_apic_probe if CONFIG_X86_32_NON_STANDARD is not set.

Even on a x86 STANDARD cpu we need to execute the generic_apic_probe function, as we rely on this function to execute the update_genapic quirk which initilizes apic->wakeup_cpu.

Failing to do so results in we making a call to a null function in do_boot_cpu.

The stack trace without the patch goes like this.

Booting processor 1 APIC 0x1 ip 0x6000

BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [<(null)>] (null)
*pdpt = 0000000000839001 *pde = 0000000000c97067 *pte = 0000000000000163
Oops: 0000 [#1] SMP
last sysfs file:
Modules linked in:

Pid: 1, comm: swapper Not tainted (2.6.29-rc4-tip #18) VMware Virtual Platform
EIP: 0062:[<00000000>] EFLAGS: 00010293 CPU: 0
EIP is at 0x0
EAX: 00000001 EBX: 00006000 ECX: c077ed00 EDX: 00006000
ESI: 00000001 EDI: 00000001 EBP: ef04cf40 ESP: ef04cf1c
DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 006a
Process swapper (pid: 1, ti=ef04c000 task=ef050000 task.ti=ef04c000)

Stack:
 c0644e52 00000000 ef04cf24 ef04cf24 c064468d c0886dc0 00000000 c0702aea
 ef055480 00000001 00000101 dead4ead ffffffff ffffffff c08af530 00000000
 c0709715 ef04cf60 ef04cf60 00000001 00000000 00000000 dead4ead ffffffff
Call Trace:
 [<c0644e52>] ? native_cpu_up+0x2de/0x45b
 [<c064468d>] ? do_fork_idle+0x0/0x19
 [<c0645c5e>] ? _cpu_up+0x88/0xe8
 [<c0645d20>] ? cpu_up+0x42/0x4e
 [<c07e7462>] ? kernel_init+0x99/0x14b
 [<c07e73c9>] ? kernel_init+0x0/0x14b
 [<c040375f>] ? kernel_thread_helper+0x7/0x10
Code:  Bad EIP value.

EIP: [<00000000>] 0x0 SS:ESP 006a:ef04cf1c

I think we should call generic_apic_probe unconditionally now.

Index: linux-tip-master/arch/x86/kernel/setup.c
===================================================================

arch/x86/kernel/setup.c 2009-02-10 11:50:37.000000000 -0800 renamed from arch/x86/kernel/setup.c 2009-02-10 11:37:31.000000000 -0800 +0 -2
@@ -936,9 +936,7 @@
       map_vsyscall();
 #endif
 
-#if defined(CONFIG_X86_32_NON_STANDARD) || defined(CONFIG_X86_BIGSMP)
       generic_apic_probe();
-#endif
 
Quoted 5 lines

arch/x86/kernel/setup.c 2009-02-10 11:50:37.000000000 -0800 line 942

Quoted 2 lines
arch/x86/kernel/setup.c 2009-02-10 11:50:37.000000000 -0800 renamed from arch/x86/kernel/setup.c 2009-02-10 11:37:31.000000000 -0800 +0 -0
       early_quirks();
 

1. only es7000 and numaq has update_genapic() ==> they need X86_32_NON_STANDARD..

There is one here too

static struct x86_quirks default_x86_quirks __initdata = {
.update_genapic = default_update_genapic,
}

Quoted 1 line

2. also will break 64 bit....

isn't the default_x86_quirks defined for 64 bit too ?

--
Alok

#3 lore raw
Quoted 70 lines · Alok Kataria
Quoted 59 lines · Yinghai Lu
Quoted 58 lines · Alok Kataria

Was originally reported in the..
"Re: [PARAVIRT/x86] BUGFIX: Put a missing paravirt_release_pmd in pgd_dtor" thread

--
With the patches for refactoring of wake_cpu macros, the 32bit code in tip doesn't execute generic_apic_probe if CONFIG_X86_32_NON_STANDARD is not set.

Even on a x86 STANDARD cpu we need to execute the generic_apic_probe function, as we rely on this function to execute the update_genapic quirk which initilizes apic->wakeup_cpu.

Failing to do so results in we making a call to a null function in do_boot_cpu.

The stack trace without the patch goes like this.

Booting processor 1 APIC 0x1 ip 0x6000

BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [<(null)>] (null)
*pdpt = 0000000000839001 *pde = 0000000000c97067 *pte = 0000000000000163
Oops: 0000 [#1] SMP
last sysfs file:
Modules linked in:

Pid: 1, comm: swapper Not tainted (2.6.29-rc4-tip #18) VMware Virtual Platform
EIP: 0062:[<00000000>] EFLAGS: 00010293 CPU: 0
EIP is at 0x0
EAX: 00000001 EBX: 00006000 ECX: c077ed00 EDX: 00006000
ESI: 00000001 EDI: 00000001 EBP: ef04cf40 ESP: ef04cf1c
DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 006a
Process swapper (pid: 1, ti=ef04c000 task=ef050000 task.ti=ef04c000)

Stack:
 c0644e52 00000000 ef04cf24 ef04cf24 c064468d c0886dc0 00000000 c0702aea
 ef055480 00000001 00000101 dead4ead ffffffff ffffffff c08af530 00000000
 c0709715 ef04cf60 ef04cf60 00000001 00000000 00000000 dead4ead ffffffff
Call Trace:
 [<c0644e52>] ? native_cpu_up+0x2de/0x45b
 [<c064468d>] ? do_fork_idle+0x0/0x19
 [<c0645c5e>] ? _cpu_up+0x88/0xe8
 [<c0645d20>] ? cpu_up+0x42/0x4e
 [<c07e7462>] ? kernel_init+0x99/0x14b
 [<c07e73c9>] ? kernel_init+0x0/0x14b
 [<c040375f>] ? kernel_thread_helper+0x7/0x10
Code:  Bad EIP value.

EIP: [<00000000>] 0x0 SS:ESP 006a:ef04cf1c

I think we should call generic_apic_probe unconditionally now.

Index: linux-tip-master/arch/x86/kernel/setup.c
===================================================================

arch/x86/kernel/setup.c 2009-02-10 11:50:37.000000000 -0800 renamed from arch/x86/kernel/setup.c 2009-02-10 11:37:31.000000000 -0800 +0 -0
@@ -936,9 +936,7 @@
       map_vsyscall();
 #endif
 
Quoted 8 lines

arch/x86/kernel/setup.c 2009-02-10 11:50:37.000000000 -0800 line 942

Quoted 6 lines
arch/x86/kernel/setup.c 2009-02-10 11:50:37.000000000 -0800 renamed from arch/x86/kernel/setup.c 2009-02-10 11:37:31.000000000 -0800 +0 -2
-#if defined(CONFIG_X86_32_NON_STANDARD) || defined(CONFIG_X86_BIGSMP)
       generic_apic_probe();
-#endif
 
       early_quirks();
 

1. only es7000 and numaq has update_genapic() ==> they need X86_32_NON_STANDARD..

Quoted 9 lines

There is one here too

static struct x86_quirks default_x86_quirks __initdata = {
.update_genapic = default_update_genapic,
}

Quoted 1 line

2. also will break 64 bit....

isn't the default_x86_quirks defined for 64 bit too ?

64 bit doesn't have genapic_apic_probe()

need to change that to

#ifdef CONFIG_X86_32
	genapic_apic_probe();

#endif

YH

#4 lore raw
Quoted 11 lines · Yinghai Lu
Quoted 4 lines
Quoted 2 lines

2. also will break 64 bit....

isn't the default_x86_quirks defined for 64 bit too ?

64 bit doesn't have genapic_apic_probe()

need to change that to

#ifdef CONFIG_X86_32
	genapic_apic_probe();

#endif

Ok here it is.
--

With refactoring of wake_cpu macros the 32bit code in tip doesn't execute generic_apic_probe if CONFIG_X86_32_NON_STANDARD is not set.

Even on a x86 STANDARD cpu we need to execute the generic_apic_probe function, as we rely on this function to execute the update_genapic quirk which initilizes apic->wakeup_cpu.

Failing to do so results in we making a call to a null function in do_boot_cpu.

The stack trace without the patch goes like this.

Booting processor 1 APIC 0x1 ip 0x6000

BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [<(null)>] (null)
*pdpt = 0000000000839001 *pde = 0000000000c97067 *pte = 0000000000000163 
Oops: 0000 [#1] SMP 
last sysfs file: 
Modules linked in:

Pid: 1, comm: swapper Not tainted (2.6.29-rc4-tip #18) VMware Virtual Platform
EIP: 0062:[<00000000>] EFLAGS: 00010293 CPU: 0
EIP is at 0x0
EAX: 00000001 EBX: 00006000 ECX: c077ed00 EDX: 00006000
ESI: 00000001 EDI: 00000001 EBP: ef04cf40 ESP: ef04cf1c
DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 006a
Process swapper (pid: 1, ti=ef04c000 task=ef050000 task.ti=ef04c000)

Stack:
 c0644e52 00000000 ef04cf24 ef04cf24 c064468d c0886dc0 00000000 c0702aea
 ef055480 00000001 00000101 dead4ead ffffffff ffffffff c08af530 00000000
 c0709715 ef04cf60 ef04cf60 00000001 00000000 00000000 dead4ead ffffffff
Call Trace:
 [<c0644e52>] ? native_cpu_up+0x2de/0x45b
 [<c064468d>] ? do_fork_idle+0x0/0x19
 [<c0645c5e>] ? _cpu_up+0x88/0xe8
 [<c0645d20>] ? cpu_up+0x42/0x4e
 [<c07e7462>] ? kernel_init+0x99/0x14b
 [<c07e73c9>] ? kernel_init+0x0/0x14b
 [<c040375f>] ? kernel_thread_helper+0x7/0x10
Code:  Bad EIP value.

EIP: [<00000000>] 0x0 SS:ESP 006a:ef04cf1c

I think we should call generic_apic_probe unconditionally for 32 bit now.

arch/x86/kernel/setup.c +1 -1
Index: linux-tip-master/arch/x86/kernel/setup.c
===================================================================
@@ -936,7 +936,7 @@
 	map_vsyscall();
 #endif
 
-#if defined(CONFIG_X86_32_NON_STANDARD) || defined(CONFIG_X86_BIGSMP)
+#ifdef CONFIG_X86_32
 	generic_apic_probe();
 #endif
 
#5 lore raw
Quoted 67 lines · Alok Kataria
Quoted 11 lines · Yinghai Lu
Quoted 4 lines
Quoted 2 lines

2. also will break 64 bit....

isn't the default_x86_quirks defined for 64 bit too ?

64 bit doesn't have genapic_apic_probe()

need to change that to

#ifdef CONFIG_X86_32
	genapic_apic_probe();

#endif

Ok here it is.
--

With refactoring of wake_cpu macros the 32bit code in tip doesn't execute generic_apic_probe if CONFIG_X86_32_NON_STANDARD is not set.

Even on a x86 STANDARD cpu we need to execute the generic_apic_probe function, as we rely on this function to execute the update_genapic quirk which initilizes apic->wakeup_cpu.

Failing to do so results in we making a call to a null function in do_boot_cpu.

The stack trace without the patch goes like this.

Booting processor 1 APIC 0x1 ip 0x6000

BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [<(null)>] (null)
*pdpt = 0000000000839001 *pde = 0000000000c97067 *pte = 0000000000000163 
Oops: 0000 [#1] SMP 
last sysfs file: 
Modules linked in:

Pid: 1, comm: swapper Not tainted (2.6.29-rc4-tip #18) VMware Virtual Platform
EIP: 0062:[<00000000>] EFLAGS: 00010293 CPU: 0
EIP is at 0x0
EAX: 00000001 EBX: 00006000 ECX: c077ed00 EDX: 00006000
ESI: 00000001 EDI: 00000001 EBP: ef04cf40 ESP: ef04cf1c
DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 006a
Process swapper (pid: 1, ti=ef04c000 task=ef050000 task.ti=ef04c000)

Stack:
 c0644e52 00000000 ef04cf24 ef04cf24 c064468d c0886dc0 00000000 c0702aea
 ef055480 00000001 00000101 dead4ead ffffffff ffffffff c08af530 00000000
 c0709715 ef04cf60 ef04cf60 00000001 00000000 00000000 dead4ead ffffffff
Call Trace:
 [<c0644e52>] ? native_cpu_up+0x2de/0x45b
 [<c064468d>] ? do_fork_idle+0x0/0x19
 [<c0645c5e>] ? _cpu_up+0x88/0xe8
 [<c0645d20>] ? cpu_up+0x42/0x4e
 [<c07e7462>] ? kernel_init+0x99/0x14b
 [<c07e73c9>] ? kernel_init+0x0/0x14b
 [<c040375f>] ? kernel_thread_helper+0x7/0x10
Code:  Bad EIP value.

EIP: [<00000000>] 0x0 SS:ESP 006a:ef04cf1c

I think we should call generic_apic_probe unconditionally for 32 bit now.

Index: linux-tip-master/arch/x86/kernel/setup.c
===================================================================

arch/x86/kernel/setup.c line 941

Quoted 7 lines
arch/x86/kernel/setup.c +1 -1
@@ -936,7 +936,7 @@
 	map_vsyscall();
 #endif
 
-#if defined(CONFIG_X86_32_NON_STANDARD) || defined(CONFIG_X86_BIGSMP)
+#ifdef CONFIG_X86_32
 	generic_apic_probe();
 #endif

Please extend 64-bit with generic_apic_probe() instead. (and please also make sure your patches build on a 64-bit defconfig)

Ingo

Applied
#6 lore raw
Quoted 73 lines · Ingo Molnar
Quoted 70 lines · Alok Kataria
Quoted 11 lines · Yinghai Lu
Quoted 4 lines
Quoted 2 lines

2. also will break 64 bit....

isn't the default_x86_quirks defined for 64 bit too ?

64 bit doesn't have genapic_apic_probe()

need to change that to

#ifdef CONFIG_X86_32
	genapic_apic_probe();

#endif

Ok here it is.
--

With refactoring of wake_cpu macros the 32bit code in tip doesn't execute generic_apic_probe if CONFIG_X86_32_NON_STANDARD is not set.

Even on a x86 STANDARD cpu we need to execute the generic_apic_probe function, as we rely on this function to execute the update_genapic quirk which initilizes apic->wakeup_cpu.

Failing to do so results in we making a call to a null function in do_boot_cpu.

The stack trace without the patch goes like this.

Booting processor 1 APIC 0x1 ip 0x6000

BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [<(null)>] (null)
*pdpt = 0000000000839001 *pde = 0000000000c97067 *pte = 0000000000000163 
Oops: 0000 [#1] SMP 
last sysfs file: 
Modules linked in:

Pid: 1, comm: swapper Not tainted (2.6.29-rc4-tip #18) VMware Virtual Platform
EIP: 0062:[<00000000>] EFLAGS: 00010293 CPU: 0
EIP is at 0x0
EAX: 00000001 EBX: 00006000 ECX: c077ed00 EDX: 00006000
ESI: 00000001 EDI: 00000001 EBP: ef04cf40 ESP: ef04cf1c
DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 006a
Process swapper (pid: 1, ti=ef04c000 task=ef050000 task.ti=ef04c000)

Stack:
 c0644e52 00000000 ef04cf24 ef04cf24 c064468d c0886dc0 00000000 c0702aea
 ef055480 00000001 00000101 dead4ead ffffffff ffffffff c08af530 00000000
 c0709715 ef04cf60 ef04cf60 00000001 00000000 00000000 dead4ead ffffffff
Call Trace:
 [<c0644e52>] ? native_cpu_up+0x2de/0x45b
 [<c064468d>] ? do_fork_idle+0x0/0x19
 [<c0645c5e>] ? _cpu_up+0x88/0xe8
 [<c0645d20>] ? cpu_up+0x42/0x4e
 [<c07e7462>] ? kernel_init+0x99/0x14b
 [<c07e73c9>] ? kernel_init+0x0/0x14b
 [<c040375f>] ? kernel_thread_helper+0x7/0x10
Code:  Bad EIP value.

EIP: [<00000000>] 0x0 SS:ESP 006a:ef04cf1c

I think we should call generic_apic_probe unconditionally for 32 bit now.

Index: linux-tip-master/arch/x86/kernel/setup.c
===================================================================

arch/x86/kernel/setup.c +0 -0
@@ -936,7 +936,7 @@
 	map_vsyscall();
 #endif
 
Quoted 7 lines

arch/x86/kernel/setup.c line 941

Quoted 4 lines
arch/x86/kernel/setup.c +1 -1
-#if defined(CONFIG_X86_32_NON_STANDARD) || defined(CONFIG_X86_BIGSMP)
+#ifdef CONFIG_X86_32
 	generic_apic_probe();
 #endif

Please extend 64-bit with generic_apic_probe() instead. (and please also make sure your patches build on a 64-bit defconfig)

I've applied your patch as an interim measure so far, to fix the crash, so please do the cleaner patch ontop of your first patch. Thanks,

Ingo

#7 lore raw
Quoted 84 lines · Ingo Molnar
Quoted 73 lines · Ingo Molnar
Quoted 70 lines · Alok Kataria
Quoted 11 lines · Yinghai Lu
Quoted 4 lines
Quoted 2 lines

2. also will break 64 bit....

isn't the default_x86_quirks defined for 64 bit too ?

64 bit doesn't have genapic_apic_probe()

need to change that to

#ifdef CONFIG_X86_32
	genapic_apic_probe();

#endif

Ok here it is.
--

With refactoring of wake_cpu macros the 32bit code in tip doesn't execute generic_apic_probe if CONFIG_X86_32_NON_STANDARD is not set.

Even on a x86 STANDARD cpu we need to execute the generic_apic_probe function, as we rely on this function to execute the update_genapic quirk which initilizes apic->wakeup_cpu.

Failing to do so results in we making a call to a null function in do_boot_cpu.

The stack trace without the patch goes like this.

Booting processor 1 APIC 0x1 ip 0x6000

BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [<(null)>] (null)
*pdpt = 0000000000839001 *pde = 0000000000c97067 *pte = 0000000000000163 
Oops: 0000 [#1] SMP 
last sysfs file: 
Modules linked in:

Pid: 1, comm: swapper Not tainted (2.6.29-rc4-tip #18) VMware Virtual Platform
EIP: 0062:[<00000000>] EFLAGS: 00010293 CPU: 0
EIP is at 0x0
EAX: 00000001 EBX: 00006000 ECX: c077ed00 EDX: 00006000
ESI: 00000001 EDI: 00000001 EBP: ef04cf40 ESP: ef04cf1c
DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 006a
Process swapper (pid: 1, ti=ef04c000 task=ef050000 task.ti=ef04c000)

Stack:
 c0644e52 00000000 ef04cf24 ef04cf24 c064468d c0886dc0 00000000 c0702aea
 ef055480 00000001 00000101 dead4ead ffffffff ffffffff c08af530 00000000
 c0709715 ef04cf60 ef04cf60 00000001 00000000 00000000 dead4ead ffffffff
Call Trace:
 [<c0644e52>] ? native_cpu_up+0x2de/0x45b
 [<c064468d>] ? do_fork_idle+0x0/0x19
 [<c0645c5e>] ? _cpu_up+0x88/0xe8
 [<c0645d20>] ? cpu_up+0x42/0x4e
 [<c07e7462>] ? kernel_init+0x99/0x14b
 [<c07e73c9>] ? kernel_init+0x0/0x14b
 [<c040375f>] ? kernel_thread_helper+0x7/0x10
Code:  Bad EIP value.

EIP: [<00000000>] 0x0 SS:ESP 006a:ef04cf1c

I think we should call generic_apic_probe unconditionally for 32 bit now.

Index: linux-tip-master/arch/x86/kernel/setup.c
===================================================================

arch/x86/kernel/setup.c +0 -0
@@ -936,7 +936,7 @@
 	map_vsyscall();
 #endif
 
Quoted 7 lines

arch/x86/kernel/setup.c line 941

Quoted 4 lines
arch/x86/kernel/setup.c +1 -1
-#if defined(CONFIG_X86_32_NON_STANDARD) || defined(CONFIG_X86_BIGSMP)
+#ifdef CONFIG_X86_32
 	generic_apic_probe();
 #endif

Please extend 64-bit with generic_apic_probe() instead. (and please also make sure your patches build on a 64-bit defconfig)

Quoted 2 lines

I've applied your patch as an interim measure so far, to fix the crash, so please do the cleaner patch ontop of your first patch. Thanks,

I removed it again. generic_apic_probe() is not always available on 32-bit either.

Ingo

#8 lore raw

PATCH 1/1 x86, apic: make generic_apic_probe() generally available

Quoted 4 lines · Ingo Molnar
Quoted 2 lines

I've applied your patch as an interim measure so far, to fix the crash, so please do the cleaner patch ontop of your first patch. Thanks,

I removed it again. generic_apic_probe() is not always available on 32-bit either.

applied the fix below instead.

Ingo

------------------>

Quoted 1 line

From 160d8dac12932ad6eb4a359b66521e2e3282ea7d Mon Sep 17 00:00:00 2001

From: Ingo Molnar <[email protected]>
Date: Wed, 11 Feb 2009 11:27:39 +0100
Subject: [PATCH] x86, apic: make generic_apic_probe() generally available

Impact: build fix

---
 arch/x86/include/asm/apic.h |    6 ++++++
 arch/x86/kernel/setup.c     |    2 --
 2 files changed, 6 insertions(+), 2 deletions(-)
arch/x86/include/asm/apic.h +6 -0
index f4835a1..fba49f6 100644
@@ -33,7 +33,13 @@
 	} while (0)
 
 
+#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_32)
 extern void generic_apic_probe(void);
+#else
+static inline void generic_apic_probe(void)
+{
+}
+#endif
 
 #ifdef CONFIG_X86_LOCAL_APIC
 
arch/x86/kernel/setup.c +0 -2
index 150e6d0..8fce6c7 100644
@@ -936,9 +936,7 @@ void __init setup_arch(char **cmdline_p)
 	map_vsyscall();
 #endif
 
-#ifdef CONFIG_X86_32
 	generic_apic_probe();
-#endif
 
 	early_quirks();