linux-stable/arch
Yinghai Lu 569712b2b0 x86: fix wakeup_cpu with numaq/es7000, v2
Impact: fix secondary-CPU wakeup/init path with numaq and es7000

While looking at wakeup_secondary_cpu for WAKE_SECONDARY_VIA_NMI:

|#ifdef WAKE_SECONDARY_VIA_NMI
|/*
| * Poke the other CPU in the eye via NMI to wake it up. Remember that the normal
| * INIT, INIT, STARTUP sequence will reset the chip hard for us, and this
| * won't ... remember to clear down the APIC, etc later.
| */
|static int __devinit
|wakeup_secondary_cpu(int logical_apicid, unsigned long start_eip)
|{
|        unsigned long send_status, accept_status = 0;
|        int maxlvt;
|...
|        if (APIC_INTEGRATED(apic_version[phys_apicid])) {
|                maxlvt = lapic_get_maxlvt();

I noticed that there is no warning about undefined phys_apicid...

because WAKE_SECONDARY_VIA_NMI and WAKE_SECONDARY_VIA_INIT can not be
defined at the same time. So NUMAQ is using wrong wakeup_secondary_cpu.

WAKE_SECONDARY_VIA_NMI, WAKE_SECONDARY_VIA_INIT and
WAKE_SECONDARY_VIA_MIP are variants of a weird and fragile
preprocessor-driven "HAL" mechanisms to specify the kind of secondary-CPU
wakeup strategy a given x86 kernel will use.

The vast majority of systems want to use INIT for secondary wakeup - NUMAQ
uses an NMI, (old-style-) ES7000 uses 'MIP' (a firmware driven in-memory
flag to let secondaries continue).

So convert these mechanisms to x86_quirks and add a
->wakeup_secondary_cpu() method to specify the rare exception
to the sane default.

Extend genapic accordingly as well, for 32-bit.

While looking further, I noticed that functions in wakecup.h for numaq
and es7000 are different to the default in mach_wakecpu.h - but smpboot.c
will only use default mach_wakecpu.h with smphook.h.

So we need to add mach_wakecpu.h for mach_generic, to properly support
numaq and es7000, and vectorize the following SMP init methods:

	int trampoline_phys_low;
	int trampoline_phys_high;
	void (*wait_for_init_deassert)(atomic_t *deassert);
	void (*smp_callin_clear_local_apic)(void);
	void (*store_NMI_vector)(unsigned short *high, unsigned short *low);
	void (*restore_NMI_vector)(unsigned short *high, unsigned short *low);
	void (*inquire_remote_apic)(int apicid);

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-11-17 17:57:34 +01:00
..
alpha Merge branch 'v28-range-hrtimers-for-linus-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-10-23 10:53:02 -07:00
arm Merge master.kernel.org:/home/rmk/linux-2.6-arm 2008-11-13 11:30:25 -08:00
avr32 Merge branches 'boards' and 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6 2008-10-23 15:24:10 +02:00
blackfin container freezer: implement freezer cgroup subsystem 2008-10-20 08:52:34 -07:00
cris [CRIS] Remove links from CRIS build 2008-10-31 23:37:57 +01:00
frv container freezer: implement freezer cgroup subsystem 2008-10-20 08:52:34 -07:00
h8300 Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/dvrabel/uwb 2008-10-23 08:20:34 -07:00
ia64 KVM: ia64: fix vmm_spin_{un}lock for !CONFIG_SMP 2008-11-11 21:01:30 +02:00
m32r Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rric/oprofile 2008-10-23 10:05:40 -07:00
m68k m68k: Fix off-by-one in m68k_setup_user_interrupt() 2008-11-15 11:36:06 -08:00
m68knommu container freezer: implement freezer cgroup subsystem 2008-10-20 08:52:34 -07:00
mips CHAR: Delete old and now unused M48T35 RTC driver for SGI IP27. 2008-10-30 14:44:35 +00:00
mn10300 MN10300: Don't do misalignment handling for userspace 2008-11-12 10:41:18 -08:00
parisc fix cpumask build breakage on parisc 2008-11-13 11:30:03 -08:00
powerpc powerpc: Update desktop/server defconfigs 2008-11-11 19:42:30 +11:00
s390 [S390] fix s390x_newuname 2008-11-14 18:18:55 +01:00
sh serial: sh-sci: Reorder the SCxTDR write after the TDxE clear. 2008-11-13 17:46:06 +09:00
sparc Revert "sparc: correct section of current_pc()" 2008-11-10 12:33:30 -08:00
sparc64 sparc64: Update defconfig. 2008-11-10 12:35:29 -08:00
um Merge git://git.kernel.org/pub/scm/linux/kernel/git/viro/bdev 2008-10-23 10:23:07 -07:00
x86 x86: fix wakeup_cpu with numaq/es7000, v2 2008-11-17 17:57:34 +01:00
xtensa Merge git://git.kernel.org/pub/scm/linux/kernel/git/czankel/xtensa-2.6 2008-10-23 09:16:56 -07:00
.gitignore
Kconfig Change UTF8 chars in Kconfig help text about Oprofile AMD barcelona 2008-10-27 19:15:39 +01:00