Skip to content

Commit

Permalink
x86, smp: refactor ->store/restore_NMI_vector() methods
Browse files Browse the repository at this point in the history
Only NUMAQ does something substantial here, because it initializes
via NMIs (not via INIT as standard SMP startup) - so it needs to
store and restore the NMI vector.

 - extend the generic code to handle NULL methods

 - clear out dummy methods and replace them with NULL

 - clean up: remove wrapper macros, etc.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Ingo Molnar committed Jan 28, 2009
1 parent 333344d commit 7bd06ec
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 34 deletions.
8 changes: 0 additions & 8 deletions arch/x86/include/asm/es7000/wakecpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ static inline void es7000_wait_for_init_deassert(atomic_t *deassert)
return;
}

static inline void store_NMI_vector(unsigned short *high, unsigned short *low)
{
}

static inline void restore_NMI_vector(unsigned short *high, unsigned short *low)
{
}

extern void __inquire_remote_apic(int apicid);

static inline void inquire_remote_apic(int apicid)
Expand Down
8 changes: 0 additions & 8 deletions arch/x86/include/asm/mach-default/mach_wakecpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ static inline void default_wait_for_init_deassert(atomic_t *deassert)
return;
}

static inline void store_NMI_vector(unsigned short *high, unsigned short *low)
{
}

static inline void restore_NMI_vector(unsigned short *high, unsigned short *low)
{
}

#ifdef CONFIG_SMP
extern void __inquire_remote_apic(int apicid);
#else /* CONFIG_SMP */
Expand Down
2 changes: 0 additions & 2 deletions arch/x86/include/asm/mach-generic/mach_wakecpu.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H
#define _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H

#define store_NMI_vector (apic->store_NMI_vector)
#define restore_NMI_vector (apic->restore_NMI_vector)
#define inquire_remote_apic (apic->inquire_remote_apic)

#endif /* _ASM_X86_MACH_GENERIC_MACH_APIC_H */
6 changes: 4 additions & 2 deletions arch/x86/include/asm/numaq/wakecpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ static inline void numaq_smp_callin_clear_local_apic(void)
clear_local_APIC();
}

static inline void store_NMI_vector(unsigned short *high, unsigned short *low)
static inline void
numaq_store_NMI_vector(unsigned short *high, unsigned short *low)
{
printk("Storing NMI vector\n");
*high =
Expand All @@ -24,7 +25,8 @@ static inline void store_NMI_vector(unsigned short *high, unsigned short *low)
*((volatile unsigned short *)phys_to_virt(NUMAQ_TRAMPOLINE_PHYS_LOW));
}

static inline void restore_NMI_vector(unsigned short *high, unsigned short *low)
static inline void
numaq_restore_NMI_vector(unsigned short *high, unsigned short *low)
{
printk("Restoring NMI vector\n");
*((volatile unsigned short *)phys_to_virt(NUMAQ_TRAMPOLINE_PHYS_HIGH)) =
Expand Down
3 changes: 2 additions & 1 deletion arch/x86/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,8 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu)

pr_debug("Setting warm reset code and vector.\n");

store_NMI_vector(&nmi_high, &nmi_low);
if (apic->store_NMI_vector)
apic->store_NMI_vector(&nmi_high, &nmi_low);

smpboot_setup_warm_reset_vector(start_ip);
/*
Expand Down
5 changes: 2 additions & 3 deletions arch/x86/mach-generic/bigsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ struct genapic apic_bigsmp = {
.wait_for_init_deassert = default_wait_for_init_deassert,

.smp_callin_clear_local_apic = NULL,

.store_NMI_vector = store_NMI_vector,
.restore_NMI_vector = restore_NMI_vector,
.store_NMI_vector = NULL,
.restore_NMI_vector = NULL,
.inquire_remote_apic = inquire_remote_apic,
};
4 changes: 2 additions & 2 deletions arch/x86/mach-generic/default.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ struct genapic apic_default = {
.wait_for_init_deassert = default_wait_for_init_deassert,

.smp_callin_clear_local_apic = NULL,
.store_NMI_vector = store_NMI_vector,
.restore_NMI_vector = restore_NMI_vector,
.store_NMI_vector = NULL,
.restore_NMI_vector = NULL,
.inquire_remote_apic = inquire_remote_apic,
};
5 changes: 2 additions & 3 deletions arch/x86/mach-generic/es7000.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ struct genapic apic_es7000 = {

/* Nothing to do for most platforms, since cleared by the INIT cycle: */
.smp_callin_clear_local_apic = NULL,

.store_NMI_vector = store_NMI_vector,
.restore_NMI_vector = restore_NMI_vector,
.store_NMI_vector = NULL,
.restore_NMI_vector = NULL,
.inquire_remote_apic = inquire_remote_apic,
};
4 changes: 2 additions & 2 deletions arch/x86/mach-generic/numaq.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ struct genapic apic_numaq = {
.wait_for_init_deassert = NULL,

.smp_callin_clear_local_apic = numaq_smp_callin_clear_local_apic,
.store_NMI_vector = store_NMI_vector,
.restore_NMI_vector = restore_NMI_vector,
.store_NMI_vector = numaq_store_NMI_vector,
.restore_NMI_vector = numaq_restore_NMI_vector,
.inquire_remote_apic = inquire_remote_apic,
};
5 changes: 2 additions & 3 deletions arch/x86/mach-generic/summit.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ struct genapic apic_summit = {
.wait_for_init_deassert = default_wait_for_init_deassert,

.smp_callin_clear_local_apic = NULL,

.store_NMI_vector = store_NMI_vector,
.restore_NMI_vector = restore_NMI_vector,
.store_NMI_vector = NULL,
.restore_NMI_vector = NULL,
.inquire_remote_apic = inquire_remote_apic,
};

0 comments on commit 7bd06ec

Please sign in to comment.