x86: unify genapic code, unify subarchitectures, remove old subarchitecture code
Subsystems (8)
This series of 114 patches implements a long desired restructuring, unification and cleanup of the x86 APIC/SMP/subarch code:
- unifies the 32-bit and 64-bit genapic code
- sorts out all the subarch details into standalone and boot-time probable quirk modules
- removes the build-time subarch hacks that we had on 32-bit.
This inevitably touches an awful lot of x86 code, and rather intrusively so:
112 files changed, 3277 insertions(+), 3209 deletions(-)
So breakages are to be expected. The commits are queued up in tip/x86/apic and are in tip/master as well:
http://people.redhat.com/mingo/tip.git/README
I ported the NUMAQ / Summit / bigsmp and ES7000 subarchitectures to the new setup. They build and boot on regular hardware but are otherwise untested. The x86/Voyager subarch is not fully ported yet (i cleaned up its Kconfig impact) and hence disabled it for the time being. It ought to be relatively straightforward to port it to the new code.
Ingo
----------------------->
arch/x86/Kconfig | 203 ++++----- arch/x86/Kconfig.debug | 2 +- arch/x86/Makefile | 26 -- arch/x86/include/asm/apic.h | 33 ++ arch/x86/include/asm/apm.h | 73 ++++ arch/x86/include/asm/bigsmp/apic.h | 71 ++-- arch/x86/include/asm/bigsmp/apicdef.h | 8 +- arch/x86/include/asm/bigsmp/ipi.h | 16 +- arch/x86/include/asm/cpu.h | 6 +- arch/x86/include/asm/do_timer.h | 16 + arch/x86/include/asm/entry_arch.h | 57 +++ arch/x86/include/asm/es7000/apic.h | 242 ----------- arch/x86/include/asm/es7000/apicdef.h | 13 - arch/x86/include/asm/es7000/ipi.h | 22 - arch/x86/include/asm/es7000/mpparse.h | 29 -- arch/x86/include/asm/es7000/wakecpu.h | 37 -- arch/x86/include/asm/genapic.h | 262 ++++++++++++- arch/x86/include/asm/genapic_32.h | 141 ------ arch/x86/include/asm/genapic_64.h | 60 --- arch/x86/include/asm/hw_irq.h | 6 +- arch/x86/include/asm/ipi.h | 95 ++++- arch/x86/include/asm/mach-default/apm.h | 73 ---- arch/x86/include/asm/mach-default/do_timer.h | 16 - arch/x86/include/asm/mach-default/entry_arch.h | 52 --- arch/x86/include/asm/mach-default/mach_apic.h | 168 -------- arch/x86/include/asm/mach-default/mach_apicdef.h | 24 - arch/x86/include/asm/mach-default/mach_ipi.h | 64 --- arch/x86/include/asm/mach-default/mach_mpparse.h | 17 - arch/x86/include/asm/mach-default/mach_mpspec.h | 12 - arch/x86/include/asm/mach-default/mach_timer.h | 48 --- arch/x86/include/asm/mach-default/mach_traps.h | 33 -- arch/x86/include/asm/mach-default/mach_wakecpu.h | 41 -- arch/x86/include/asm/mach-default/pci-functions.h | 19 - arch/x86/include/asm/mach-default/setup_arch.h | 3 - arch/x86/include/asm/mach-default/smpboot_hooks.h | 61 --- arch/x86/include/asm/mach-generic/gpio.h | 15 - arch/x86/include/asm/mach-generic/mach_apic.h | 35 -- arch/x86/include/asm/mach-generic/mach_apicdef.h | 11 - arch/x86/include/asm/mach-generic/mach_ipi.h | 10 - arch/x86/include/asm/mach-generic/mach_mpparse.h | 9 - arch/x86/include/asm/mach-generic/mach_mpspec.h | 12 - arch/x86/include/asm/mach-generic/mach_wakecpu.h | 12 - arch/x86/include/asm/mach_timer.h | 48 +++ arch/x86/include/asm/mach_traps.h | 33 ++ arch/x86/include/asm/mpspec.h | 33 ++- arch/x86/include/asm/numaq/apic.h | 142 ------- arch/x86/include/asm/numaq/apicdef.h | 14 - arch/x86/include/asm/numaq/ipi.h | 22 - arch/x86/include/asm/numaq/mpparse.h | 6 - arch/x86/include/asm/numaq/wakecpu.h | 45 -- arch/x86/include/asm/pci-functions.h | 19 + arch/x86/include/asm/proto.h | 4 - arch/x86/include/asm/setup_arch.h | 3 + arch/x86/include/asm/smp.h | 19 - arch/x86/include/asm/smpboot_hooks.h | 61 +++ arch/x86/include/asm/summit/apic.h | 202 --------- arch/x86/include/asm/summit/apicdef.h | 13 - arch/x86/include/asm/summit/ipi.h | 26 -- arch/x86/include/asm/summit/mpparse.h | 109 ----- arch/x86/kernel/Makefile | 11 +- arch/x86/kernel/acpi/boot.c | 25 +- arch/x86/kernel/apic.c | 46 ++- arch/x86/kernel/apm_32.c | 2 +- arch/x86/kernel/bigsmp_32.c | 268 ++++++++++++ arch/x86/kernel/cpu/addon_cpuid_features.c | 20 +- arch/x86/kernel/cpu/amd.c | 2 +- arch/x86/kernel/cpu/common.c | 19 +- arch/x86/kernel/cpu/intel.c | 2 +- arch/x86/kernel/crash.c | 2 +- arch/x86/kernel/entry_32.S | 2 +- arch/x86/kernel/es7000_32.c | 468 ++++++++++++++++++++- arch/x86/kernel/genapic_64.c | 22 +- arch/x86/kernel/genapic_flat_64.c | 176 ++++++--- arch/x86/kernel/genx2apic_cluster.c | 133 ++++-- arch/x86/kernel/genx2apic_phys.c | 125 ++++--- arch/x86/kernel/genx2apic_uv_x.c | 111 ++++-- arch/x86/kernel/io_apic.c | 197 ++++----- arch/x86/kernel/ipi.c | 33 +- arch/x86/kernel/irq_32.c | 2 +- arch/x86/kernel/kgdb.c | 4 +- arch/x86/kernel/mpparse.c | 26 +- arch/x86/kernel/nmi.c | 2 +- arch/x86/kernel/numaq_32.c | 280 ++++++++++++- arch/x86/kernel/probe_32.c | 411 ++++++++++++++++++ arch/x86/kernel/probe_roms_32.c | 2 +- arch/x86/kernel/process.c | 2 +- arch/x86/kernel/reboot.c | 4 +- arch/x86/kernel/setup.c | 30 +- arch/x86/kernel/smp.c | 13 +- arch/x86/kernel/smpboot.c | 37 +- arch/x86/kernel/summit_32.c | 417 ++++++++++++++++++- arch/x86/kernel/time_32.c | 2 +- arch/x86/kernel/tlb_uv.c | 2 +- arch/x86/kernel/traps.c | 2 +- arch/x86/kernel/tsc.c | 2 +- arch/x86/kernel/visws_quirks.c | 6 +- arch/x86/kernel/vmiclock_32.c | 2 +- arch/x86/mach-default/setup.c | 162 ------- arch/x86/mach-generic/Makefile | 11 - arch/x86/mach-generic/bigsmp.c | 60 --- arch/x86/mach-generic/default.c | 27 -- arch/x86/mach-generic/es7000.c | 103 ----- arch/x86/mach-generic/numaq.c | 53 --- arch/x86/mach-generic/probe.c | 152 ------- arch/x86/mach-generic/summit.c | 40 -- arch/x86/mm/Makefile | 2 +- arch/x86/mm/tlb.c | 4 +- arch/x86/pci/numaq_32.c | 2 +- arch/x86/pci/pcbios.c | 2 +- drivers/clocksource/acpi_pm.c | 2 +- drivers/clocksource/cyclone.c | 2 +- drivers/mtd/nand/Kconfig | 2 +- 112 files changed, 3277 insertions(+), 3209 deletions(-)
Ingo Molnar (114):
x86, genapic: refactor genapic_64.h
x86, genapic: refactor genapic_32.h
x86, genapic: unify struct genapic
x86, genapic: finish unification
x86, genapic: cleanups
x86, genapic: provide IPI callbacks unconditionally
x86: rename 'genapic' to 'apic'
x86: clean up genapic_flat
x86: clean up genapic_phys_flat
x86: clean up apic_x2apic_uv_x
x86: clean up apic_x2apic_phys
x86: clean up apic_x2apic_cluster
x86, genapic: cleanup 32-bit apic_default template
x86, genapic: cleanup 32-bit apic_bigsmp template
x86, genapic: cleanup 32-bit apic_numaq template
x86, genapic: cleanup 32-bit apic_es7000 template
x86, genapic: cleanup 32-bit apic_summit template
x86: remove APIC_INIT / APICFUNC / IPIFUNC
x86: clean up apic->acpi_madt_oem_check methods
x86: clean up apic->apic_id_registered() methods
x86, genapic: rename int_delivery_mode, et. al.
x86, apic: remove IRQ_DEST_MODE / IRQ_DELIVERY_MODE
x86, apic: remove DEFAULT_IRQ_DELIVERY_MODE and DEFAULT_IRQ_DEST_MODE x86, apic: remove SUMMIT_IRQ_DELIVERY_MODE and SUMMIT_IRQ_DEST_MODE x86, apic: remove NUMAQ_IRQ_DELIVERY_MODE and NUMAQ_IRQ_DEST_MODE x86, apic: remove BIGSMP_IRQ_DELIVERY_MODE and BIGSMP_IRQ_DEST_MODE x86, apic: remove ES7000_IRQ_DELIVERY_MODE and ES7000_IRQ_DEST_MODE x86, apic: remove IRQ_DEST_MODE
x86, apic: clean up target_cpus methods
x86, apic: clean up / remove TARGET_CPUS
x86: clean up esr_disable() methods
x86: rename ->ESR_DISABLE to ->disable_esr
x86: clean up the APIC_DEST_LOGICAL logic
x86, apic: rename genapic::apic_destination_logical to genapic::dest_logical x86, apic: clean up check_apicid*() callbacks
x86, apic: remove no_balance_irq and no_ioapic_check flags
x86, apic: clean up ->vector_allocation_domain()
x86, apic: clean up ->init_apic_ldr()
x86, apic: clean up ->ioapic_phys_id_map()
x86, apic: clean up ->setup_apic_routing()
x86, apic: streamline the ->multi_timer_check() quirk
x86, apic: clean up ->apicid_to_node()
x86, apic: clean up ->cpu_to_logical_apicid()
x86, apic: clean up ->cpu_present_to_apicid()
x86, apic: clean up ->apicid_to_cpu_present()
x86: refactor ->setup_portio_remap() subarch methods
x86: refactor ->check_phys_apicid_present() subarch methods
x86: refactor ->enable_apic_mode() subarch methods
x86, es7000: clean up es7000_enable_apic_mode()
x86, apic: unify phys_pkg_id()
x86, apic: refactor ->phys_pkg_id()
x86, smp: clean up mps_oem_check()
x86, mpparse: call the generic quirk handlers early
x86: consolidate the ->mps_oem_check() code
x86, apic: refactor ->get_apic_id() & GET_APIC_ID()
x86, apic: refactor ->apic_id_mask & APIC_ID_MASK
x86, apic: get rid of *_APIC_ID_MASK definitions
x86, apic: refactor ->cpu_mask_to_apicid*()
x86, apic: untangle the send_IPI_*() jungle
x86, smp: clean up ->trampoline_phys_low/high handling
x86: set ->trampoline_phys_low/high on 64-bit too
x86, smp: refactor ->wait_for_init_deassert()
x86, smp: refactor ->smp_callin_clear_local_apic() methods
x86, smp: refactor ->store/restore_NMI_vector() methods
x86, smp: remove ->restore_NMI_vector()
x86, smp: refactor ->inquire_remote_apic() methods
x86, ES7000: consolidate the APIC code
x86, smp: eliminate asm/mach-default/mach_wakecpu.h
x86: eliminate asm/mach-*/mach_mpparse.h
x86: remove mach_mpspec.h
x86: remove mach_apicdef.h
x86, smp: refactor ->wake_cpu
x86, numaq: consolidate code
x86, summit: consolidate code
x86: remove mach_apic.h
x86, ES7000: Consolidate code
x86, NUMAQ: Consolidate code
x86, bigsmp: consolidate code
x86, bigsmp: consolidate header code
x86, smp: remove mach_ipi.h
x86: remove subarchitecture support code
x86: move mach-default/*.h files to asm/
x86: remove subarchitecture support
x86/Voyager: clean up BROKEN Kconfig reference
x86: disable Voyager temporarily
x86/Voyager: remove MCA Kconfig quirk
x86/Voyager: remove NATSEMI Kconfig quirk
x86/Voyager: remove KVM Kconfig quirk
x86/Voyager: remove KGDB Kconfig quirk
x86/Voyager: remove HIBERNATION Kconfig quirk
x86/Voyager: remove ARCH_SUSPEND_POSSIBLE Kconfig quirk
x86: replace CONFIG_X86_SMP with CONFIG_SMP
x86: generalize boot_cpu_id
x86/Voyager: remove X86_HT Kconfig quirk
x86/Voyager: remove X86_BIOS_REBOOT Kconfig quirk
x86/Voyager: remove X86_FIND_SMP_CONFIG Kconfig quirk x86/VisWS: remove Kconfig quirk
x86/Voyager: remove VMI Kconfig quirk
x86/Voyager: remove KVM_CLOCK quirk
x86/Voyager: remove KVM_GUEST quirk
x86/Voyager: remove PARAVIRT Kconfig quirk
x86/Voyager: remove APIC/IO-APIC Kbuild quirk
x86/Voyager: remove MCE quirk
x86/Voyager: remove HOTPLUG_CPU Kconfig quirk
x86/Voyager: remove power management Kconfig quirk
x86/Voyager: remove ISA quirk
x86: cleanup, introduce CONFIG_NON_STANDARD_PLATFORMS
x86: move ELAN to the NON_STANDARD_PLATFORM section
x86: move VOYAGER to the NON_STANDARD_PLATFORM section
x86: move non-standard 32-bit platform Kconfig entries
x86: move X86_VSMP from subarch menu
x86: remove the subarch menu
x86: rename X86_GENERICARCH to X86_32_NON_STANDARD
x86/Voyager: move to the X86_32_NON_STANDARD code section
PATCH 1/114 x86, genapic: refactor genapic_64.h
Impact: pre unification cleanup
Make genapic_64.h similar to genapic_32.h: reorder fields, unify types and bring in new entries.
No existing functionality is affected.
--- arch/x86/include/asm/genapic_64.h | 68 ++++++++++++++++++++++++++++++++----- 1 files changed, 59 insertions(+), 9 deletions(-)
arch/x86/include/asm/genapic_64.h +59 -9
@@ -16,13 +16,62 @@struct genapic {char *name; + +int (*probe)(void );int (*acpi_madt_oem_check)(char *oem_id,char *oem_table_id); +int (*apic_id_registered)(void ); +u32 int_delivery_mode;u32 int_dest_mode; -int (*apic_id_registered)(void ); +const struct cpumask *(*target_cpus)(void ); + +int ESR_DISABLE; + +int apic_destination_logical; +unsigned long (*check_apicid_used)(physid_mask_t bitmap,int apicid); +unsigned long (*check_apicid_present)(int apicid); + +int no_balance_irq; +int no_ioapic_check; +void (*vector_allocation_domain)(int cpu,struct cpumask *retmask);void (*init_apic_ldr)(void ); + +physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map); + +void (*setup_apic_routing)(void ); +int (*multi_timer_check)(int apic,int irq); +int (*apicid_to_node)(int logical_apicid); +int (*cpu_to_logical_apicid)(int cpu); +int (*cpu_present_to_apicid)(int mps_cpu); +physid_mask_t (*apicid_to_cpu_present)(int phys_apicid); +void (*setup_portio_remap)(void ); +int (*check_phys_apicid_present)(int boot_cpu_physical_apicid); +void (*enable_apic_mode)(void ); +#ifdef CONFIG_X86_32 +u32 (*phys_pkg_id)(u32 cpuid_apic,int index_msb); +#else +unsigned int (*phys_pkg_id)(int index_msb); +#endif + +/* +* When one of the next two hooks returns 1 the genapic +* is switched to this. Essentially they are additional +* probe functions: +*/ +int (*mps_oem_check)(struct mpc_table *mpc,char *oem, +char *productid); + +unsigned int (*get_apic_id)(unsigned long x); +unsigned long (*set_apic_id)(unsigned int id); +unsigned long apic_id_mask; + +unsigned int (*cpu_mask_to_apicid)(const struct cpumask *cpumask); +unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask, +const struct cpumask *andmask); + +#ifdef CONFIG_SMP /* ipi */ void (*send_IPI_mask)(const struct cpumask *mask,int vector); void (*send_IPI_mask_allbutself)(const struct cpumask *mask,
@@ -30,16 +79,17 @@ struct genapic {void (*send_IPI_allbutself)(int vector);void (*send_IPI_all)(int vector);void (*send_IPI_self)(int vector); -/* */ -unsigned int (*cpu_mask_to_apicid)(const struct cpumask *cpumask); -unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask, -const struct cpumask *andmask); -unsigned int (*phys_pkg_id)(int index_msb); -unsigned int (*get_apic_id)(unsigned long x); -unsigned long (*set_apic_id)(unsigned int id); -unsigned long apic_id_mask; +#endif /* wakeup_secondary_cpu */ int (*wakeup_cpu)(int apicid,unsigned long start_eip); + +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); };extern struct genapic *genapic;
Signature · 1 line
1.6.0.2
PATCH 2/114 x86, genapic: refactor genapic_32.h
In reply to Ingo MolnarImpact: pre unification cleanup
Make genapic_32.h similar to genapic_64.h: reorder fields, unify types and bring in new entries.
No existing functionality is affected.
--- arch/x86/include/asm/genapic_32.h | 37 +++++++++++++++++++++++++++---------- 1 files changed, 27 insertions(+), 10 deletions(-)
arch/x86/include/asm/genapic_32.h +27 -10
@@ -21,19 +21,28 @@ struct mpc_cpu;struct genapic {char *name; -int (*probe)(void ); +int (*probe)(void ); +int (*acpi_madt_oem_check)(char *oem_id,char *oem_table_id);int (*apic_id_registered)(void ); + +u32 int_delivery_mode; +u32 int_dest_mode; +const struct cpumask *(*target_cpus)(void ); -int int_delivery_mode; -int int_dest_mode; +int ESR_DISABLE; +int apic_destination_logical;unsigned long (*check_apicid_used)(physid_mask_t bitmap,int apicid);unsigned long (*check_apicid_present)(int apicid); +int no_balance_irq;int no_ioapic_check; + +void (*vector_allocation_domain)(int cpu,struct cpumask *retmask);void (*init_apic_ldr)(void ); +physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map);void (*setup_apic_routing)(void );
@@ -45,22 +54,27 @@ struct genapic {void (*setup_portio_remap)(void );int (*check_phys_apicid_present)(int boot_cpu_physical_apicid);void (*enable_apic_mode)(void ); +#ifdef CONFIG_X86_32 u32 (*phys_pkg_id)(u32 cpuid_apic,int index_msb); +#else +unsigned int (*phys_pkg_id)(int index_msb); +#endif -/* mpparse */ -/* When one of the next two hooks returns 1 the genapic -is switched to this. Essentially they are additional probe -functions. */ +/* +* When one of the next two hooks returns 1 the genapic +* is switched to this. Essentially they are additional +* probe functions: +*/ int (*mps_oem_check)(struct mpc_table *mpc,char *oem,char *productid); -int (*acpi_madt_oem_check)(char *oem_id,char *oem_table_id); -unsigned (*get_apic_id)(unsigned long x); +unsigned int (*get_apic_id)(unsigned long x); +unsigned long (*set_apic_id)(unsigned int id);unsigned long apic_id_mask; +unsigned int (*cpu_mask_to_apicid)(const struct cpumask *cpumask);unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask,const struct cpumask *andmask); -void (*vector_allocation_domain)(int cpu,struct cpumask *retmask);#ifdef CONFIG_SMP /* ipi */
@@ -69,8 +83,11 @@ struct genapic { int vector);void (*send_IPI_allbutself)(int vector);void (*send_IPI_all)(int vector); +void (*send_IPI_self)(int vector);#endif +/* wakeup_secondary_cpu */ int (*wakeup_cpu)(int apicid,unsigned long start_eip); +int trampoline_phys_low;int trampoline_phys_high;void (*wait_for_init_deassert)(atomic_t *deassert);
Signature · 1 line
1.6.0.2
PATCH 3/114 x86, genapic: unify struct genapic
In reply to Ingo MolnarMove over the (now identical) struct genapic definitions from genapic_32/64.h to genapic.h.
--- arch/x86/include/asm/genapic.h | 96 +++++++++++++++++++++++++++ arch/x86/include/asm/genapic_32.h | 93 -------------------------- arch/x86/include/asm/genapic_64.h | 129 ++++++------------------------------- 3 files changed, 115 insertions(+), 203 deletions(-)
rewrite arch/x86/include/asm/genapic_64.h (84%)
arch/x86/include/asm/genapic.h +96 -0
@@ -1,5 +1,101 @@ +#ifndef _ASM_X86_GENAPIC_H +#define _ASM_X86_GENAPIC_H + +#include <linux/cpumask.h> + +/* +* Copyright 2004 James Cleverdon, IBM. +* Subject to the GNU Public License, v.2 +* +* Generic APIC sub-arch data struct. +* +* Hacked for x86-64 by James Cleverdon from i386 architecture code by +* Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and +* James Cleverdon. +*/ + +struct genapic { +char *name; + +int (*probe)(void ); +int (*acpi_madt_oem_check)(char *oem_id,char *oem_table_id); +int (*apic_id_registered)(void ); + +u32 int_delivery_mode; +u32 int_dest_mode; + +const struct cpumask *(*target_cpus)(void ); + +int ESR_DISABLE; + +int apic_destination_logical; +unsigned long (*check_apicid_used)(physid_mask_t bitmap,int apicid); +unsigned long (*check_apicid_present)(int apicid); + +int no_balance_irq; +int no_ioapic_check; + +void (*vector_allocation_domain)(int cpu,struct cpumask *retmask); +void (*init_apic_ldr)(void ); + +physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map); + +void (*setup_apic_routing)(void ); +int (*multi_timer_check)(int apic,int irq); +int (*apicid_to_node)(int logical_apicid); +int (*cpu_to_logical_apicid)(int cpu); +int (*cpu_present_to_apicid)(int mps_cpu); +physid_mask_t (*apicid_to_cpu_present)(int phys_apicid); +void (*setup_portio_remap)(void ); +int (*check_phys_apicid_present)(int boot_cpu_physical_apicid); +void (*enable_apic_mode)(void ); +#ifdef CONFIG_X86_32 +u32 (*phys_pkg_id)(u32 cpuid_apic,int index_msb); +#else +unsigned int (*phys_pkg_id)(int index_msb); +#endif + +/* +* When one of the next two hooks returns 1 the genapic +* is switched to this. Essentially they are additional +* probe functions: +*/ +int (*mps_oem_check)(struct mpc_table *mpc,char *oem, +char *productid); + +unsigned int (*get_apic_id)(unsigned long x); +unsigned long (*set_apic_id)(unsigned int id); +unsigned long apic_id_mask; + +unsigned int (*cpu_mask_to_apicid)(const struct cpumask *cpumask); +unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask, +const struct cpumask *andmask); + +#ifdef CONFIG_SMP +/* ipi */ +void (*send_IPI_mask)(const struct cpumask *mask,int vector); +void (*send_IPI_mask_allbutself)(const struct cpumask *mask, +int vector); +void (*send_IPI_allbutself)(int vector); +void (*send_IPI_all)(int vector); +void (*send_IPI_self)(int vector); +#endif +/* wakeup_secondary_cpu */ +int (*wakeup_cpu)(int apicid,unsigned long start_eip); + +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); +}; +#ifdef CONFIG_X86_32 # include "genapic_32.h" #else # include "genapic_64.h" #endif + +#endif /* _ASM_X86_GENAPIC_64_H */
arch/x86/include/asm/genapic_32.h +0 -93
99 lines not on this page · raw message
arch/x86/include/asm/genapic_64.h +19 -110
129 lines not on this page · raw message
Signature · 1 line
1.6.0.2
PATCH 4/114 x86, genapic: finish unification
In reply to Ingo MolnarUnify remaining bits of genapic_32/64.h.
--- arch/x86/include/asm/genapic.h | 80 ++++++++++++++++++++++++++++++++++++- arch/x86/include/asm/genapic_32.h | 65 ------------------------------ arch/x86/include/asm/genapic_64.h | 19 --------- 3 files changed, 78 insertions(+), 86 deletions(-) delete mode 100644 arch/x86/include/asm/genapic_32.h delete mode 100644 arch/x86/include/asm/genapic_64.h
arch/x86/include/asm/genapic.h +78 -2
@@ -93,9 +93,85 @@ struct genapic { };#ifdef CONFIG_X86_32 -# include "genapic_32.h" + +#include <asm/mpspec.h> +#include <asm/atomic.h> + +#define APICFUNC (x) .x = x, + +/* More functions could be probably marked IPIFUNC and save some space +in UP GENERICARCH kernels, but I don't have the nerve right now +to untangle this mess. -AK */ +#ifdef CONFIG_SMP +#define IPIFUNC (x) APICFUNC(x)#else -# include "genapic_64.h" +#define IPIFUNC (x)#endif +#define APIC_INIT (aname, aprobe) \ +{ \ + .name = aname, \ + .probe = aprobe, \ + .int_delivery_mode = INT_DELIVERY_MODE, \ + .int_dest_mode = INT_DEST_MODE, \ + .no_balance_irq = NO_BALANCE_IRQ, \ + .ESR_DISABLE = esr_disable, \ + .apic_destination_logical = APIC_DEST_LOGICAL, \ + APICFUNC(apic_id_registered) \ + APICFUNC(target_cpus) \ + APICFUNC(check_apicid_used) \ + APICFUNC(check_apicid_present) \ + APICFUNC(init_apic_ldr) \ + APICFUNC(ioapic_phys_id_map) \ + APICFUNC(setup_apic_routing) \ + APICFUNC(multi_timer_check) \ + APICFUNC(apicid_to_node) \ + APICFUNC(cpu_to_logical_apicid) \ + APICFUNC(cpu_present_to_apicid) \ + APICFUNC(apicid_to_cpu_present) \ + APICFUNC(setup_portio_remap) \ + APICFUNC(check_phys_apicid_present) \ + APICFUNC(mps_oem_check) \ + APICFUNC(get_apic_id) \ + .apic_id_mask = APIC_ID_MASK, \ + APICFUNC(cpu_mask_to_apicid) \ + APICFUNC(cpu_mask_to_apicid_and) \ + APICFUNC(vector_allocation_domain) \ + APICFUNC(acpi_madt_oem_check) \ + IPIFUNC(send_IPI_mask) \ + IPIFUNC(send_IPI_allbutself) \ + IPIFUNC(send_IPI_all) \ + APICFUNC(enable_apic_mode) \ + APICFUNC(phys_pkg_id) \ + .trampoline_phys_low = TRAMPOLINE_PHYS_LOW, \ + .trampoline_phys_high = TRAMPOLINE_PHYS_HIGH, \ + APICFUNC(wait_for_init_deassert) \ + APICFUNC(smp_callin_clear_local_apic) \ + APICFUNC(store_NMI_vector) \ + APICFUNC(restore_NMI_vector) \ + APICFUNC(inquire_remote_apic) \ +} + +extern struct genapic *genapic; +extern void es7000_update_genapic_to_cluster (void ); + +#else /* CONFIG_X86_64: */ + +extern struct genapic *genapic; + +extern struct genapic apic_flat; +extern struct genapic apic_physflat; +extern struct genapic apic_x2apic_cluster; +extern struct genapic apic_x2apic_phys; +extern int acpi_madt_oem_check (char *,char *); + +extern void apic_send_IPI_self (int vector); + +extern struct genapic apic_x2apic_uv_x; +DECLARE_PER_CPU (int, x2apic_extra_bits); + +extern void setup_apic_routing (void ); + +#endif /* CONFIG_X86_64 */ +#endif /* _ASM_X86_GENAPIC_64_H */
arch/x86/include/asm/genapic_32.h deleted +0 -65
65 lines not on this page · raw message
arch/x86/include/asm/genapic_64.h deleted +0 -19
@@ -1,19 +0,0 @@ -#ifndef _ASM_X86_GENAPIC_64_H -#define _ASM_X86_GENAPIC_64_H - -extern struct genapic *genapic; - -extern struct genapic apic_flat; -extern struct genapic apic_physflat; -extern struct genapic apic_x2apic_cluster; -extern struct genapic apic_x2apic_phys; -extern int acpi_madt_oem_check (char *,char *); - -extern void apic_send_IPI_self (int vector); - -extern struct genapic apic_x2apic_uv_x; -DECLARE_PER_CPU (int, x2apic_extra_bits); - -extern void setup_apic_routing (void ); - -#endif /* _ASM_X86_GENAPIC_64_H */
Signature · 1 line
1.6.0.2
PATCH 5/114 x86, genapic: cleanups
In reply to Ingo MolnarUnify genapic.h some more.
--- arch/x86/include/asm/genapic.h | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 deletions(-)
arch/x86/include/asm/genapic.h +8 -9
@@ -3,6 +3,9 @@#include <linux/cpumask.h> +#include <asm/mpspec.h> +#include <asm/atomic.h> +/* * Copyright 2004 James Cleverdon, IBM. * Subject to the GNU Public License, v.2
@@ -13,7 +16,6 @@* Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and * James Cleverdon. */ -struct genapic {char *name;
@@ -85,6 +87,7 @@ struct genapic {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);
@@ -92,10 +95,9 @@ struct genapic {void (*inquire_remote_apic)(int apicid); }; -#ifdef CONFIG_X86_32 +extern struct genapic *genapic; -#include <asm/mpspec.h> -#include <asm/atomic.h> +#ifdef CONFIG_X86_32 #define APICFUNC (x) .x = x,
@@ -143,8 +145,8 @@ struct genapic { IPIFUNC(send_IPI_all) \ APICFUNC(enable_apic_mode) \ APICFUNC(phys_pkg_id) \ - .trampoline_phys_low = TRAMPOLINE_PHYS_LOW, \ - .trampoline_phys_high = TRAMPOLINE_PHYS_HIGH, \ + .trampoline_phys_low = TRAMPOLINE_PHYS_LOW, \ + .trampoline_phys_high = TRAMPOLINE_PHYS_HIGH, \ APICFUNC(wait_for_init_deassert) \ APICFUNC(smp_callin_clear_local_apic) \ APICFUNC(store_NMI_vector) \
@@ -152,13 +154,10 @@ struct genapic {APICFUNC (inquire_remote_apic) \ } -extern struct genapic *genapic; extern void es7000_update_genapic_to_cluster(void);#else /* CONFIG_X86_64: */ -extern struct genapic *genapic; -extern struct genapic apic_flat;extern struct genapic apic_physflat;extern struct genapic apic_x2apic_cluster;
Signature · 1 line
1.6.0.2
PATCH 6/114 x86, genapic: provide IPI callbacks unconditionally
In reply to Ingo Molnar64-bit x86 uses the IPI callbacks even on UP - so provide them generally.
--- arch/x86/include/asm/genapic.h | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
arch/x86/include/asm/genapic.h +1 -2
@@ -73,7 +73,6 @@ struct genapic {unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask,const struct cpumask *andmask); -#ifdef CONFIG_SMP /* ipi */ void (*send_IPI_mask)(const struct cpumask *mask,int vector); void (*send_IPI_mask_allbutself)(const struct cpumask *mask,
@@ -81,7 +80,7 @@ struct genapic {void (*send_IPI_allbutself)(int vector);void (*send_IPI_all)(int vector);void (*send_IPI_self)(int vector); -#endif +/* wakeup_secondary_cpu */ int (*wakeup_cpu)(int apicid,unsigned long start_eip);
Signature · 1 line
1.6.0.2
PATCH 7/114 x86: rename 'genapic' to 'apic'
In reply to Ingo MolnarRename genapic-> to apic-> references because in a future chagne we'll open-code all the indirect calls (instead of obscuring them via macros), so we want this reference to be as short as possible.
--- arch/x86/include/asm/genapic.h | 2 +- arch/x86/include/asm/mach-default/mach_apic.h | 22 +++--- arch/x86/include/asm/mach-default/mach_apicdef.h | 6 +- arch/x86/include/asm/mach-default/mach_ipi.h | 8 +- arch/x86/include/asm/mach-generic/mach_apic.h | 70 ++++++++++---------- arch/x86/include/asm/mach-generic/mach_apicdef.h | 4 +- arch/x86/include/asm/mach-generic/mach_ipi.h | 6 +- arch/x86/include/asm/mach-generic/mach_wakecpu.h | 24 +++--- arch/x86/kernel/es7000_32.c | 6 +- arch/x86/kernel/genapic_64.c | 16 ++-- arch/x86/kernel/io_apic.c | 80 +++++++++++----------- arch/x86/kernel/numaq_32.c | 2 +- arch/x86/kernel/setup.c | 2 +- arch/x86/mach-generic/es7000.c | 12 ++-- arch/x86/mach-generic/probe.c | 24 +++--- 15 files changed, 142 insertions(+), 142 deletions(-)
rewrite arch/x86/include/asm/mach-generic/mach_apic.h (86%) rewrite arch/x86/include/asm/mach-generic/mach_wakecpu.h (75%)
arch/x86/include/asm/genapic.h +1 -1
@@ -94,7 +94,7 @@ struct genapic {void (*inquire_remote_apic)(int apicid); }; -extern struct genapic *genapic; +extern struct genapic *apic;#ifdef CONFIG_X86_32
arch/x86/include/asm/mach-default/mach_apic.h +11 -11
@@ -22,18 +22,18 @@ static inline const struct cpumask *target_cpus(void)#ifdef CONFIG_X86_64 #include <asm/genapic.h> -#define INT_DELIVERY_MODE (genapic->int_delivery_mode) -#define INT_DEST_MODE (genapic->int_dest_mode) -#define TARGET_CPUS (genapic->target_cpus()) -#define apic_id_registered (genapic->apic_id_registered) -#define init_apic_ldr (genapic->init_apic_ldr) -#define cpu_mask_to_apicid (genapic->cpu_mask_to_apicid) -#define cpu_mask_to_apicid_and (genapic->cpu_mask_to_apicid_and) -#define phys_pkg_id (genapic->phys_pkg_id) -#define vector_allocation_domain (genapic->vector_allocation_domain) +#define INT_DELIVERY_MODE (apic->int_delivery_mode) +#define INT_DEST_MODE (apic->int_dest_mode) +#define TARGET_CPUS (apic->target_cpus()) +#define apic_id_registered (apic->apic_id_registered) +#define init_apic_ldr (apic->init_apic_ldr) +#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid) +#define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and) +#define phys_pkg_id (apic->phys_pkg_id) +#define vector_allocation_domain (apic->vector_allocation_domain)#define read_apic_id () (GET_APIC_ID(apic_read(APIC_ID))) -#define send_IPI_self (genapic->send_IPI_self) -#define wakeup_secondary_cpu (genapic->wakeup_cpu) +#define send_IPI_self (apic->send_IPI_self) +#define wakeup_secondary_cpu (apic->wakeup_cpu)extern void setup_apic_routing (void );#else #define INT_DELIVERY_MODE dest_LowestPrio
arch/x86/include/asm/mach-default/mach_apicdef.h +3 -3
@@ -4,9 +4,9 @@#include <asm/apic.h> #ifdef CONFIG_X86_64 -#define APIC_ID_MASK (genapic->apic_id_mask) -#define GET_APIC_ID (x) (genapic->get_apic_id(x)) -#define SET_APIC_ID (x) (genapic->set_apic_id(x)) +#define APIC_ID_MASK (apic->apic_id_mask) +#define GET_APIC_ID (x) (apic->get_apic_id(x)) +#define SET_APIC_ID (x) (apic->set_apic_id(x))#else #define APIC_ID_MASK (0xF<<24)static inline unsigned get_apic_id (unsigned long x)
arch/x86/include/asm/mach-default/mach_ipi.h +4 -4
@@ -12,8 +12,8 @@ extern int no_broadcast;#ifdef CONFIG_X86_64 #include <asm/genapic.h> -#define send_IPI_mask (genapic->send_IPI_mask) -#define send_IPI_mask_allbutself (genapic->send_IPI_mask_allbutself) +#define send_IPI_mask (apic->send_IPI_mask) +#define send_IPI_mask_allbutself (apic->send_IPI_mask_allbutself)#else static inline void send_IPI_mask (const struct cpumask *mask,int vector) {
@@ -39,8 +39,8 @@ static inline void __local_send_IPI_all(int vector) }#ifdef CONFIG_X86_64 -#define send_IPI_allbutself (genapic->send_IPI_allbutself) -#define send_IPI_all (genapic->send_IPI_all) +#define send_IPI_allbutself (apic->send_IPI_allbutself) +#define send_IPI_all (apic->send_IPI_all)#else static inline void send_IPI_allbutself (int vector) {
arch/x86/include/asm/mach-generic/mach_apic.h +35 -35
70 lines not on this page · raw message
arch/x86/include/asm/mach-generic/mach_apicdef.h +2 -2
@@ -4,8 +4,8 @@#ifndef APIC_DEFINITION #include <asm/genapic.h> -#define GET_APIC_ID (genapic->get_apic_id) -#define APIC_ID_MASK (genapic->apic_id_mask) +#define GET_APIC_ID (apic->get_apic_id) +#define APIC_ID_MASK (apic->apic_id_mask)#endif #endif /* _ASM_X86_MACH_GENERIC_MACH_APICDEF_H */
arch/x86/include/asm/mach-generic/mach_ipi.h +3 -3
@@ -3,8 +3,8 @@#include <asm/genapic.h> -#define send_IPI_mask (genapic->send_IPI_mask) -#define send_IPI_allbutself (genapic->send_IPI_allbutself) -#define send_IPI_all (genapic->send_IPI_all) +#define send_IPI_mask (apic->send_IPI_mask) +#define send_IPI_allbutself (apic->send_IPI_allbutself) +#define send_IPI_all (apic->send_IPI_all)#endif /* _ASM_X86_MACH_GENERIC_MACH_IPI_H */
arch/x86/include/asm/mach-generic/mach_wakecpu.h +12 -12
@@ -1,12 +1,12 @@ -#ifndef _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H -#define _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H - -#define TRAMPOLINE_PHYS_LOW (genapic->trampoline_phys_low) -#define TRAMPOLINE_PHYS_HIGH (genapic->trampoline_phys_high) -#define wait_for_init_deassert (genapic->wait_for_init_deassert) -#define smp_callin_clear_local_apic (genapic->smp_callin_clear_local_apic) -#define store_NMI_vector (genapic->store_NMI_vector) -#define restore_NMI_vector (genapic->restore_NMI_vector) -#define inquire_remote_apic (genapic->inquire_remote_apic) - -#endif /* _ASM_X86_MACH_GENERIC_MACH_APIC_H */ +#ifndef _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H +#define _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H + +#define TRAMPOLINE_PHYS_LOW (apic->trampoline_phys_low) +#define TRAMPOLINE_PHYS_HIGH (apic->trampoline_phys_high) +#define wait_for_init_deassert (apic->wait_for_init_deassert) +#define smp_callin_clear_local_apic (apic->smp_callin_clear_local_apic) +#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 */
arch/x86/kernel/es7000_32.c +3 -3
@@ -188,14 +188,14 @@ static void noop_wait_for_deassert(atomic_t *deassert_not_used)static int __init es7000_update_genapic (void ) { - genapic->wakeup_cpu = wakeup_secondary_cpu_via_mip; + apic->wakeup_cpu = wakeup_secondary_cpu_via_mip;/* MPENTIUMIII */ if (boot_cpu_data.x86 ==6 && (boot_cpu_data.x86_model >=7 || boot_cpu_data.x86_model <=11 )) {es7000_update_genapic_to_cluster (); - genapic->wait_for_init_deassert = noop_wait_for_deassert; - genapic->wakeup_cpu = wakeup_secondary_cpu_via_mip; + apic->wait_for_init_deassert = noop_wait_for_deassert; + apic->wakeup_cpu = wakeup_secondary_cpu_via_mip; }return 0 ;
arch/x86/kernel/genapic_64.c +8 -8
@@ -29,7 +29,7 @@ extern struct genapic apic_x2xpic_uv_x;extern struct genapic apic_x2apic_phys;extern struct genapic apic_x2apic_cluster; -struct genapic __read_mostly *genapic = &apic_flat; +struct genapic __read_mostly *apic = &apic_flat; static struct genapic *apic_probe[] __initdata = {#ifdef CONFIG_X86_UV
@@ -46,15 +46,15 @@ static struct genapic *apic_probe[] __initdata = {*/ void __init setup_apic_routing (void ) { -if (genapic == &apic_x2apic_phys || genapic == &apic_x2apic_cluster) { +if (apic == &apic_x2apic_phys || apic == &apic_x2apic_cluster) {if (!intr_remapping_enabled) - genapic = &apic_flat; + apic = &apic_flat; } -if (genapic == &apic_flat) { +if (apic == &apic_flat) {if (max_physical_apicid >=8 ) - genapic = &apic_physflat; -printk (KERN_INFO "Setting APIC routing to %s\n" , genapic->name); + apic = &apic_physflat; +printk (KERN_INFO "Setting APIC routing to %s\n" , apic->name); }if (x86_quirks->update_genapic)
@@ -74,9 +74,9 @@ int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)for (i =0 ; apic_probe[i]; ++i) {if (apic_probe[i]->acpi_madt_oem_check (oem_id, oem_table_id)) { - genapic = apic_probe[i]; + apic = apic_probe[i];printk (KERN_INFO "Setting APIC routing to %s.\n" , - genapic->name); + apic->name);return 1 ; } }
arch/x86/kernel/io_apic.c +40 -40
230 lines not on this page · raw message
arch/x86/kernel/numaq_32.c +1 -1
@@ -236,7 +236,7 @@ static int __init numaq_setup_ioapic_ids(void)static int __init numaq_update_genapic (void ) { - genapic->wakeup_cpu = wakeup_secondary_cpu_via_nmi; + apic->wakeup_cpu = wakeup_secondary_cpu_via_nmi;return 0 ; }
arch/x86/kernel/setup.c +1 -1
@@ -590,7 +590,7 @@ static int __init default_update_genapic(void) {#ifdef CONFIG_X86_SMP # if defined(CONFIG_X86_GENERICARCH ) || defined(CONFIG_X86_64 ) - genapic->wakeup_cpu = wakeup_secondary_cpu_via_init; + apic->wakeup_cpu = wakeup_secondary_cpu_via_init;# endif #endif
arch/x86/mach-generic/es7000.c +6 -6
@@ -20,14 +20,14 @@void __init es7000_update_genapic_to_cluster (void ) { - genapic->target_cpus = target_cpus_cluster; - genapic->int_delivery_mode =INT_DELIVERY_MODE_CLUSTER ; - genapic->int_dest_mode =INT_DEST_MODE_CLUSTER ; - genapic->no_balance_irq =NO_BALANCE_IRQ_CLUSTER ; + apic->target_cpus = target_cpus_cluster; + apic->int_delivery_mode =INT_DELIVERY_MODE_CLUSTER ; + apic->int_dest_mode =INT_DEST_MODE_CLUSTER ; + apic->no_balance_irq =NO_BALANCE_IRQ_CLUSTER ; - genapic->init_apic_ldr = init_apic_ldr_cluster; + apic->init_apic_ldr = init_apic_ldr_cluster; - genapic->cpu_mask_to_apicid = cpu_mask_to_apicid_cluster; + apic->cpu_mask_to_apicid = cpu_mask_to_apicid_cluster; }static int probe_es7000 (void )
arch/x86/mach-generic/probe.c +12 -12
@@ -23,7 +23,7 @@ extern struct genapic apic_bigsmp;extern struct genapic apic_es7000;extern struct genapic apic_default; -struct genapic *genapic = &apic_default; +struct genapic *apic = &apic_default; static struct genapic *apic_probe[] __initdata = {#ifdef CONFIG_X86_NUMAQ
@@ -52,7 +52,7 @@ static int __init parse_apic(char *arg)for (i =0 ; apic_probe[i]; i++) {if (!strcmp (apic_probe[i]->name, arg)) { - genapic = apic_probe[i]; + apic = apic_probe[i]; cmdline_apic =1 ;return 0 ; }
@@ -76,13 +76,13 @@ void __init generic_bigsmp_probe(void)* - we find more than 8 CPUs in acpi LAPIC listing with xAPIC support */ -if (!cmdline_apic && genapic == &apic_default) { +if (!cmdline_apic && apic == &apic_default) {if (apic_bigsmp.probe ()) { - genapic = &apic_bigsmp; + apic = &apic_bigsmp;if (x86_quirks->update_genapic) x86_quirks->update_genapic ();printk (KERN_INFO "Overriding APIC driver with %s\n" , - genapic->name); + apic->name); } }#endif
@@ -94,7 +94,7 @@ void __init generic_apic_probe(void)int i;for (i =0 ; apic_probe[i]; i++) {if (apic_probe[i]->probe ()) { - genapic = apic_probe[i]; + apic = apic_probe[i];break ; } }
@@ -105,7 +105,7 @@ void __init generic_apic_probe(void)if (x86_quirks->update_genapic) x86_quirks->update_genapic (); } -printk (KERN_INFO "Using APIC driver %s\n" , genapic->name); +printk (KERN_INFO "Using APIC driver %s\n" , apic->name); }/* These functions can switch the APIC even after the initial ->probe() */
@@ -116,11 +116,11 @@ int __init mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)for (i =0 ; apic_probe[i]; ++i) {if (apic_probe[i]->mps_oem_check (mpc, oem, productid)) {if (!cmdline_apic) { - genapic = apic_probe[i]; + apic = apic_probe[i];if (x86_quirks->update_genapic) x86_quirks->update_genapic ();printk (KERN_INFO "Switched to APIC driver `%s'.\n" , - genapic->name); + apic->name); }return 1 ; }
@@ -134,11 +134,11 @@ int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)for (i =0 ; apic_probe[i]; ++i) {if (apic_probe[i]->acpi_madt_oem_check (oem_id, oem_table_id)) {if (!cmdline_apic) { - genapic = apic_probe[i]; + apic = apic_probe[i];if (x86_quirks->update_genapic) x86_quirks->update_genapic ();printk (KERN_INFO "Switched to APIC driver `%s'.\n" , - genapic->name); + apic->name); }return 1 ; }
@@ -148,5 +148,5 @@ int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)int hard_smp_processor_id (void ) { -return genapic->get_apic_id (*(unsigned long *)(APIC_BASE +APIC_ID )); +return apic->get_apic_id (*(unsigned long *)(APIC_BASE +APIC_ID )); }
Signature · 1 line
1.6.0.2
PATCH 8/114 x86: clean up genapic_flat
In reply to Ingo Molnar- reorder fields so that they appear in struct genapic field ordering
- add zero-initialized fields too so that it's apparent which functionality is default / missing.
--- arch/x86/kernel/genapic_flat_64.c | 73 +++++++++++++++++++++++++++---------- 1 files changed, 54 insertions(+), 19 deletions(-)
arch/x86/kernel/genapic_flat_64.c +54 -19
@@ -175,25 +175,60 @@ static unsigned int phys_pkg_id(int index_msb) }struct genapic apic_flat = { - .name ="flat" , - .acpi_madt_oem_check = flat_acpi_madt_oem_check, - .int_delivery_mode = dest_LowestPrio, - .int_dest_mode = (APIC_DEST_LOGICAL !=0 ), - .target_cpus = flat_target_cpus, - .vector_allocation_domain = flat_vector_allocation_domain, - .apic_id_registered = flat_apic_id_registered, - .init_apic_ldr = flat_init_apic_ldr, - .send_IPI_all = flat_send_IPI_all, - .send_IPI_allbutself = flat_send_IPI_allbutself, - .send_IPI_mask = flat_send_IPI_mask, - .send_IPI_mask_allbutself = flat_send_IPI_mask_allbutself, - .send_IPI_self = apic_send_IPI_self, - .cpu_mask_to_apicid = flat_cpu_mask_to_apicid, - .cpu_mask_to_apicid_and = flat_cpu_mask_to_apicid_and, - .phys_pkg_id = phys_pkg_id, - .get_apic_id = get_apic_id, - .set_apic_id = set_apic_id, - .apic_id_mask = (0xFFu <<24 ), + .name ="flat" , + .probe =NULL , + .acpi_madt_oem_check = flat_acpi_madt_oem_check, + .apic_id_registered = flat_apic_id_registered, + + .int_delivery_mode = dest_LowestPrio, + .int_dest_mode = (APIC_DEST_LOGICAL !=0 ), + + .target_cpus = flat_target_cpus, + .ESR_DISABLE =0 , + .apic_destination_logical =0 , + .check_apicid_used =NULL , + .check_apicid_present =NULL , + + .no_balance_irq =0 , + .no_ioapic_check =0 , + + .vector_allocation_domain = flat_vector_allocation_domain, + .init_apic_ldr = flat_init_apic_ldr, + + .ioapic_phys_id_map =NULL , + .setup_apic_routing =NULL , + .multi_timer_check =NULL , + .apicid_to_node =NULL , + .cpu_to_logical_apicid =NULL , + .cpu_present_to_apicid =NULL , + .apicid_to_cpu_present =NULL , + .setup_portio_remap =NULL , + .check_phys_apicid_present =NULL , + .enable_apic_mode =NULL , + .phys_pkg_id = phys_pkg_id, + .mps_oem_check =NULL , + + .get_apic_id = get_apic_id, + .set_apic_id = set_apic_id, + .apic_id_mask =0xFFu <<24 , + + .cpu_mask_to_apicid = flat_cpu_mask_to_apicid, + .cpu_mask_to_apicid_and = flat_cpu_mask_to_apicid_and, + + .send_IPI_mask = flat_send_IPI_mask, + .send_IPI_mask_allbutself = flat_send_IPI_mask_allbutself, + .send_IPI_allbutself = flat_send_IPI_allbutself, + .send_IPI_all = flat_send_IPI_all, + .send_IPI_self = apic_send_IPI_self, + + .wakeup_cpu =NULL , + .trampoline_phys_low =0 , + .trampoline_phys_high =0 , + .wait_for_init_deassert =NULL , + .smp_callin_clear_local_apic =NULL , + .store_NMI_vector =NULL , + .restore_NMI_vector =NULL , + .inquire_remote_apic =NULL , };/*
Signature · 1 line
1.6.0.2
PATCH 9/114 x86: clean up genapic_phys_flat
In reply to Ingo Molnar- reorder fields so that they appear in struct genapic field ordering
- add zero-initialized fields too so that it's apparent which functionality is default / missing.
--- arch/x86/kernel/genapic_flat_64.c | 75 +++++++++++++++++++++++++++--------- 1 files changed, 56 insertions(+), 19 deletions(-)
arch/x86/kernel/genapic_flat_64.c +56 -19
@@ -320,23 +320,60 @@ physflat_cpu_mask_to_apicid_and(const struct cpumask *cpumask, }struct genapic apic_physflat = { - .name ="physical flat" , - .acpi_madt_oem_check = physflat_acpi_madt_oem_check, - .int_delivery_mode = dest_Fixed, - .int_dest_mode = (APIC_DEST_PHYSICAL !=0 ), - .target_cpus = physflat_target_cpus, - .vector_allocation_domain = physflat_vector_allocation_domain, - .apic_id_registered = flat_apic_id_registered, - .init_apic_ldr = flat_init_apic_ldr,/*not needed, but shouldn't hurt*/ - .send_IPI_all = physflat_send_IPI_all, - .send_IPI_allbutself = physflat_send_IPI_allbutself, - .send_IPI_mask = physflat_send_IPI_mask, - .send_IPI_mask_allbutself = physflat_send_IPI_mask_allbutself, - .send_IPI_self = apic_send_IPI_self, - .cpu_mask_to_apicid = physflat_cpu_mask_to_apicid, - .cpu_mask_to_apicid_and = physflat_cpu_mask_to_apicid_and, - .phys_pkg_id = phys_pkg_id, - .get_apic_id = get_apic_id, - .set_apic_id = set_apic_id, - .apic_id_mask = (0xFFu <<24 ), + + .name ="physical flat" , + .probe =NULL , + .acpi_madt_oem_check = physflat_acpi_madt_oem_check, + .apic_id_registered = flat_apic_id_registered, + + .int_delivery_mode = dest_Fixed, + .int_dest_mode = (APIC_DEST_PHYSICAL !=0 ), + + .target_cpus = physflat_target_cpus, + .ESR_DISABLE =0 , + .apic_destination_logical =0 , + .check_apicid_used =NULL , + .check_apicid_present =NULL , + + .no_balance_irq =0 , + .no_ioapic_check =0 , + + .vector_allocation_domain = physflat_vector_allocation_domain, +/* not needed, but shouldn't hurt: */ + .init_apic_ldr = flat_init_apic_ldr, + + .ioapic_phys_id_map =NULL , + .setup_apic_routing =NULL , + .multi_timer_check =NULL , + .apicid_to_node =NULL , + .cpu_to_logical_apicid =NULL , + .cpu_present_to_apicid =NULL , + .apicid_to_cpu_present =NULL , + .setup_portio_remap =NULL , + .check_phys_apicid_present =NULL , + .enable_apic_mode =NULL , + .phys_pkg_id = phys_pkg_id, + .mps_oem_check =NULL , + + .get_apic_id = get_apic_id, + .set_apic_id = set_apic_id, + .apic_id_mask =0xFFu <<24 , + + .cpu_mask_to_apicid = physflat_cpu_mask_to_apicid, + .cpu_mask_to_apicid_and = physflat_cpu_mask_to_apicid_and, + + .send_IPI_mask = physflat_send_IPI_mask, + .send_IPI_mask_allbutself = physflat_send_IPI_mask_allbutself, + .send_IPI_allbutself = physflat_send_IPI_allbutself, + .send_IPI_all = physflat_send_IPI_all, + .send_IPI_self = apic_send_IPI_self, + + .wakeup_cpu =NULL , + .trampoline_phys_low =0 , + .trampoline_phys_high =0 , + .wait_for_init_deassert =NULL , + .smp_callin_clear_local_apic =NULL , + .store_NMI_vector =NULL , + .restore_NMI_vector =NULL , + .inquire_remote_apic =NULL , };
Signature · 1 line
1.6.0.2
PATCH 10/114 x86: clean up apic_x2apic_uv_x
In reply to Ingo Molnar- reorder fields so that they appear in struct genapic field ordering
- add zero-initialized fields too so that it's apparent which functionality is default / missing.
--- arch/x86/kernel/genx2apic_uv_x.c | 74 ++++++++++++++++++++++++++++---------- 1 files changed, 55 insertions(+), 19 deletions(-)
arch/x86/kernel/genx2apic_uv_x.c +55 -19
@@ -237,25 +237,61 @@ static void uv_send_IPI_self(int vector) }struct genapic apic_x2apic_uv_x = { - .name ="UV large system" , - .acpi_madt_oem_check = uv_acpi_madt_oem_check, - .int_delivery_mode = dest_Fixed, - .int_dest_mode = (APIC_DEST_PHYSICAL !=0 ), - .target_cpus = uv_target_cpus, - .vector_allocation_domain = uv_vector_allocation_domain, - .apic_id_registered = uv_apic_id_registered, - .init_apic_ldr = uv_init_apic_ldr, - .send_IPI_all = uv_send_IPI_all, - .send_IPI_allbutself = uv_send_IPI_allbutself, - .send_IPI_mask = uv_send_IPI_mask, - .send_IPI_mask_allbutself = uv_send_IPI_mask_allbutself, - .send_IPI_self = uv_send_IPI_self, - .cpu_mask_to_apicid = uv_cpu_mask_to_apicid, - .cpu_mask_to_apicid_and = uv_cpu_mask_to_apicid_and, - .phys_pkg_id = phys_pkg_id, - .get_apic_id = get_apic_id, - .set_apic_id = set_apic_id, - .apic_id_mask = (0xFFFFFFFFu ), + + .name ="UV large system" , + .probe =NULL , + .acpi_madt_oem_check = uv_acpi_madt_oem_check, + .apic_id_registered = uv_apic_id_registered, + + .int_delivery_mode = dest_Fixed, + .int_dest_mode = (APIC_DEST_PHYSICAL !=0 ), + + .target_cpus = uv_target_cpus, + .ESR_DISABLE =0 , + .apic_destination_logical =0 , + .check_apicid_used =NULL , + .check_apicid_present =NULL , + + .no_balance_irq =0 , + .no_ioapic_check =0 , + + .vector_allocation_domain = uv_vector_allocation_domain, + .init_apic_ldr = uv_init_apic_ldr, + + .ioapic_phys_id_map =NULL , + .setup_apic_routing =NULL , + .multi_timer_check =NULL , + .apicid_to_node =NULL , + .cpu_to_logical_apicid =NULL , + .cpu_present_to_apicid =NULL , + .apicid_to_cpu_present =NULL , + .setup_portio_remap =NULL , + .check_phys_apicid_present =NULL , + .enable_apic_mode =NULL , + .phys_pkg_id = phys_pkg_id, + .mps_oem_check =NULL , + + .get_apic_id = get_apic_id, + .set_apic_id = set_apic_id, + .apic_id_mask =0xFFFFFFFFu , + + .cpu_mask_to_apicid = uv_cpu_mask_to_apicid, + .cpu_mask_to_apicid_and = uv_cpu_mask_to_apicid_and, + + .send_IPI_mask = uv_send_IPI_mask, + .send_IPI_mask_allbutself = uv_send_IPI_mask_allbutself, + .send_IPI_allbutself = uv_send_IPI_allbutself, + .send_IPI_all = uv_send_IPI_all, + .send_IPI_self = uv_send_IPI_self, + + .wakeup_cpu =NULL , + .trampoline_phys_low =0 , + .trampoline_phys_high =0 , + .wait_for_init_deassert =NULL , + .smp_callin_clear_local_apic =NULL , + .store_NMI_vector =NULL , + .restore_NMI_vector =NULL , + .inquire_remote_apic =NULL , };static __cpuinit void set_x2apic_extra_bits (int pnode)
Signature · 1 line
1.6.0.2
PATCH 11/114 x86: clean up apic_x2apic_phys
In reply to Ingo Molnar- reorder fields so that they appear in struct genapic field ordering
- add zero-initialized fields too so that it's apparent which functionality is default / missing.
--- arch/x86/kernel/genx2apic_phys.c | 74 ++++++++++++++++++++++++++++---------- 1 files changed, 55 insertions(+), 19 deletions(-)
arch/x86/kernel/genx2apic_phys.c +55 -19
@@ -172,23 +172,59 @@ static void init_x2apic_ldr(void) }struct genapic apic_x2apic_phys = { - .name ="physical x2apic" , - .acpi_madt_oem_check = x2apic_acpi_madt_oem_check, - .int_delivery_mode = dest_Fixed, - .int_dest_mode = (APIC_DEST_PHYSICAL !=0 ), - .target_cpus = x2apic_target_cpus, - .vector_allocation_domain = x2apic_vector_allocation_domain, - .apic_id_registered = x2apic_apic_id_registered, - .init_apic_ldr = init_x2apic_ldr, - .send_IPI_all = x2apic_send_IPI_all, - .send_IPI_allbutself = x2apic_send_IPI_allbutself, - .send_IPI_mask = x2apic_send_IPI_mask, - .send_IPI_mask_allbutself = x2apic_send_IPI_mask_allbutself, - .send_IPI_self = x2apic_send_IPI_self, - .cpu_mask_to_apicid = x2apic_cpu_mask_to_apicid, - .cpu_mask_to_apicid_and = x2apic_cpu_mask_to_apicid_and, - .phys_pkg_id = phys_pkg_id, - .get_apic_id = get_apic_id, - .set_apic_id = set_apic_id, - .apic_id_mask = (0xFFFFFFFFu ), + + .name ="physical x2apic" , + .probe =NULL , + .acpi_madt_oem_check = x2apic_acpi_madt_oem_check, + .apic_id_registered = x2apic_apic_id_registered, + + .int_delivery_mode = dest_Fixed, + .int_dest_mode = (APIC_DEST_PHYSICAL !=0 ), + + .target_cpus = x2apic_target_cpus, + .ESR_DISABLE =0 , + .apic_destination_logical =0 , + .check_apicid_used =NULL , + .check_apicid_present =NULL , + + .no_balance_irq =0 , + .no_ioapic_check =0 , + + .vector_allocation_domain = x2apic_vector_allocation_domain, + .init_apic_ldr = init_x2apic_ldr, + + .ioapic_phys_id_map =NULL , + .setup_apic_routing =NULL , + .multi_timer_check =NULL , + .apicid_to_node =NULL , + .cpu_to_logical_apicid =NULL , + .cpu_present_to_apicid =NULL , + .apicid_to_cpu_present =NULL , + .setup_portio_remap =NULL , + .check_phys_apicid_present =NULL , + .enable_apic_mode =NULL , + .phys_pkg_id = phys_pkg_id, + .mps_oem_check =NULL , + + .get_apic_id = get_apic_id, + .set_apic_id = set_apic_id, + .apic_id_mask =0xFFFFFFFFu , + + .cpu_mask_to_apicid = x2apic_cpu_mask_to_apicid, + .cpu_mask_to_apicid_and = x2apic_cpu_mask_to_apicid_and, + + .send_IPI_mask = x2apic_send_IPI_mask, + .send_IPI_mask_allbutself = x2apic_send_IPI_mask_allbutself, + .send_IPI_allbutself = x2apic_send_IPI_allbutself, + .send_IPI_all = x2apic_send_IPI_all, + .send_IPI_self = x2apic_send_IPI_self, + + .wakeup_cpu =NULL , + .trampoline_phys_low =0 , + .trampoline_phys_high =0 , + .wait_for_init_deassert =NULL , + .smp_callin_clear_local_apic =NULL , + .store_NMI_vector =NULL , + .restore_NMI_vector =NULL , + .inquire_remote_apic =NULL , };
Signature · 1 line
1.6.0.2
PATCH 12/114 x86: clean up apic_x2apic_cluster
In reply to Ingo Molnar- reorder fields so that they appear in struct genapic field ordering
- add zero-initialized fields too so that it's apparent which functionality is default / missing.
--- arch/x86/kernel/genx2apic_cluster.c | 74 ++++++++++++++++++++++++++--------- 1 files changed, 55 insertions(+), 19 deletions(-)
arch/x86/kernel/genx2apic_cluster.c +55 -19
@@ -176,23 +176,59 @@ static void init_x2apic_ldr(void) }struct genapic apic_x2apic_cluster = { - .name ="cluster x2apic" , - .acpi_madt_oem_check = x2apic_acpi_madt_oem_check, - .int_delivery_mode = dest_LowestPrio, - .int_dest_mode = (APIC_DEST_LOGICAL !=0 ), - .target_cpus = x2apic_target_cpus, - .vector_allocation_domain = x2apic_vector_allocation_domain, - .apic_id_registered = x2apic_apic_id_registered, - .init_apic_ldr = init_x2apic_ldr, - .send_IPI_all = x2apic_send_IPI_all, - .send_IPI_allbutself = x2apic_send_IPI_allbutself, - .send_IPI_mask = x2apic_send_IPI_mask, - .send_IPI_mask_allbutself = x2apic_send_IPI_mask_allbutself, - .send_IPI_self = x2apic_send_IPI_self, - .cpu_mask_to_apicid = x2apic_cpu_mask_to_apicid, - .cpu_mask_to_apicid_and = x2apic_cpu_mask_to_apicid_and, - .phys_pkg_id = phys_pkg_id, - .get_apic_id = get_apic_id, - .set_apic_id = set_apic_id, - .apic_id_mask = (0xFFFFFFFFu ), + + .name ="cluster x2apic" , + .probe =NULL , + .acpi_madt_oem_check = x2apic_acpi_madt_oem_check, + .apic_id_registered = x2apic_apic_id_registered, + + .int_delivery_mode = dest_LowestPrio, + .int_dest_mode = (APIC_DEST_LOGICAL !=0 ), + + .target_cpus = x2apic_target_cpus, + .ESR_DISABLE =0 , + .apic_destination_logical =0 , + .check_apicid_used =NULL , + .check_apicid_present =NULL , + + .no_balance_irq =0 , + .no_ioapic_check =0 , + + .vector_allocation_domain = x2apic_vector_allocation_domain, + .init_apic_ldr = init_x2apic_ldr, + + .ioapic_phys_id_map =NULL , + .setup_apic_routing =NULL , + .multi_timer_check =NULL , + .apicid_to_node =NULL , + .cpu_to_logical_apicid =NULL , + .cpu_present_to_apicid =NULL , + .apicid_to_cpu_present =NULL , + .setup_portio_remap =NULL , + .check_phys_apicid_present =NULL , + .enable_apic_mode =NULL , + .phys_pkg_id = phys_pkg_id, + .mps_oem_check =NULL , + + .get_apic_id = get_apic_id, + .set_apic_id = set_apic_id, + .apic_id_mask =0xFFFFFFFFu , + + .cpu_mask_to_apicid = x2apic_cpu_mask_to_apicid, + .cpu_mask_to_apicid_and = x2apic_cpu_mask_to_apicid_and, + + .send_IPI_mask = x2apic_send_IPI_mask, + .send_IPI_mask_allbutself = x2apic_send_IPI_mask_allbutself, + .send_IPI_allbutself = x2apic_send_IPI_allbutself, + .send_IPI_all = x2apic_send_IPI_all, + .send_IPI_self = x2apic_send_IPI_self, + + .wakeup_cpu =NULL , + .trampoline_phys_low =0 , + .trampoline_phys_high =0 , + .wait_for_init_deassert =NULL , + .smp_callin_clear_local_apic =NULL , + .store_NMI_vector =NULL , + .restore_NMI_vector =NULL , + .inquire_remote_apic =NULL , };
Signature · 1 line
1.6.0.2
PATCH 13/114 x86, genapic: cleanup 32-bit apic_default template
In reply to Ingo MolnarClean up the APIC driver template:
- order fields properly
- use the macro names explicitly (so that they can be renamed later)
- fill in NULL entries as well
--- arch/x86/mach-generic/default.c | 58 ++++++++++++++++++++++++++++++++++++++- 1 files changed, 57 insertions(+), 1 deletions(-)
arch/x86/mach-generic/default.c +57 -1
@@ -24,4 +24,60 @@ static int probe_default(void)return 1 ; } -struct genapic apic_default =APIC_INIT ("default" , probe_default); +struct genapic apic_default = { + + .name ="default" , + .probe = probe_default, + .acpi_madt_oem_check = acpi_madt_oem_check, + .apic_id_registered = apic_id_registered, + + .int_delivery_mode =INT_DELIVERY_MODE , + .int_dest_mode =INT_DEST_MODE , + + .target_cpus = target_cpus, + .ESR_DISABLE = esr_disable, + .apic_destination_logical =APIC_DEST_LOGICAL , + .check_apicid_used = check_apicid_used, + .check_apicid_present = check_apicid_present, + + .no_balance_irq =NO_BALANCE_IRQ , + .no_ioapic_check =0 , + + .vector_allocation_domain = vector_allocation_domain, + .init_apic_ldr = init_apic_ldr, + + .ioapic_phys_id_map = ioapic_phys_id_map, + .setup_apic_routing = setup_apic_routing, + .multi_timer_check = multi_timer_check, + .apicid_to_node = apicid_to_node, + .cpu_to_logical_apicid = cpu_to_logical_apicid, + .cpu_present_to_apicid = cpu_present_to_apicid, + .apicid_to_cpu_present = apicid_to_cpu_present, + .setup_portio_remap = setup_portio_remap, + .check_phys_apicid_present = check_phys_apicid_present, + .enable_apic_mode = enable_apic_mode, + .phys_pkg_id = phys_pkg_id, + .mps_oem_check = mps_oem_check, + + .get_apic_id = get_apic_id, + .set_apic_id =NULL , + .apic_id_mask =APIC_ID_MASK , + + .cpu_mask_to_apicid = cpu_mask_to_apicid, + .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and, + + .send_IPI_mask = send_IPI_mask, + .send_IPI_mask_allbutself =NULL , + .send_IPI_allbutself = send_IPI_allbutself, + .send_IPI_all = send_IPI_all, + .send_IPI_self =NULL , + + .wakeup_cpu =NULL , + .trampoline_phys_low =TRAMPOLINE_PHYS_LOW , + .trampoline_phys_high =TRAMPOLINE_PHYS_HIGH , + .wait_for_init_deassert = wait_for_init_deassert, + .smp_callin_clear_local_apic = smp_callin_clear_local_apic, + .store_NMI_vector = store_NMI_vector, + .restore_NMI_vector = restore_NMI_vector, + .inquire_remote_apic = inquire_remote_apic, +};
Signature · 1 line
1.6.0.2
PATCH 14/114 x86, genapic: cleanup 32-bit apic_bigsmp template
In reply to Ingo MolnarClean up the APIC driver template:
- order fields properly
- use the macro names explicitly (so that they can be renamed later)
- fill in NULL entries as well
--- arch/x86/mach-generic/bigsmp.c | 58 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 57 insertions(+), 1 deletions(-)
arch/x86/mach-generic/bigsmp.c +57 -1
@@ -57,4 +57,60 @@ static int probe_bigsmp(void)return dmi_bigsmp; } -struct genapic apic_bigsmp =APIC_INIT ("bigsmp" , probe_bigsmp); +struct genapic apic_bigsmp = { + + .name ="bigsmp" , + .probe = probe_bigsmp, + .acpi_madt_oem_check = acpi_madt_oem_check, + .apic_id_registered = apic_id_registered, + + .int_delivery_mode =INT_DELIVERY_MODE , + .int_dest_mode =INT_DEST_MODE , + + .target_cpus = target_cpus, + .ESR_DISABLE = esr_disable, + .apic_destination_logical =APIC_DEST_LOGICAL , + .check_apicid_used = check_apicid_used, + .check_apicid_present = check_apicid_present, + + .no_balance_irq =NO_BALANCE_IRQ , + .no_ioapic_check =0 , + + .vector_allocation_domain = vector_allocation_domain, + .init_apic_ldr = init_apic_ldr, + + .ioapic_phys_id_map = ioapic_phys_id_map, + .setup_apic_routing = setup_apic_routing, + .multi_timer_check = multi_timer_check, + .apicid_to_node = apicid_to_node, + .cpu_to_logical_apicid = cpu_to_logical_apicid, + .cpu_present_to_apicid = cpu_present_to_apicid, + .apicid_to_cpu_present = apicid_to_cpu_present, + .setup_portio_remap = setup_portio_remap, + .check_phys_apicid_present = check_phys_apicid_present, + .enable_apic_mode = enable_apic_mode, + .phys_pkg_id = phys_pkg_id, + .mps_oem_check = mps_oem_check, + + .get_apic_id = get_apic_id, + .set_apic_id =NULL , + .apic_id_mask =APIC_ID_MASK , + + .cpu_mask_to_apicid = cpu_mask_to_apicid, + .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and, + + .send_IPI_mask = send_IPI_mask, + .send_IPI_mask_allbutself =NULL , + .send_IPI_allbutself = send_IPI_allbutself, + .send_IPI_all = send_IPI_all, + .send_IPI_self =NULL , + + .wakeup_cpu =NULL , + .trampoline_phys_low =TRAMPOLINE_PHYS_LOW , + .trampoline_phys_high =TRAMPOLINE_PHYS_HIGH , + .wait_for_init_deassert = wait_for_init_deassert, + .smp_callin_clear_local_apic = smp_callin_clear_local_apic, + .store_NMI_vector = store_NMI_vector, + .restore_NMI_vector = restore_NMI_vector, + .inquire_remote_apic = inquire_remote_apic, +};
Signature · 1 line
1.6.0.2
PATCH 15/114 x86, genapic: cleanup 32-bit apic_numaq template
In reply to Ingo MolnarClean up the APIC driver template:
- order fields properly
- use the macro names explicitly (so that they can be renamed later)
- fill in NULL entries as well
--- arch/x86/mach-generic/numaq.c | 58 ++++++++++++++++++++++++++++++++++++++++- 1 files changed, 57 insertions(+), 1 deletions(-)
arch/x86/mach-generic/numaq.c +57 -1
@@ -50,4 +50,60 @@ static void vector_allocation_domain(int cpu, cpumask_t *retmask) *retmask = (cpumask_t ){ { [0 ] =APIC_ALL_CPUS , } }; } -struct genapic apic_numaq =APIC_INIT ("NUMAQ" , probe_numaq); +struct genapic apic_numaq = { + + .name ="NUMAQ" , + .probe = probe_numaq, + .acpi_madt_oem_check = acpi_madt_oem_check, + .apic_id_registered = apic_id_registered, + + .int_delivery_mode =INT_DELIVERY_MODE , + .int_dest_mode =INT_DEST_MODE , + + .target_cpus = target_cpus, + .ESR_DISABLE = esr_disable, + .apic_destination_logical =APIC_DEST_LOGICAL , + .check_apicid_used = check_apicid_used, + .check_apicid_present = check_apicid_present, + + .no_balance_irq =NO_BALANCE_IRQ , + .no_ioapic_check =0 , + + .vector_allocation_domain = vector_allocation_domain, + .init_apic_ldr = init_apic_ldr, + + .ioapic_phys_id_map = ioapic_phys_id_map, + .setup_apic_routing = setup_apic_routing, + .multi_timer_check = multi_timer_check, + .apicid_to_node = apicid_to_node, + .cpu_to_logical_apicid = cpu_to_logical_apicid, + .cpu_present_to_apicid = cpu_present_to_apicid, + .apicid_to_cpu_present = apicid_to_cpu_present, + .setup_portio_remap = setup_portio_remap, + .check_phys_apicid_present = check_phys_apicid_present, + .enable_apic_mode = enable_apic_mode, + .phys_pkg_id = phys_pkg_id, + .mps_oem_check = mps_oem_check, + + .get_apic_id = get_apic_id, + .set_apic_id =NULL , + .apic_id_mask =APIC_ID_MASK , + + .cpu_mask_to_apicid = cpu_mask_to_apicid, + .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and, + + .send_IPI_mask = send_IPI_mask, + .send_IPI_mask_allbutself =NULL , + .send_IPI_allbutself = send_IPI_allbutself, + .send_IPI_all = send_IPI_all, + .send_IPI_self =NULL , + + .wakeup_cpu =NULL , + .trampoline_phys_low =TRAMPOLINE_PHYS_LOW , + .trampoline_phys_high =TRAMPOLINE_PHYS_HIGH , + .wait_for_init_deassert = wait_for_init_deassert, + .smp_callin_clear_local_apic = smp_callin_clear_local_apic, + .store_NMI_vector = store_NMI_vector, + .restore_NMI_vector = restore_NMI_vector, + .inquire_remote_apic = inquire_remote_apic, +};
Signature · 1 line
1.6.0.2
PATCH 16/114 x86, genapic: cleanup 32-bit apic_es7000 template
In reply to Ingo MolnarClean up the APIC driver template:
- order fields properly
- use the macro names explicitly (so that they can be renamed later)
- fill in NULL entries as well
--- arch/x86/mach-generic/es7000.c | 58 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 57 insertions(+), 1 deletions(-)
arch/x86/mach-generic/es7000.c +57 -1
@@ -100,4 +100,60 @@ static void vector_allocation_domain(int cpu, cpumask_t *retmask) *retmask = (cpumask_t ){ { [0 ] =APIC_ALL_CPUS , } }; } -struct genapic __initdata_refok apic_es7000 = APIC_INIT("es7000", probe_es7000); +struct genapic apic_es7000 = { + + .name ="es7000" , + .probe = probe_es7000, + .acpi_madt_oem_check = acpi_madt_oem_check, + .apic_id_registered = apic_id_registered, + + .int_delivery_mode =INT_DELIVERY_MODE , + .int_dest_mode =INT_DEST_MODE , + + .target_cpus = target_cpus, + .ESR_DISABLE = esr_disable, + .apic_destination_logical =APIC_DEST_LOGICAL , + .check_apicid_used = check_apicid_used, + .check_apicid_present = check_apicid_present, + + .no_balance_irq =NO_BALANCE_IRQ , + .no_ioapic_check =0 , + + .vector_allocation_domain = vector_allocation_domain, + .init_apic_ldr = init_apic_ldr, + + .ioapic_phys_id_map = ioapic_phys_id_map, + .setup_apic_routing = setup_apic_routing, + .multi_timer_check = multi_timer_check, + .apicid_to_node = apicid_to_node, + .cpu_to_logical_apicid = cpu_to_logical_apicid, + .cpu_present_to_apicid = cpu_present_to_apicid, + .apicid_to_cpu_present = apicid_to_cpu_present, + .setup_portio_remap = setup_portio_remap, + .check_phys_apicid_present = check_phys_apicid_present, + .enable_apic_mode = enable_apic_mode, + .phys_pkg_id = phys_pkg_id, + .mps_oem_check = mps_oem_check, + + .get_apic_id = get_apic_id, + .set_apic_id =NULL , + .apic_id_mask =APIC_ID_MASK , + + .cpu_mask_to_apicid = cpu_mask_to_apicid, + .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and, + + .send_IPI_mask = send_IPI_mask, + .send_IPI_mask_allbutself =NULL , + .send_IPI_allbutself = send_IPI_allbutself, + .send_IPI_all = send_IPI_all, + .send_IPI_self =NULL , + + .wakeup_cpu =NULL , + .trampoline_phys_low =TRAMPOLINE_PHYS_LOW , + .trampoline_phys_high =TRAMPOLINE_PHYS_HIGH , + .wait_for_init_deassert = wait_for_init_deassert, + .smp_callin_clear_local_apic = smp_callin_clear_local_apic, + .store_NMI_vector = store_NMI_vector, + .restore_NMI_vector = restore_NMI_vector, + .inquire_remote_apic = inquire_remote_apic, +};
Signature · 1 line
1.6.0.2
PATCH 17/114 x86, genapic: cleanup 32-bit apic_summit template
In reply to Ingo MolnarClean up the APIC driver template:
- order fields properly
- use the macro names explicitly (so that they can be renamed later)
- fill in NULL entries as well
--- arch/x86/mach-generic/summit.c | 58 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 57 insertions(+), 1 deletions(-)
arch/x86/mach-generic/summit.c +57 -1
@@ -37,4 +37,60 @@ static void vector_allocation_domain(int cpu, cpumask_t *retmask) *retmask = (cpumask_t ){ { [0 ] =APIC_ALL_CPUS , } }; } -struct genapic apic_summit =APIC_INIT ("summit" , probe_summit); +struct genapic apic_summit = { + + .name ="summit" , + .probe = probe_summit, + .acpi_madt_oem_check = acpi_madt_oem_check, + .apic_id_registered = apic_id_registered, + + .int_delivery_mode =INT_DELIVERY_MODE , + .int_dest_mode =INT_DEST_MODE , + + .target_cpus = target_cpus, + .ESR_DISABLE = esr_disable, + .apic_destination_logical =APIC_DEST_LOGICAL , + .check_apicid_used = check_apicid_used, + .check_apicid_present = check_apicid_present, + + .no_balance_irq =NO_BALANCE_IRQ , + .no_ioapic_check =0 , + + .vector_allocation_domain = vector_allocation_domain, + .init_apic_ldr = init_apic_ldr, + + .ioapic_phys_id_map = ioapic_phys_id_map, + .setup_apic_routing = setup_apic_routing, + .multi_timer_check = multi_timer_check, + .apicid_to_node = apicid_to_node, + .cpu_to_logical_apicid = cpu_to_logical_apicid, + .cpu_present_to_apicid = cpu_present_to_apicid, + .apicid_to_cpu_present = apicid_to_cpu_present, + .setup_portio_remap = setup_portio_remap, + .check_phys_apicid_present = check_phys_apicid_present, + .enable_apic_mode = enable_apic_mode, + .phys_pkg_id = phys_pkg_id, + .mps_oem_check = mps_oem_check, + + .get_apic_id = get_apic_id, + .set_apic_id =NULL , + .apic_id_mask =APIC_ID_MASK , + + .cpu_mask_to_apicid = cpu_mask_to_apicid, + .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and, + + .send_IPI_mask = send_IPI_mask, + .send_IPI_mask_allbutself =NULL , + .send_IPI_allbutself = send_IPI_allbutself, + .send_IPI_all = send_IPI_all, + .send_IPI_self =NULL , + + .wakeup_cpu =NULL , + .trampoline_phys_low =TRAMPOLINE_PHYS_LOW , + .trampoline_phys_high =TRAMPOLINE_PHYS_HIGH , + .wait_for_init_deassert = wait_for_init_deassert, + .smp_callin_clear_local_apic = smp_callin_clear_local_apic, + .store_NMI_vector = store_NMI_vector, + .restore_NMI_vector = restore_NMI_vector, + .inquire_remote_apic = inquire_remote_apic, +};
Signature · 1 line
1.6.0.2
PATCH 18/114 x86: remove APIC_INIT / APICFUNC / IPIFUNC
In reply to Ingo MolnarThe APIC_INIT() / APICFUNC / IPIFUNC macros were ugly and obfuscated the true identity of various APIC driver methods.
Now that they are not used anymore, remove them.
--- arch/x86/include/asm/genapic.h | 63 +-------------------------------------- 1 files changed, 2 insertions(+), 61 deletions(-)
arch/x86/include/asm/genapic.h +2 -61
@@ -97,66 +97,8 @@ struct genapic {extern struct genapic *apic;#ifdef CONFIG_X86_32 - -#define APICFUNC (x) .x = x, - -/* More functions could be probably marked IPIFUNC and save some space -in UP GENERICARCH kernels, but I don't have the nerve right now -to untangle this mess. -AK */ -#ifdef CONFIG_SMP -#define IPIFUNC (x) APICFUNC(x) -#else -#define IPIFUNC (x) -#endif - -#define APIC_INIT (aname, aprobe) \ -{ \ - .name = aname, \ - .probe = aprobe, \ - .int_delivery_mode = INT_DELIVERY_MODE, \ - .int_dest_mode = INT_DEST_MODE, \ - .no_balance_irq = NO_BALANCE_IRQ, \ - .ESR_DISABLE = esr_disable, \ - .apic_destination_logical = APIC_DEST_LOGICAL, \ - APICFUNC(apic_id_registered) \ - APICFUNC(target_cpus) \ - APICFUNC(check_apicid_used) \ - APICFUNC(check_apicid_present) \ - APICFUNC(init_apic_ldr) \ - APICFUNC(ioapic_phys_id_map) \ - APICFUNC(setup_apic_routing) \ - APICFUNC(multi_timer_check) \ - APICFUNC(apicid_to_node) \ - APICFUNC(cpu_to_logical_apicid) \ - APICFUNC(cpu_present_to_apicid) \ - APICFUNC(apicid_to_cpu_present) \ - APICFUNC(setup_portio_remap) \ - APICFUNC(check_phys_apicid_present) \ - APICFUNC(mps_oem_check) \ - APICFUNC(get_apic_id) \ - .apic_id_mask = APIC_ID_MASK, \ - APICFUNC(cpu_mask_to_apicid) \ - APICFUNC(cpu_mask_to_apicid_and) \ - APICFUNC(vector_allocation_domain) \ - APICFUNC(acpi_madt_oem_check) \ - IPIFUNC(send_IPI_mask) \ - IPIFUNC(send_IPI_allbutself) \ - IPIFUNC(send_IPI_all) \ - APICFUNC(enable_apic_mode) \ - APICFUNC(phys_pkg_id) \ - .trampoline_phys_low = TRAMPOLINE_PHYS_LOW, \ - .trampoline_phys_high = TRAMPOLINE_PHYS_HIGH, \ - APICFUNC(wait_for_init_deassert) \ - APICFUNC(smp_callin_clear_local_apic) \ - APICFUNC(store_NMI_vector) \ - APICFUNC(restore_NMI_vector) \ - APICFUNC(inquire_remote_apic) \ -} -extern void es7000_update_genapic_to_cluster (void ); - -#else /* CONFIG_X86_64: */ - +#else extern struct genapic apic_flat;extern struct genapic apic_physflat;extern struct genapic apic_x2apic_cluster;
@@ -169,7 +111,6 @@ extern struct genapic apic_x2apic_uv_x;DECLARE_PER_CPU (int, x2apic_extra_bits);extern void setup_apic_routing (void ); - -#endif /* CONFIG_X86_64 */ +#endif #endif /* _ASM_X86_GENAPIC_64_H */
Signature · 1 line
1.6.0.2
PATCH 19/114 x86: clean up apic->acpi_madt_oem_check methods
In reply to Ingo MolnarImpact: refactor code
x86 subarchitectures each defined a "acpi_madt_oem_check()" method, which could be an inline function, or an extern, or a static function, and which was also the name of a genapic field.
Untangle this namespace spaghetti by setting ->acpi_madt_oem_check() to NULL on those subarchitectures that have no detection quirks, and rename the other ones (summit, es7000) that do.
Also change default_acpi_madt_oem_check() to handle NULL entries, and clean its control flow up as well.
--- arch/x86/include/asm/es7000/mpparse.h | 2 +- arch/x86/include/asm/genapic.h | 2 +- arch/x86/include/asm/mach-default/mach_mpparse.h | 2 +- arch/x86/include/asm/mach-generic/mach_mpparse.h | 2 +- arch/x86/include/asm/summit/mpparse.h | 2 +- arch/x86/kernel/acpi/boot.c | 3 +- arch/x86/kernel/genapic_64.c | 2 +- arch/x86/mach-generic/bigsmp.c | 2 +- arch/x86/mach-generic/default.c | 2 +- arch/x86/mach-generic/es7000.c | 6 ++-- arch/x86/mach-generic/numaq.c | 8 +------ arch/x86/mach-generic/probe.c | 24 ++++++++++++--------- arch/x86/mach-generic/summit.c | 2 +- 13 files changed, 29 insertions(+), 30 deletions(-)
arch/x86/include/asm/es7000/mpparse.h +1 -1
@@ -9,7 +9,7 @@ extern void unmap_unisys_acpi_oem_table(unsigned long oem_addr);extern void setup_unisys (void );#ifndef CONFIG_X86_GENERICARCH -extern int acpi_madt_oem_check (char *oem_id,char *oem_table_id); +extern int default_acpi_madt_oem_check (char *oem_id,char *oem_table_id);extern int mps_oem_check (struct mpc_table *mpc,char *oem,char *productid);#endif
arch/x86/include/asm/genapic.h +1 -1
@@ -103,7 +103,7 @@ extern struct genapic apic_flat;extern struct genapic apic_physflat;extern struct genapic apic_x2apic_cluster;extern struct genapic apic_x2apic_phys; -extern int acpi_madt_oem_check (char *,char *); +extern int default_acpi_madt_oem_check (char *,char *);extern void apic_send_IPI_self (int vector);
arch/x86/include/asm/mach-default/mach_mpparse.h +1 -1
@@ -8,7 +8,7 @@ mps_oem_check(struct mpc_table *mpc, char *oem, char *productid) }/* Hook from generic ACPI tables.c */ -static inline int acpi_madt_oem_check (char *oem_id,char *oem_table_id) +static inline int default_acpi_madt_oem_check (char *oem_id,char *oem_table_id) {return 0 ; }
arch/x86/include/asm/mach-generic/mach_mpparse.h +1 -1
@@ -4,6 +4,6 @@extern int mps_oem_check (struct mpc_table *,char *,char *); -extern int acpi_madt_oem_check (char *,char *); +extern int default_acpi_madt_oem_check (char *,char *);#endif /* _ASM_X86_MACH_GENERIC_MACH_MPPARSE_H */
arch/x86/include/asm/summit/mpparse.h +1 -1
@@ -27,7 +27,7 @@ static inline int mps_oem_check(struct mpc_table *mpc, char *oem, }/* Hook from generic ACPI tables.c */ -static inline int acpi_madt_oem_check (char *oem_id,char *oem_table_id) +static inline int summit_acpi_madt_oem_check (char *oem_id,char *oem_table_id) { if (!strncmp(oem_id, "IBM", 3) && (!strncmp(oem_table_id, "SERVIGIL", 8)
arch/x86/kernel/acpi/boot.c +2 -1
@@ -239,7 +239,8 @@ static int __init acpi_parse_madt(struct acpi_table_header *table) madt->address); } -acpi_madt_oem_check (madt->header.oem_id, madt->header.oem_table_id); +default_acpi_madt_oem_check (madt->header.oem_id, + madt->header.oem_table_id);return 0 ; }
arch/x86/kernel/genapic_64.c +1 -1
@@ -68,7 +68,7 @@ void apic_send_IPI_self(int vector)__send_IPI_shortcut (APIC_DEST_SELF , vector,APIC_DEST_PHYSICAL ); } -int __init acpi_madt_oem_check (char *oem_id,char *oem_table_id) +int __init default_acpi_madt_oem_check (char *oem_id,char *oem_table_id) {int i;
arch/x86/mach-generic/bigsmp.c +1 -1
@@ -61,7 +61,7 @@ struct genapic apic_bigsmp = { .name = "bigsmp", .probe = probe_bigsmp, - .acpi_madt_oem_check = acpi_madt_oem_check, + .acpi_madt_oem_check = NULL, .apic_id_registered = apic_id_registered, .int_delivery_mode = INT_DELIVERY_MODE,
arch/x86/mach-generic/default.c +1 -1
@@ -28,7 +28,7 @@ struct genapic apic_default = { .name = "default", .probe = probe_default, - .acpi_madt_oem_check = acpi_madt_oem_check, + .acpi_madt_oem_check = NULL, .apic_id_registered = apic_id_registered, .int_delivery_mode = INT_DELIVERY_MODE,
arch/x86/mach-generic/es7000.c +3 -3
@@ -57,7 +57,7 @@ mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)#ifdef CONFIG_ACPI /* Hook from generic ACPI tables.c */ -static int __init acpi_madt_oem_check (char *oem_id,char *oem_table_id) +static int __init es7000_acpi_madt_oem_check (char *oem_id,char *oem_table_id) {unsigned long oem_addr =0 ;int check_dsdt;
@@ -81,7 +81,7 @@ static int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id) return ret; }#else -static int __init acpi_madt_oem_check (char *oem_id,char *oem_table_id) +static int __init es7000_acpi_madt_oem_check (char *oem_id,char *oem_table_id) {return 0 ; }
@@ -104,7 +104,7 @@ struct genapic apic_es7000 = { .name = "es7000", .probe = probe_es7000, - .acpi_madt_oem_check = acpi_madt_oem_check, + .acpi_madt_oem_check = es7000_acpi_madt_oem_check, .apic_id_registered = apic_id_registered, .int_delivery_mode = INT_DELIVERY_MODE,
arch/x86/mach-generic/numaq.c +1 -7
@@ -31,12 +31,6 @@ static int probe_numaq(void)return found_numaq; } -/* Hook from generic ACPI tables.c */ -static int acpi_madt_oem_check (char *oem_id,char *oem_table_id) -{ -return 0 ; -} -static void vector_allocation_domain (int cpu,cpumask_t *retmask) {/* Careful. Some cpus do not strictly honor the set of cpus
@@ -54,7 +48,7 @@ struct genapic apic_numaq = { .name = "NUMAQ", .probe = probe_numaq, - .acpi_madt_oem_check = acpi_madt_oem_check, + .acpi_madt_oem_check = NULL, .apic_id_registered = apic_id_registered, .int_delivery_mode = INT_DELIVERY_MODE,
arch/x86/mach-generic/probe.c +14 -10
@@ -128,20 +128,24 @@ int __init mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)return 0 ; } -int __init acpi_madt_oem_check (char *oem_id,char *oem_table_id) +int __init default_acpi_madt_oem_check (char *oem_id,char *oem_table_id) {int i; +for (i =0 ; apic_probe[i]; ++i) { -if (apic_probe[i]->acpi_madt_oem_check (oem_id, oem_table_id)) { -if (!cmdline_apic) { - apic = apic_probe[i]; -if (x86_quirks->update_genapic) - x86_quirks->update_genapic (); -printk (KERN_INFO "Switched to APIC driver `%s'.\n" , - apic->name); - } -return 1 ; +if (!apic_probe[i]->acpi_madt_oem_check) +continue ; +if (!apic_probe[i]->acpi_madt_oem_check (oem_id, oem_table_id)) +continue ; + +if (!cmdline_apic) { + apic = apic_probe[i]; +if (x86_quirks->update_genapic) + x86_quirks->update_genapic (); +printk (KERN_INFO "Switched to APIC driver `%s'.\n" , + apic->name); } +return 1 ; }return 0 ; }
arch/x86/mach-generic/summit.c +1 -1
@@ -41,7 +41,7 @@ struct genapic apic_summit = { .name = "summit", .probe = probe_summit, - .acpi_madt_oem_check = acpi_madt_oem_check, + .acpi_madt_oem_check = summit_acpi_madt_oem_check, .apic_id_registered = apic_id_registered, .int_delivery_mode = INT_DELIVERY_MODE,
Signature · 1 line
1.6.0.2
PATCH 20/114 x86: clean up apic->apic_id_registered() methods
In reply to Ingo MolnarImpact: cleanup
x86 subarchitectures each defined a "apic_id_registered()" method, which could be an inline function depending on which subarch we build for, and which was also the name of a genapic field.
Untangle this namespace spaghetti by giving each of the instances a separate name.
Also remove wrapper macro obfuscation.
--- arch/x86/include/asm/bigsmp/apic.h | 4 ++-- arch/x86/include/asm/es7000/apic.h | 4 ++-- arch/x86/include/asm/mach-default/mach_apic.h | 3 +-- arch/x86/include/asm/mach-generic/mach_apic.h | 1 - arch/x86/include/asm/numaq/apic.h | 2 +- arch/x86/include/asm/summit/apic.h | 2 +- arch/x86/kernel/apic.c | 2 +- arch/x86/mach-generic/bigsmp.c | 2 +- arch/x86/mach-generic/default.c | 2 +- arch/x86/mach-generic/es7000.c | 2 +- arch/x86/mach-generic/numaq.c | 2 +- arch/x86/mach-generic/summit.c | 2 +- 12 files changed, 13 insertions(+), 15 deletions(-)
arch/x86/include/asm/bigsmp/apic.h +2 -2
@@ -4,9 +4,9 @@#define xapic_phys_to_log_apicid (cpu) (per_cpu(x86_bios_cpu_apicid, cpu))#define esr_disable (1) -static inline int apic_id_registered (void ) +static inline int bigsmp_apic_id_registered (void ) { -return (1 ); +return 1 ; }static inline const cpumask_t *target_cpus (void )
arch/x86/include/asm/es7000/apic.h +2 -2
@@ -6,9 +6,9 @@#define xapic_phys_to_log_apicid (cpu) per_cpu(x86_bios_cpu_apicid, cpu)#define esr_disable (1) -static inline int apic_id_registered (void ) +static inline int es7000_apic_id_registered (void ) { -return (1 ); +return 1 ; }static inline const cpumask_t *target_cpus_cluster (void )
arch/x86/include/asm/mach-default/mach_apic.h +1 -2
@@ -25,7 +25,6 @@ static inline const struct cpumask *target_cpus(void)#define INT_DELIVERY_MODE (apic->int_delivery_mode)#define INT_DEST_MODE (apic->int_dest_mode)#define TARGET_CPUS (apic->target_cpus()) -#define apic_id_registered (apic->apic_id_registered)#define init_apic_ldr (apic->init_apic_ldr)#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)#define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and)
@@ -57,7 +56,7 @@ static inline void init_apic_ldr(void)apic_write (APIC_LDR , val); } -static inline int apic_id_registered (void ) +static inline int default_apic_id_registered (void ) {return physid_isset (read_apic_id (), phys_cpu_present_map); }
arch/x86/include/asm/mach-generic/mach_apic.h +0 -1
@@ -10,7 +10,6 @@#undef APIC_DEST_LOGICAL#define APIC_DEST_LOGICAL (apic->apic_destination_logical)#define TARGET_CPUS (apic->target_cpus()) -#define apic_id_registered (apic->apic_id_registered)#define init_apic_ldr (apic->init_apic_ldr)#define ioapic_phys_id_map (apic->ioapic_phys_id_map)#define setup_apic_routing (apic->setup_apic_routing)
arch/x86/include/asm/numaq/apic.h +1 -1
@@ -28,7 +28,7 @@ static inline unsigned long check_apicid_present(int bit) }#define apicid_cluster (apicid) (apicid & 0xF0) -static inline int apic_id_registered (void ) +static inline int numaq_apic_id_registered (void ) {return 1 ; }
arch/x86/include/asm/summit/apic.h +1 -1
@@ -74,7 +74,7 @@ static inline int multi_timer_check(int apic, int irq)return 0 ; } -static inline int apic_id_registered (void ) +static inline int summit_apic_id_registered (void ) {return 1 ; }
arch/x86/kernel/apic.c +1 -1
@@ -1171,7 +1171,7 @@ void __cpuinit setup_local_APIC(void)* Double-check whether this APIC is really registered. * This is meaningless in clustered apic mode, so we skip it. */ -if (!apic_id_registered ()) +if (!apic->apic_id_registered ())BUG ();/*
arch/x86/mach-generic/bigsmp.c +1 -1
@@ -62,7 +62,7 @@ struct genapic apic_bigsmp = { .name = "bigsmp", .probe = probe_bigsmp, .acpi_madt_oem_check = NULL, - .apic_id_registered = apic_id_registered, + .apic_id_registered = bigsmp_apic_id_registered, .int_delivery_mode = INT_DELIVERY_MODE, .int_dest_mode = INT_DEST_MODE,
arch/x86/mach-generic/default.c +1 -1
@@ -29,7 +29,7 @@ struct genapic apic_default = { .name = "default", .probe = probe_default, .acpi_madt_oem_check = NULL, - .apic_id_registered = apic_id_registered, + .apic_id_registered = default_apic_id_registered, .int_delivery_mode = INT_DELIVERY_MODE, .int_dest_mode = INT_DEST_MODE,
arch/x86/mach-generic/es7000.c +1 -1
@@ -105,7 +105,7 @@ struct genapic apic_es7000 = { .name = "es7000", .probe = probe_es7000, .acpi_madt_oem_check = es7000_acpi_madt_oem_check, - .apic_id_registered = apic_id_registered, + .apic_id_registered = es7000_apic_id_registered, .int_delivery_mode = INT_DELIVERY_MODE, .int_dest_mode = INT_DEST_MODE,
arch/x86/mach-generic/numaq.c +1 -1
@@ -49,7 +49,7 @@ struct genapic apic_numaq = { .name = "NUMAQ", .probe = probe_numaq, .acpi_madt_oem_check = NULL, - .apic_id_registered = apic_id_registered, + .apic_id_registered = numaq_apic_id_registered, .int_delivery_mode = INT_DELIVERY_MODE, .int_dest_mode = INT_DEST_MODE,
arch/x86/mach-generic/summit.c +1 -1
@@ -42,7 +42,7 @@ struct genapic apic_summit = { .name = "summit", .probe = probe_summit, .acpi_madt_oem_check = summit_acpi_madt_oem_check, - .apic_id_registered = apic_id_registered, + .apic_id_registered = summit_apic_id_registered, .int_delivery_mode = INT_DELIVERY_MODE, .int_dest_mode = INT_DEST_MODE,
Signature · 1 line
1.6.0.2
PATCH 21/114 x86, genapic: rename int_delivery_mode, et. al.
In reply to Ingo Molnarint_delivery_mode is supposed to mean 'interrupt delivery mode', but it's quite a misnomer as 'int' we usually think of as an integer type ...
The standard naming for such attributes is 'irq' - so rename the following fields and macros:
int_delivery_mode => irq_delivery_mode
INT_DELIVERY_MODE => IRQ_DELIVERY_MODE
int_dest_mode => irq_dest_mode
INT_DEST_MODE => IRQ_DEST_MODE
--- arch/x86/include/asm/bigsmp/apic.h | 4 +- arch/x86/include/asm/es7000/apic.h | 4 +- arch/x86/include/asm/genapic.h | 4 +- arch/x86/include/asm/mach-default/mach_apic.h | 8 +++--- arch/x86/include/asm/mach-generic/mach_apic.h | 4 +- arch/x86/include/asm/numaq/apic.h | 4 +- arch/x86/include/asm/summit/apic.h | 4 +- arch/x86/kernel/genapic_flat_64.c | 8 +++--- arch/x86/kernel/genx2apic_cluster.c | 4 +- arch/x86/kernel/genx2apic_phys.c | 4 +- arch/x86/kernel/genx2apic_uv_x.c | 4 +- arch/x86/kernel/io_apic.c | 30 ++++++++++++------------ arch/x86/mach-generic/bigsmp.c | 4 +- arch/x86/mach-generic/default.c | 4 +- arch/x86/mach-generic/es7000.c | 8 +++--- arch/x86/mach-generic/numaq.c | 4 +- arch/x86/mach-generic/summit.c | 4 +- 17 files changed, 53 insertions(+), 53 deletions(-)
arch/x86/include/asm/bigsmp/apic.h +2 -2
@@ -21,8 +21,8 @@ static inline const cpumask_t *target_cpus(void)#undef APIC_DEST_LOGICAL#define APIC_DEST_LOGICAL 0#define APIC_DFR_VALUE (APIC_DFR_FLAT) -#define INT_DELIVERY_MODE (dest_Fixed) -#define INT_DEST_MODE (0)/* phys delivery to target proc */ +#define IRQ_DELIVERY_MODE (dest_Fixed) +#define IRQ_DEST_MODE (0)/* phys delivery to target proc */ #define NO_BALANCE_IRQ (0)static inline unsigned long check_apicid_used (physid_mask_t bitmap,int apicid)
arch/x86/include/asm/es7000/apic.h +2 -2
@@ -27,8 +27,8 @@ static inline const cpumask_t *target_cpus(void)#define NO_BALANCE_IRQ_CLUSTER (1)#define APIC_DFR_VALUE (APIC_DFR_FLAT) -#define INT_DELIVERY_MODE (dest_Fixed) -#define INT_DEST_MODE (0)/* phys delivery to target procs */ +#define IRQ_DELIVERY_MODE (dest_Fixed) +#define IRQ_DEST_MODE (0)/* phys delivery to target procs */ #define NO_BALANCE_IRQ (0)#undef APIC_DEST_LOGICAL#define APIC_DEST_LOGICAL 0x0
arch/x86/include/asm/genapic.h +2 -2
@@ -23,8 +23,8 @@ struct genapic {int (*acpi_madt_oem_check)(char *oem_id,char *oem_table_id);int (*apic_id_registered)(void ); -u32 int_delivery_mode; -u32 int_dest_mode; +u32 irq_delivery_mode; +u32 irq_dest_mode;const struct cpumask *(*target_cpus)(void );
arch/x86/include/asm/mach-default/mach_apic.h +4 -4
@@ -22,8 +22,8 @@ static inline const struct cpumask *target_cpus(void)#ifdef CONFIG_X86_64 #include <asm/genapic.h> -#define INT_DELIVERY_MODE (apic->int_delivery_mode) -#define INT_DEST_MODE (apic->int_dest_mode) +#define IRQ_DELIVERY_MODE (apic->irq_delivery_mode) +#define IRQ_DEST_MODE (apic->irq_dest_mode)#define TARGET_CPUS (apic->target_cpus())#define init_apic_ldr (apic->init_apic_ldr)#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)
@@ -35,8 +35,8 @@ static inline const struct cpumask *target_cpus(void)#define wakeup_secondary_cpu (apic->wakeup_cpu)extern void setup_apic_routing (void );#else -#define INT_DELIVERY_MODE dest_LowestPrio -#define INT_DEST_MODE 1/* logical delivery broadcast to all procs */ +#define IRQ_DELIVERY_MODE dest_LowestPrio +#define IRQ_DEST_MODE 1/* logical delivery broadcast to all procs */ #define TARGET_CPUS (target_cpus())#define wakeup_secondary_cpu wakeup_secondary_cpu_via_init/*
arch/x86/include/asm/mach-generic/mach_apic.h +2 -2
@@ -5,8 +5,8 @@#define esr_disable (apic->ESR_DISABLE)#define NO_BALANCE_IRQ (apic->no_balance_irq) -#define INT_DELIVERY_MODE (apic->int_delivery_mode) -#define INT_DEST_MODE (apic->int_dest_mode) +#define IRQ_DELIVERY_MODE (apic->irq_delivery_mode) +#define IRQ_DEST_MODE (apic->irq_dest_mode)#undef APIC_DEST_LOGICAL#define APIC_DEST_LOGICAL (apic->apic_destination_logical)#define TARGET_CPUS (apic->target_cpus())
arch/x86/include/asm/numaq/apic.h +2 -2
@@ -15,8 +15,8 @@ static inline const cpumask_t *target_cpus(void)#define NO_BALANCE_IRQ (1)#define esr_disable (1) -#define INT_DELIVERY_MODE dest_LowestPrio -#define INT_DEST_MODE 0/* physical delivery on LOCAL quad */ +#define IRQ_DELIVERY_MODE dest_LowestPrio +#define IRQ_DEST_MODE 0/* physical delivery on LOCAL quad */ static inline unsigned long check_apicid_used (physid_mask_t bitmap,int apicid) {
arch/x86/include/asm/summit/apic.h +2 -2
@@ -24,8 +24,8 @@ static inline const cpumask_t *target_cpus(void)return &cpumask_of_cpu (0 ); } -#define INT_DELIVERY_MODE (dest_LowestPrio) -#define INT_DEST_MODE 1/* logical delivery broadcast to all procs */ +#define IRQ_DELIVERY_MODE (dest_LowestPrio) +#define IRQ_DEST_MODE 1/* logical delivery broadcast to all procs */ static inline unsigned long check_apicid_used (physid_mask_t bitmap,int apicid) {
arch/x86/kernel/genapic_flat_64.c +4 -4
@@ -180,8 +180,8 @@ struct genapic apic_flat = { .acpi_madt_oem_check = flat_acpi_madt_oem_check, .apic_id_registered = flat_apic_id_registered, - .int_delivery_mode = dest_LowestPrio, - .int_dest_mode = (APIC_DEST_LOGICAL != 0), + .irq_delivery_mode = dest_LowestPrio, + .irq_dest_mode = (APIC_DEST_LOGICAL != 0), .target_cpus = flat_target_cpus, .ESR_DISABLE = 0,
@@ -326,8 +326,8 @@ struct genapic apic_physflat = { .acpi_madt_oem_check = physflat_acpi_madt_oem_check, .apic_id_registered = flat_apic_id_registered, - .int_delivery_mode = dest_Fixed, - .int_dest_mode = (APIC_DEST_PHYSICAL != 0), + .irq_delivery_mode = dest_Fixed, + .irq_dest_mode = (APIC_DEST_PHYSICAL != 0), .target_cpus = physflat_target_cpus, .ESR_DISABLE = 0,
arch/x86/kernel/genx2apic_cluster.c +2 -2
@@ -182,8 +182,8 @@ struct genapic apic_x2apic_cluster = { .acpi_madt_oem_check = x2apic_acpi_madt_oem_check, .apic_id_registered = x2apic_apic_id_registered, - .int_delivery_mode = dest_LowestPrio, - .int_dest_mode = (APIC_DEST_LOGICAL != 0), + .irq_delivery_mode = dest_LowestPrio, + .irq_dest_mode = (APIC_DEST_LOGICAL != 0), .target_cpus = x2apic_target_cpus, .ESR_DISABLE = 0,
arch/x86/kernel/genx2apic_phys.c +2 -2
@@ -178,8 +178,8 @@ struct genapic apic_x2apic_phys = { .acpi_madt_oem_check = x2apic_acpi_madt_oem_check, .apic_id_registered = x2apic_apic_id_registered, - .int_delivery_mode = dest_Fixed, - .int_dest_mode = (APIC_DEST_PHYSICAL != 0), + .irq_delivery_mode = dest_Fixed, + .irq_dest_mode = (APIC_DEST_PHYSICAL != 0), .target_cpus = x2apic_target_cpus, .ESR_DISABLE = 0,
arch/x86/kernel/genx2apic_uv_x.c +2 -2
@@ -243,8 +243,8 @@ struct genapic apic_x2apic_uv_x = { .acpi_madt_oem_check = uv_acpi_madt_oem_check, .apic_id_registered = uv_apic_id_registered, - .int_delivery_mode = dest_Fixed, - .int_dest_mode = (APIC_DEST_PHYSICAL != 0), + .irq_delivery_mode = dest_Fixed, + .irq_dest_mode = (APIC_DEST_PHYSICAL != 0), .target_cpus = uv_target_cpus, .ESR_DISABLE = 0,
arch/x86/kernel/io_apic.c +15 -15
@@ -1514,9 +1514,9 @@ static int setup_ioapic_entry(int apic_id, int irq,memset (&irte,0 ,sizeof (irte)); irte.present =1 ; - irte.dst_mode =INT_DEST_MODE ; + irte.dst_mode =IRQ_DEST_MODE ; irte.trigger_mode = trigger; - irte.dlvry_mode =INT_DELIVERY_MODE ; + irte.dlvry_mode =IRQ_DELIVERY_MODE ; irte.vector = vector; irte.dest_id =IRTE_DEST (destination);
@@ -1529,8 +1529,8 @@ static int setup_ioapic_entry(int apic_id, int irq, } else#endif { - entry->delivery_mode =INT_DELIVERY_MODE ; - entry->dest_mode =INT_DEST_MODE ; + entry->delivery_mode =IRQ_DELIVERY_MODE ; + entry->dest_mode =IRQ_DEST_MODE ; entry->dest = destination; }
@@ -1659,10 +1659,10 @@ static void __init setup_timer_IRQ0_pin(unsigned int apic_id, unsigned int pin,* We use logical delivery to get the timer IRQ * to the first CPU. */ - entry.dest_mode =INT_DEST_MODE ; + entry.dest_mode =IRQ_DEST_MODE ; entry.mask =1 ;/* mask IRQ now */ entry.dest =cpu_mask_to_apicid (TARGET_CPUS ); - entry.delivery_mode =INT_DELIVERY_MODE ; + entry.delivery_mode =IRQ_DELIVERY_MODE ; entry.polarity =0 ; entry.trigger =0 ; entry.vector = vector;
@@ -3279,9 +3279,9 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_msmemset (&irte,0 ,sizeof (irte)); irte.present =1 ; - irte.dst_mode =INT_DEST_MODE ; + irte.dst_mode =IRQ_DEST_MODE ; irte.trigger_mode =0 ;/* edge */ - irte.dlvry_mode =INT_DELIVERY_MODE ; + irte.dlvry_mode =IRQ_DELIVERY_MODE ; irte.vector = cfg->vector; irte.dest_id =IRTE_DEST (dest);
@@ -3299,10 +3299,10 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms msg->address_hi =MSI_ADDR_BASE_HI ; msg->address_lo =MSI_ADDR_BASE_LO | - ((INT_DEST_MODE ==0 ) ? + ((IRQ_DEST_MODE ==0 ) ?MSI_ADDR_DEST_MODE_PHYSICAL :MSI_ADDR_DEST_MODE_LOGICAL ) | - ((INT_DELIVERY_MODE != dest_LowestPrio) ? + ((IRQ_DELIVERY_MODE != dest_LowestPrio) ?MSI_ADDR_REDIRECTION_CPU :MSI_ADDR_REDIRECTION_LOWPRI ) |MSI_ADDR_DEST_ID (dest);
@@ -3310,7 +3310,7 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms msg->data =MSI_DATA_TRIGGER_EDGE |MSI_DATA_LEVEL_ASSERT | - ((INT_DELIVERY_MODE != dest_LowestPrio) ? + ((IRQ_DELIVERY_MODE != dest_LowestPrio) ?MSI_DATA_DELIVERY_FIXED :MSI_DATA_DELIVERY_LOWPRI ) |MSI_DATA_VECTOR (cfg->vector);
@@ -3711,11 +3711,11 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)HT_IRQ_LOW_BASE |HT_IRQ_LOW_DEST_ID (dest) |HT_IRQ_LOW_VECTOR (cfg->vector) | - ((INT_DEST_MODE ==0 ) ? + ((IRQ_DEST_MODE ==0 ) ?HT_IRQ_LOW_DM_PHYSICAL :HT_IRQ_LOW_DM_LOGICAL ) |HT_IRQ_LOW_RQEOI_EDGE | - ((INT_DELIVERY_MODE != dest_LowestPrio) ? + ((IRQ_DELIVERY_MODE != dest_LowestPrio) ?HT_IRQ_LOW_MT_FIXED :HT_IRQ_LOW_MT_ARBITRATED ) |HT_IRQ_LOW_IRQ_MASKED ;
@@ -3763,8 +3763,8 @@ int arch_enable_uv_irq(char *irq_name, unsigned int irq, int cpu, int mmr_blade,BUG_ON (sizeof (struct uv_IO_APIC_route_entry ) !=sizeof (unsigned long )); entry->vector = cfg->vector; - entry->delivery_mode =INT_DELIVERY_MODE ; - entry->dest_mode =INT_DEST_MODE ; + entry->delivery_mode =IRQ_DELIVERY_MODE ; + entry->dest_mode =IRQ_DEST_MODE ; entry->polarity =0 ; entry->trigger =0 ; entry->mask =0 ;
arch/x86/mach-generic/bigsmp.c +2 -2
@@ -64,8 +64,8 @@ struct genapic apic_bigsmp = { .acpi_madt_oem_check = NULL, .apic_id_registered = bigsmp_apic_id_registered, - .int_delivery_mode = INT_DELIVERY_MODE, - .int_dest_mode = INT_DEST_MODE, + .irq_delivery_mode = IRQ_DELIVERY_MODE, + .irq_dest_mode = IRQ_DEST_MODE, .target_cpus = target_cpus, .ESR_DISABLE = esr_disable,
arch/x86/mach-generic/default.c +2 -2
@@ -31,8 +31,8 @@ struct genapic apic_default = { .acpi_madt_oem_check = NULL, .apic_id_registered = default_apic_id_registered, - .int_delivery_mode = INT_DELIVERY_MODE, - .int_dest_mode = INT_DEST_MODE, + .irq_delivery_mode = IRQ_DELIVERY_MODE, + .irq_dest_mode = IRQ_DEST_MODE, .target_cpus = target_cpus, .ESR_DISABLE = esr_disable,
arch/x86/mach-generic/es7000.c +4 -4
@@ -21,8 +21,8 @@void __init es7000_update_genapic_to_cluster (void ) { apic->target_cpus = target_cpus_cluster; - apic->int_delivery_mode =INT_DELIVERY_MODE_CLUSTER ; - apic->int_dest_mode =INT_DEST_MODE_CLUSTER ; + apic->irq_delivery_mode =INT_DELIVERY_MODE_CLUSTER ; + apic->irq_dest_mode =INT_DEST_MODE_CLUSTER ; apic->no_balance_irq =NO_BALANCE_IRQ_CLUSTER ; apic->init_apic_ldr = init_apic_ldr_cluster;
@@ -107,8 +107,8 @@ struct genapic apic_es7000 = { .acpi_madt_oem_check = es7000_acpi_madt_oem_check, .apic_id_registered = es7000_apic_id_registered, - .int_delivery_mode = INT_DELIVERY_MODE, - .int_dest_mode = INT_DEST_MODE, + .irq_delivery_mode = IRQ_DELIVERY_MODE, + .irq_dest_mode = IRQ_DEST_MODE, .target_cpus = target_cpus, .ESR_DISABLE = esr_disable,
arch/x86/mach-generic/numaq.c +2 -2
@@ -51,8 +51,8 @@ struct genapic apic_numaq = { .acpi_madt_oem_check = NULL, .apic_id_registered = numaq_apic_id_registered, - .int_delivery_mode = INT_DELIVERY_MODE, - .int_dest_mode = INT_DEST_MODE, + .irq_delivery_mode = IRQ_DELIVERY_MODE, + .irq_dest_mode = IRQ_DEST_MODE, .target_cpus = target_cpus, .ESR_DISABLE = esr_disable,
arch/x86/mach-generic/summit.c +2 -2
@@ -44,8 +44,8 @@ struct genapic apic_summit = { .acpi_madt_oem_check = summit_acpi_madt_oem_check, .apic_id_registered = summit_apic_id_registered, - .int_delivery_mode = INT_DELIVERY_MODE, - .int_dest_mode = INT_DEST_MODE, + .irq_delivery_mode = IRQ_DELIVERY_MODE, + .irq_dest_mode = IRQ_DEST_MODE, .target_cpus = target_cpus, .ESR_DISABLE = esr_disable,
Signature · 1 line
1.6.0.2
PATCH 22/114 x86, apic: remove IRQ_DEST_MODE / IRQ_DELIVERY_MODE
In reply to Ingo MolnarRemove the wrapper macros IRQ_DEST_MODE and IRQ_DELIVERY_MODE.
The typical 32-bit and the 64-bit build all dereference via the genapic, so it's pointless to hide that indirection via these ugly macros.
Furthermore, it also obscures subarchitecture details.
So replace it with apic->irq_dest_mode / etc. accesses.
--- arch/x86/include/asm/bigsmp/apic.h | 4 +- arch/x86/include/asm/es7000/apic.h | 4 +- arch/x86/include/asm/mach-default/mach_apic.h | 5 +-- arch/x86/include/asm/mach-generic/mach_apic.h | 2 - arch/x86/include/asm/numaq/apic.h | 4 +- arch/x86/include/asm/summit/apic.h | 4 +- arch/x86/kernel/io_apic.c | 30 ++++++++++++------------ arch/x86/mach-generic/bigsmp.c | 4 +- arch/x86/mach-generic/default.c | 4 +- arch/x86/mach-generic/es7000.c | 4 +- arch/x86/mach-generic/numaq.c | 4 +- arch/x86/mach-generic/summit.c | 4 +- 12 files changed, 35 insertions(+), 38 deletions(-)
arch/x86/include/asm/bigsmp/apic.h +2 -2
@@ -21,8 +21,8 @@ static inline const cpumask_t *target_cpus(void)#undef APIC_DEST_LOGICAL#define APIC_DEST_LOGICAL 0#define APIC_DFR_VALUE (APIC_DFR_FLAT) -#define IRQ_DELIVERY_MODE (dest_Fixed) -#define IRQ_DEST_MODE (0)/* phys delivery to target proc */ +#define BIGSMP_IRQ_DELIVERY_MODE (dest_Fixed) +#define BIGSMP_IRQ_DEST_MODE (0)/* phys delivery to target proc */ #define NO_BALANCE_IRQ (0)static inline unsigned long check_apicid_used (physid_mask_t bitmap,int apicid)
arch/x86/include/asm/es7000/apic.h +2 -2
@@ -27,8 +27,8 @@ static inline const cpumask_t *target_cpus(void)#define NO_BALANCE_IRQ_CLUSTER (1)#define APIC_DFR_VALUE (APIC_DFR_FLAT) -#define IRQ_DELIVERY_MODE (dest_Fixed) -#define IRQ_DEST_MODE (0)/* phys delivery to target procs */ +#define ES7000_IRQ_DELIVERY_MODE (dest_Fixed) +#define ES7000_IRQ_DEST_MODE (0)/* phys delivery to target procs */ #define NO_BALANCE_IRQ (0)#undef APIC_DEST_LOGICAL#define APIC_DEST_LOGICAL 0x0
arch/x86/include/asm/mach-default/mach_apic.h +2 -3
@@ -22,7 +22,6 @@ static inline const struct cpumask *target_cpus(void)#ifdef CONFIG_X86_64 #include <asm/genapic.h> -#define IRQ_DELIVERY_MODE (apic->irq_delivery_mode)#define IRQ_DEST_MODE (apic->irq_dest_mode)#define TARGET_CPUS (apic->target_cpus())#define init_apic_ldr (apic->init_apic_ldr)
@@ -35,8 +34,8 @@ static inline const struct cpumask *target_cpus(void)#define wakeup_secondary_cpu (apic->wakeup_cpu)extern void setup_apic_routing (void );#else -#define IRQ_DELIVERY_MODE dest_LowestPrio -#define IRQ_DEST_MODE 1/* logical delivery broadcast to all procs */ +#define DEFAULT_IRQ_DELIVERY_MODE dest_LowestPrio +#define DEFAULT_IRQ_DEST_MODE 1/* logical delivery broadcast to all procs */ #define TARGET_CPUS (target_cpus())#define wakeup_secondary_cpu wakeup_secondary_cpu_via_init/*
arch/x86/include/asm/mach-generic/mach_apic.h +0 -2
@@ -5,8 +5,6 @@#define esr_disable (apic->ESR_DISABLE)#define NO_BALANCE_IRQ (apic->no_balance_irq) -#define IRQ_DELIVERY_MODE (apic->irq_delivery_mode) -#define IRQ_DEST_MODE (apic->irq_dest_mode)#undef APIC_DEST_LOGICAL#define APIC_DEST_LOGICAL (apic->apic_destination_logical)#define TARGET_CPUS (apic->target_cpus())
arch/x86/include/asm/numaq/apic.h +2 -2
@@ -15,8 +15,8 @@ static inline const cpumask_t *target_cpus(void)#define NO_BALANCE_IRQ (1)#define esr_disable (1) -#define IRQ_DELIVERY_MODE dest_LowestPrio -#define IRQ_DEST_MODE 0/* physical delivery on LOCAL quad */ +#define NUMAQ_IRQ_DELIVERY_MODE dest_LowestPrio +#define NUMAQ_IRQ_DEST_MODE 0/* physical delivery on LOCAL quad */ static inline unsigned long check_apicid_used (physid_mask_t bitmap,int apicid) {
arch/x86/include/asm/summit/apic.h +2 -2
@@ -24,8 +24,8 @@ static inline const cpumask_t *target_cpus(void)return &cpumask_of_cpu (0 ); } -#define IRQ_DELIVERY_MODE (dest_LowestPrio) -#define IRQ_DEST_MODE 1/* logical delivery broadcast to all procs */ +#define SUMMIT_IRQ_DELIVERY_MODE (dest_LowestPrio) +#define SUMMIT_IRQ_DEST_MODE 1/* logical delivery broadcast to all procs */ static inline unsigned long check_apicid_used (physid_mask_t bitmap,int apicid) {
arch/x86/kernel/io_apic.c +15 -15
@@ -1514,9 +1514,9 @@ static int setup_ioapic_entry(int apic_id, int irq,memset (&irte,0 ,sizeof (irte)); irte.present =1 ; - irte.dst_mode =IRQ_DEST_MODE ; + irte.dst_mode = apic->irq_dest_mode; irte.trigger_mode = trigger; - irte.dlvry_mode =IRQ_DELIVERY_MODE ; + irte.dlvry_mode = apic->irq_delivery_mode; irte.vector = vector; irte.dest_id =IRTE_DEST (destination);
@@ -1529,8 +1529,8 @@ static int setup_ioapic_entry(int apic_id, int irq, } else#endif { - entry->delivery_mode =IRQ_DELIVERY_MODE ; - entry->dest_mode =IRQ_DEST_MODE ; + entry->delivery_mode = apic->irq_delivery_mode; + entry->dest_mode = apic->irq_dest_mode; entry->dest = destination; }
@@ -1659,10 +1659,10 @@ static void __init setup_timer_IRQ0_pin(unsigned int apic_id, unsigned int pin,* We use logical delivery to get the timer IRQ * to the first CPU. */ - entry.dest_mode =IRQ_DEST_MODE ; + entry.dest_mode = apic->irq_dest_mode; entry.mask =1 ;/* mask IRQ now */ entry.dest =cpu_mask_to_apicid (TARGET_CPUS ); - entry.delivery_mode =IRQ_DELIVERY_MODE ; + entry.delivery_mode = apic->irq_delivery_mode; entry.polarity =0 ; entry.trigger =0 ; entry.vector = vector;
@@ -3279,9 +3279,9 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_msmemset (&irte,0 ,sizeof (irte)); irte.present =1 ; - irte.dst_mode =IRQ_DEST_MODE ; + irte.dst_mode = apic->irq_dest_mode; irte.trigger_mode =0 ;/* edge */ - irte.dlvry_mode =IRQ_DELIVERY_MODE ; + irte.dlvry_mode = apic->irq_delivery_mode; irte.vector = cfg->vector; irte.dest_id =IRTE_DEST (dest);
@@ -3299,10 +3299,10 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms msg->address_hi =MSI_ADDR_BASE_HI ; msg->address_lo =MSI_ADDR_BASE_LO | - ((IRQ_DEST_MODE ==0 ) ? + ((apic->irq_dest_mode ==0 ) ?MSI_ADDR_DEST_MODE_PHYSICAL :MSI_ADDR_DEST_MODE_LOGICAL ) | - ((IRQ_DELIVERY_MODE != dest_LowestPrio) ? + ((apic->irq_delivery_mode != dest_LowestPrio) ?MSI_ADDR_REDIRECTION_CPU :MSI_ADDR_REDIRECTION_LOWPRI ) |MSI_ADDR_DEST_ID (dest);
@@ -3310,7 +3310,7 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms msg->data =MSI_DATA_TRIGGER_EDGE |MSI_DATA_LEVEL_ASSERT | - ((IRQ_DELIVERY_MODE != dest_LowestPrio) ? + ((apic->irq_delivery_mode != dest_LowestPrio) ?MSI_DATA_DELIVERY_FIXED :MSI_DATA_DELIVERY_LOWPRI ) |MSI_DATA_VECTOR (cfg->vector);
@@ -3711,11 +3711,11 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)HT_IRQ_LOW_BASE |HT_IRQ_LOW_DEST_ID (dest) |HT_IRQ_LOW_VECTOR (cfg->vector) | - ((IRQ_DEST_MODE ==0 ) ? + ((apic->irq_dest_mode ==0 ) ?HT_IRQ_LOW_DM_PHYSICAL :HT_IRQ_LOW_DM_LOGICAL ) |HT_IRQ_LOW_RQEOI_EDGE | - ((IRQ_DELIVERY_MODE != dest_LowestPrio) ? + ((apic->irq_delivery_mode != dest_LowestPrio) ?HT_IRQ_LOW_MT_FIXED :HT_IRQ_LOW_MT_ARBITRATED ) |HT_IRQ_LOW_IRQ_MASKED ;
@@ -3763,8 +3763,8 @@ int arch_enable_uv_irq(char *irq_name, unsigned int irq, int cpu, int mmr_blade,BUG_ON (sizeof (struct uv_IO_APIC_route_entry ) !=sizeof (unsigned long )); entry->vector = cfg->vector; - entry->delivery_mode =IRQ_DELIVERY_MODE ; - entry->dest_mode =IRQ_DEST_MODE ; + entry->delivery_mode = apic->irq_delivery_mode; + entry->dest_mode = apic->irq_dest_mode; entry->polarity =0 ; entry->trigger =0 ; entry->mask =0 ;
arch/x86/mach-generic/bigsmp.c +2 -2
@@ -64,8 +64,8 @@ struct genapic apic_bigsmp = { .acpi_madt_oem_check = NULL, .apic_id_registered = bigsmp_apic_id_registered, - .irq_delivery_mode = IRQ_DELIVERY_MODE, - .irq_dest_mode = IRQ_DEST_MODE, + .irq_delivery_mode = BIGSMP_IRQ_DELIVERY_MODE, + .irq_dest_mode = BIGSMP_IRQ_DEST_MODE, .target_cpus = target_cpus, .ESR_DISABLE = esr_disable,
arch/x86/mach-generic/default.c +2 -2
@@ -31,8 +31,8 @@ struct genapic apic_default = { .acpi_madt_oem_check = NULL, .apic_id_registered = default_apic_id_registered, - .irq_delivery_mode = IRQ_DELIVERY_MODE, - .irq_dest_mode = IRQ_DEST_MODE, + .irq_delivery_mode = DEFAULT_IRQ_DELIVERY_MODE, + .irq_dest_mode = DEFAULT_IRQ_DEST_MODE, .target_cpus = target_cpus, .ESR_DISABLE = esr_disable,
arch/x86/mach-generic/es7000.c +2 -2
@@ -107,8 +107,8 @@ struct genapic apic_es7000 = { .acpi_madt_oem_check = es7000_acpi_madt_oem_check, .apic_id_registered = es7000_apic_id_registered, - .irq_delivery_mode = IRQ_DELIVERY_MODE, - .irq_dest_mode = IRQ_DEST_MODE, + .irq_delivery_mode = ES7000_IRQ_DELIVERY_MODE, + .irq_dest_mode = ES7000_IRQ_DEST_MODE, .target_cpus = target_cpus, .ESR_DISABLE = esr_disable,
arch/x86/mach-generic/numaq.c +2 -2
@@ -51,8 +51,8 @@ struct genapic apic_numaq = { .acpi_madt_oem_check = NULL, .apic_id_registered = numaq_apic_id_registered, - .irq_delivery_mode = IRQ_DELIVERY_MODE, - .irq_dest_mode = IRQ_DEST_MODE, + .irq_delivery_mode = NUMAQ_IRQ_DELIVERY_MODE, + .irq_dest_mode = NUMAQ_IRQ_DEST_MODE, .target_cpus = target_cpus, .ESR_DISABLE = esr_disable,
arch/x86/mach-generic/summit.c +2 -2
@@ -44,8 +44,8 @@ struct genapic apic_summit = { .acpi_madt_oem_check = summit_acpi_madt_oem_check, .apic_id_registered = summit_apic_id_registered, - .irq_delivery_mode = IRQ_DELIVERY_MODE, - .irq_dest_mode = IRQ_DEST_MODE, + .irq_delivery_mode = SUMMIT_IRQ_DELIVERY_MODE, + .irq_dest_mode = SUMMIT_IRQ_DEST_MODE, .target_cpus = target_cpus, .ESR_DISABLE = esr_disable,
Signature · 1 line
1.6.0.2
PATCH 23/114 x86, apic: remove DEFAULT_IRQ_DELIVERY_MODE and DEFAULT_IRQ_DEST_MODE
In reply to Ingo MolnarImpact: cleanup
They were only used in a single place and obscured the apic_default template.
--- arch/x86/include/asm/mach-default/mach_apic.h | 2 -- arch/x86/mach-generic/default.c | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-)
arch/x86/include/asm/mach-default/mach_apic.h +0 -2
@@ -34,8 +34,6 @@ static inline const struct cpumask *target_cpus(void)#define wakeup_secondary_cpu (apic->wakeup_cpu)extern void setup_apic_routing (void );#else -#define DEFAULT_IRQ_DELIVERY_MODE dest_LowestPrio -#define DEFAULT_IRQ_DEST_MODE 1/* logical delivery broadcast to all procs */ #define TARGET_CPUS (target_cpus())#define wakeup_secondary_cpu wakeup_secondary_cpu_via_init/*
arch/x86/mach-generic/default.c +3 -2
@@ -31,8 +31,9 @@ struct genapic apic_default = { .acpi_madt_oem_check = NULL, .apic_id_registered = default_apic_id_registered, - .irq_delivery_mode = DEFAULT_IRQ_DELIVERY_MODE, - .irq_dest_mode = DEFAULT_IRQ_DEST_MODE, + .irq_delivery_mode = dest_LowestPrio, +/* logical delivery broadcast to all CPUs: */ + .irq_dest_mode = 1, .target_cpus = target_cpus, .ESR_DISABLE = esr_disable,
Signature · 1 line
1.6.0.2
PATCH 24/114 x86, apic: remove SUMMIT_IRQ_DELIVERY_MODE and SUMMIT_IRQ_DEST_MODE
In reply to Ingo MolnarImpact: cleanup
They were only used in a single place and obscured the apic_summit template.
--- arch/x86/include/asm/summit/apic.h | 3 --- arch/x86/mach-generic/summit.c | 5 +++-- 2 files changed, 3 insertions(+), 5 deletions(-)
arch/x86/include/asm/summit/apic.h +0 -3
@@ -24,9 +24,6 @@ static inline const cpumask_t *target_cpus(void)return &cpumask_of_cpu (0 ); } -#define SUMMIT_IRQ_DELIVERY_MODE (dest_LowestPrio) -#define SUMMIT_IRQ_DEST_MODE 1/* logical delivery broadcast to all procs */ -static inline unsigned long check_apicid_used (physid_mask_t bitmap,int apicid) {return 0 ;
arch/x86/mach-generic/summit.c +3 -2
@@ -44,8 +44,9 @@ struct genapic apic_summit = { .acpi_madt_oem_check = summit_acpi_madt_oem_check, .apic_id_registered = summit_apic_id_registered, - .irq_delivery_mode = SUMMIT_IRQ_DELIVERY_MODE, - .irq_dest_mode = SUMMIT_IRQ_DEST_MODE, + .irq_delivery_mode = dest_LowestPrio, +/* logical delivery broadcast to all CPUs: */ + .irq_dest_mode = 1, .target_cpus = target_cpus, .ESR_DISABLE = esr_disable,
Signature · 1 line
1.6.0.2
PATCH 25/114 x86, apic: remove NUMAQ_IRQ_DELIVERY_MODE and NUMAQ_IRQ_DEST_MODE
In reply to Ingo MolnarImpact: cleanup
They were only used in a single place and obscured the apic_numaq template.
--- arch/x86/include/asm/numaq/apic.h | 3 --- arch/x86/mach-generic/numaq.c | 5 +++-- 2 files changed, 3 insertions(+), 5 deletions(-)
arch/x86/include/asm/numaq/apic.h +0 -3
@@ -15,9 +15,6 @@ static inline const cpumask_t *target_cpus(void)#define NO_BALANCE_IRQ (1)#define esr_disable (1) -#define NUMAQ_IRQ_DELIVERY_MODE dest_LowestPrio -#define NUMAQ_IRQ_DEST_MODE 0/* physical delivery on LOCAL quad */ -static inline unsigned long check_apicid_used (physid_mask_t bitmap,int apicid) {return physid_isset (apicid, bitmap);
arch/x86/mach-generic/numaq.c +3 -2
@@ -51,8 +51,9 @@ struct genapic apic_numaq = { .acpi_madt_oem_check = NULL, .apic_id_registered = numaq_apic_id_registered, - .irq_delivery_mode = NUMAQ_IRQ_DELIVERY_MODE, - .irq_dest_mode = NUMAQ_IRQ_DEST_MODE, + .irq_delivery_mode = dest_LowestPrio, +/* physical delivery on LOCAL quad: */ + .irq_dest_mode = 0, .target_cpus = target_cpus, .ESR_DISABLE = esr_disable,
Signature · 1 line
1.6.0.2
PATCH 26/114 x86, apic: remove BIGSMP_IRQ_DELIVERY_MODE and BIGSMP_IRQ_DEST_MODE
In reply to Ingo MolnarImpact: cleanup
They were only used in a single place and obscured the apic_bigsmp driver template.
--- arch/x86/include/asm/bigsmp/apic.h | 2 -- arch/x86/mach-generic/bigsmp.c | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-)
arch/x86/include/asm/bigsmp/apic.h +0 -2
@@ -21,8 +21,6 @@ static inline const cpumask_t *target_cpus(void)#undef APIC_DEST_LOGICAL#define APIC_DEST_LOGICAL 0#define APIC_DFR_VALUE (APIC_DFR_FLAT) -#define BIGSMP_IRQ_DELIVERY_MODE (dest_Fixed) -#define BIGSMP_IRQ_DEST_MODE (0)/* phys delivery to target proc */ #define NO_BALANCE_IRQ (0)static inline unsigned long check_apicid_used (physid_mask_t bitmap,int apicid)
arch/x86/mach-generic/bigsmp.c +3 -2
@@ -64,8 +64,9 @@ struct genapic apic_bigsmp = { .acpi_madt_oem_check = NULL, .apic_id_registered = bigsmp_apic_id_registered, - .irq_delivery_mode = BIGSMP_IRQ_DELIVERY_MODE, - .irq_dest_mode = BIGSMP_IRQ_DEST_MODE, + .irq_delivery_mode = dest_Fixed, +/* phys delivery to target CPU: */ + .irq_dest_mode = 0, .target_cpus = target_cpus, .ESR_DISABLE = esr_disable,
Signature · 1 line
1.6.0.2
PATCH 27/114 x86, apic: remove ES7000_IRQ_DELIVERY_MODE and ES7000_IRQ_DEST_MODE
In reply to Ingo MolnarImpact: cleanup
They were only used in a single place and obscured the apic_es7000 driver template.
--- arch/x86/include/asm/es7000/apic.h | 2 -- arch/x86/mach-generic/es7000.c | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-)
arch/x86/include/asm/es7000/apic.h +0 -2
@@ -27,8 +27,6 @@ static inline const cpumask_t *target_cpus(void)#define NO_BALANCE_IRQ_CLUSTER (1)#define APIC_DFR_VALUE (APIC_DFR_FLAT) -#define ES7000_IRQ_DELIVERY_MODE (dest_Fixed) -#define ES7000_IRQ_DEST_MODE (0)/* phys delivery to target procs */ #define NO_BALANCE_IRQ (0)#undef APIC_DEST_LOGICAL#define APIC_DEST_LOGICAL 0x0
arch/x86/mach-generic/es7000.c +3 -2
@@ -107,8 +107,9 @@ struct genapic apic_es7000 = { .acpi_madt_oem_check = es7000_acpi_madt_oem_check, .apic_id_registered = es7000_apic_id_registered, - .irq_delivery_mode = ES7000_IRQ_DELIVERY_MODE, - .irq_dest_mode = ES7000_IRQ_DEST_MODE, + .irq_delivery_mode = dest_Fixed, +/* phys delivery to target CPUs: */ + .irq_dest_mode = 0, .target_cpus = target_cpus, .ESR_DISABLE = esr_disable,
Signature · 1 line
1.6.0.2
PATCH 28/114 x86, apic: remove IRQ_DEST_MODE
In reply to Ingo MolnarRemove leftover definition.
--- arch/x86/include/asm/mach-default/mach_apic.h | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
arch/x86/include/asm/mach-default/mach_apic.h +0 -1
@@ -22,7 +22,6 @@ static inline const struct cpumask *target_cpus(void)#ifdef CONFIG_X86_64 #include <asm/genapic.h> -#define IRQ_DEST_MODE (apic->irq_dest_mode)#define TARGET_CPUS (apic->target_cpus())#define init_apic_ldr (apic->init_apic_ldr)#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)
Signature · 1 line
1.6.0.2
PATCH 29/114 x86, apic: clean up target_cpus methods
In reply to Ingo MolnarImpact: cleanup
Clean up all the target_cpus() namespace overlap that exists between bigsmp, es7000, mach-default, numaq and summit - by separating the different functions into different names.
--- arch/x86/include/asm/bigsmp/apic.h | 2 +- arch/x86/include/asm/es7000/apic.h | 4 ++-- arch/x86/include/asm/mach-default/mach_apic.h | 4 ++-- arch/x86/include/asm/numaq/apic.h | 2 +- arch/x86/include/asm/summit/apic.h | 2 +- arch/x86/mach-generic/bigsmp.c | 2 +- arch/x86/mach-generic/default.c | 2 +- arch/x86/mach-generic/es7000.c | 2 +- arch/x86/mach-generic/numaq.c | 2 +- arch/x86/mach-generic/summit.c | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-)
arch/x86/include/asm/bigsmp/apic.h +1 -1
@@ -9,7 +9,7 @@ static inline int bigsmp_apic_id_registered(void)return 1 ; } -static inline const cpumask_t *target_cpus (void ) +static inline const cpumask_t *bigsmp_target_cpus (void ) {#ifdef CONFIG_SMP return &cpu_online_map;
arch/x86/include/asm/es7000/apic.h +2 -2
@@ -16,7 +16,7 @@ static inline const cpumask_t *target_cpus_cluster(void)return &CPU_MASK_ALL ; } -static inline const cpumask_t *target_cpus (void ) +static inline const cpumask_t *es7000_target_cpus (void ) {return &cpumask_of_cpu (smp_processor_id ()); }
@@ -83,7 +83,7 @@ static inline void setup_apic_routing(void)printk ("Enabling APIC mode: %s. Using %d I/O APICs, target cpus %lx\n" , (apic_version[apic] ==0x14 ) ?"Physical Cluster" :"Logical Cluster" , - nr_ioapics,cpus_addr (*target_cpus ())[0 ]); + nr_ioapics,cpus_addr (*es7000_target_cpus ())[0 ]); }static inline int multi_timer_check (int apic,int irq)
arch/x86/include/asm/mach-default/mach_apic.h +2 -2
@@ -8,7 +8,7 @@#define APIC_DFR_VALUE (APIC_DFR_FLAT) -static inline const struct cpumask *target_cpus (void ) +static inline const struct cpumask *default_target_cpus (void ) {#ifdef CONFIG_SMP return cpu_online_mask;
@@ -33,7 +33,7 @@ static inline const struct cpumask *target_cpus(void)#define wakeup_secondary_cpu (apic->wakeup_cpu)extern void setup_apic_routing (void );#else -#define TARGET_CPUS (target_cpus()) +#define TARGET_CPUS (default_target_cpus())#define wakeup_secondary_cpu wakeup_secondary_cpu_via_init/* * Set up the logical destination ID.
arch/x86/include/asm/numaq/apic.h +1 -1
@@ -7,7 +7,7 @@#define APIC_DFR_VALUE (APIC_DFR_CLUSTER) -static inline const cpumask_t *target_cpus (void ) +static inline const cpumask_t *numaq_target_cpus (void ) {return &CPU_MASK_ALL ; }
arch/x86/include/asm/summit/apic.h +1 -1
@@ -15,7 +15,7 @@#define APIC_DFR_VALUE (APIC_DFR_CLUSTER) -static inline const cpumask_t *target_cpus (void ) +static inline const cpumask_t *summit_target_cpus (void ) {/* CPU_MASK_ALL (0xff) has undefined behaviour with * dest_LowestPrio mode logical clustered apic interrupt routing
arch/x86/mach-generic/bigsmp.c +1 -1
@@ -68,7 +68,7 @@ struct genapic apic_bigsmp = {/* phys delivery to target CPU: */ .irq_dest_mode = 0, - .target_cpus = target_cpus, + .target_cpus = bigsmp_target_cpus, .ESR_DISABLE = esr_disable, .apic_destination_logical = APIC_DEST_LOGICAL, .check_apicid_used = check_apicid_used,
arch/x86/mach-generic/default.c +1 -1
@@ -35,7 +35,7 @@ struct genapic apic_default = {/* logical delivery broadcast to all CPUs: */ .irq_dest_mode = 1, - .target_cpus = target_cpus, + .target_cpus = default_target_cpus, .ESR_DISABLE = esr_disable, .apic_destination_logical = APIC_DEST_LOGICAL, .check_apicid_used = check_apicid_used,
arch/x86/mach-generic/es7000.c +1 -1
@@ -111,7 +111,7 @@ struct genapic apic_es7000 = {/* phys delivery to target CPUs: */ .irq_dest_mode = 0, - .target_cpus = target_cpus, + .target_cpus = es7000_target_cpus, .ESR_DISABLE = esr_disable, .apic_destination_logical = APIC_DEST_LOGICAL, .check_apicid_used = check_apicid_used,
arch/x86/mach-generic/numaq.c +1 -1
@@ -55,7 +55,7 @@ struct genapic apic_numaq = {/* physical delivery on LOCAL quad: */ .irq_dest_mode = 0, - .target_cpus = target_cpus, + .target_cpus = numaq_target_cpus, .ESR_DISABLE = esr_disable, .apic_destination_logical = APIC_DEST_LOGICAL, .check_apicid_used = check_apicid_used,
arch/x86/mach-generic/summit.c +1 -1
@@ -48,7 +48,7 @@ struct genapic apic_summit = {/* logical delivery broadcast to all CPUs: */ .irq_dest_mode = 1, - .target_cpus = target_cpus, + .target_cpus = summit_target_cpus, .ESR_DISABLE = esr_disable, .apic_destination_logical = APIC_DEST_LOGICAL, .check_apicid_used = check_apicid_used,
Signature · 1 line
1.6.0.2
PATCH 30/114 x86, apic: clean up / remove TARGET_CPUS
In reply to Ingo MolnarImpact: cleanup
use apic->target_cpus() directly instead of the TARGET_CPUS wrapper.
--- arch/x86/include/asm/es7000/apic.h | 4 ++-- arch/x86/include/asm/mach-default/mach_apic.h | 2 -- arch/x86/include/asm/mach-generic/mach_apic.h | 1 - arch/x86/include/asm/summit/apic.h | 2 +- arch/x86/kernel/io_apic.c | 22 +++++++++++----------- 5 files changed, 14 insertions(+), 17 deletions(-)
arch/x86/include/asm/es7000/apic.h +2 -2
@@ -161,7 +161,7 @@ cpu_mask_to_apicid_cluster(const struct cpumask *cpumask)return 0xFF ;/* * The cpus in the mask must all be on the apic cluster. If are not -* on the same apicid cluster return default value of TARGET_CPUS. +* on the same apicid cluster return default value of target_cpus(): */ cpu =cpumask_first (cpumask); apicid =cpu_to_logical_apicid (cpu);
@@ -194,7 +194,7 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)return cpu_to_logical_apicid (0 );/* * The cpus in the mask must all be on the apic cluster. If are not -* on the same apicid cluster return default value of TARGET_CPUS. +* on the same apicid cluster return default value of target_cpus(): */ cpu =first_cpu (*cpumask); apicid =cpu_to_logical_apicid (cpu);
arch/x86/include/asm/mach-default/mach_apic.h +0 -2
@@ -22,7 +22,6 @@ static inline const struct cpumask *default_target_cpus(void)#ifdef CONFIG_X86_64 #include <asm/genapic.h> -#define TARGET_CPUS (apic->target_cpus())#define init_apic_ldr (apic->init_apic_ldr)#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)#define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and)
@@ -33,7 +32,6 @@ static inline const struct cpumask *default_target_cpus(void)#define wakeup_secondary_cpu (apic->wakeup_cpu)extern void setup_apic_routing (void );#else -#define TARGET_CPUS (default_target_cpus())#define wakeup_secondary_cpu wakeup_secondary_cpu_via_init/* * Set up the logical destination ID.
arch/x86/include/asm/mach-generic/mach_apic.h +0 -1
@@ -7,7 +7,6 @@#define NO_BALANCE_IRQ (apic->no_balance_irq)#undef APIC_DEST_LOGICAL#define APIC_DEST_LOGICAL (apic->apic_destination_logical) -#define TARGET_CPUS (apic->target_cpus())#define init_apic_ldr (apic->init_apic_ldr)#define ioapic_phys_id_map (apic->ioapic_phys_id_map)#define setup_apic_routing (apic->setup_apic_routing)
arch/x86/include/asm/summit/apic.h +1 -1
@@ -148,7 +148,7 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)return (int )0xFF ;/* * The cpus in the mask must all be on the apic cluster. If are not -* on the same apicid cluster return default value of TARGET_CPUS. +* on the same apicid cluster return default value of target_cpus(): */ cpu =first_cpu (*cpumask); apicid =cpu_to_logical_apicid (cpu);
arch/x86/kernel/io_apic.c +11 -11
@@ -1559,10 +1559,10 @@ static void setup_IO_APIC_irq(int apic_id, int pin, unsigned int irq, struct irq cfg = desc->chip_data; -if (assign_irq_vector (irq, cfg,TARGET_CPUS )) +if (assign_irq_vector (irq, cfg, apic->target_cpus ()))return ; - dest =cpu_mask_to_apicid_and (cfg->domain,TARGET_CPUS ); + dest =cpu_mask_to_apicid_and (cfg->domain, apic->target_cpus ());apic_printk (APIC_VERBOSE ,KERN_DEBUG "IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> "
@@ -1661,7 +1661,7 @@ static void __init setup_timer_IRQ0_pin(unsigned int apic_id, unsigned int pin,*/ entry.dest_mode = apic->irq_dest_mode; entry.mask =1 ;/* mask IRQ now */ - entry.dest =cpu_mask_to_apicid (TARGET_CPUS ); + entry.dest =cpu_mask_to_apicid (apic->target_cpus ()); entry.delivery_mode = apic->irq_delivery_mode; entry.polarity =0 ; entry.trigger =0 ;
@@ -2877,7 +2877,7 @@ static inline void __init check_timer(void)* get/set the timer IRQ vector: */ disable_8259A_irq (0 ); -assign_irq_vector (0 , cfg,TARGET_CPUS ); +assign_irq_vector (0 , cfg, apic->target_cpus ());/* * As IRQ0 is to be enabled in the 8259A, the virtual
@@ -3195,7 +3195,7 @@ unsigned int create_irq_nr(unsigned int irq_want)if (cfg_new->vector !=0 )continue ; -if (__assign_irq_vector (new, cfg_new,TARGET_CPUS ) ==0 ) +if (__assign_irq_vector (new, cfg_new, apic->target_cpus ()) ==0 ) irq = new;break ; }
@@ -3261,11 +3261,11 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_msreturn -ENXIO ; cfg =irq_cfg (irq); - err =assign_irq_vector (irq, cfg,TARGET_CPUS ); + err =assign_irq_vector (irq, cfg, apic->target_cpus ());if (err)return err; - dest =cpu_mask_to_apicid_and (cfg->domain,TARGET_CPUS ); + dest =cpu_mask_to_apicid_and (cfg->domain, apic->target_cpus ());#ifdef CONFIG_INTR_REMAP if (irq_remapped (irq)) {
@@ -3698,12 +3698,12 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)return -ENXIO ; cfg =irq_cfg (irq); - err =assign_irq_vector (irq, cfg,TARGET_CPUS ); + err =assign_irq_vector (irq, cfg, apic->target_cpus ());if (!err) {struct ht_irq_msg msg;unsigned dest; - dest =cpu_mask_to_apicid_and (cfg->domain,TARGET_CPUS ); + dest =cpu_mask_to_apicid_and (cfg->domain, apic->target_cpus ()); msg.address_hi =HT_IRQ_HIGH_DEST_ID (dest);
@@ -3987,7 +3987,7 @@ int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity)/* * This function currently is only a helper for the i386 smp boot process where * we need to reprogram the ioredtbls to cater for the cpus which have come online -* so mask in all cases should simply be TARGET_CPUS +* so mask in all cases should simply be apic->target_cpus() */ #ifdef CONFIG_SMP void __init setup_ioapic_dest (void )
@@ -4028,7 +4028,7 @@ void __init setup_ioapic_dest(void) (IRQ_NO_BALANCING | IRQ_AFFINITY_SET)) mask = desc->affinity; else - mask =TARGET_CPUS ; + mask = apic->target_cpus ();#ifdef CONFIG_INTR_REMAP if (intr_remapping_enabled)
Signature · 1 line
1.6.0.2
PATCH 31/114 x86: clean up esr_disable() methods
In reply to Ingo MolnarImpact: cleanup
Most subarchitectures want to disable the APIC ESR (Error Status Register), because they generally have hardware hacks that wrap standard CPUs into a bigger system and hence the APIC bus is quite non-standard and weirdnesses (lockups) have been seen with ESR reporting.
Remove the esr_disable macros and put the desired flag into each subarchitecture's genapic template directly.
--- arch/x86/include/asm/bigsmp/apic.h | 1 - arch/x86/include/asm/es7000/apic.h | 1 - arch/x86/include/asm/mach-default/mach_apic.h | 1 - arch/x86/include/asm/mach-generic/mach_apic.h | 1 - arch/x86/include/asm/numaq/apic.h | 1 - arch/x86/include/asm/summit/apic.h | 1 - arch/x86/kernel/apic.c | 4 ++-- arch/x86/mach-generic/bigsmp.c | 2 +- arch/x86/mach-generic/default.c | 2 +- arch/x86/mach-generic/es7000.c | 2 +- arch/x86/mach-generic/numaq.c | 2 +- arch/x86/mach-generic/summit.c | 2 +- 12 files changed, 7 insertions(+), 13 deletions(-)
arch/x86/include/asm/bigsmp/apic.h +0 -1
@@ -2,7 +2,6 @@#define __ASM_MACH_APIC_H#define xapic_phys_to_log_apicid (cpu) (per_cpu(x86_bios_cpu_apicid, cpu)) -#define esr_disable (1)static inline int bigsmp_apic_id_registered (void ) {
arch/x86/include/asm/es7000/apic.h +0 -1
@@ -4,7 +4,6 @@#include <linux/gfp.h> #define xapic_phys_to_log_apicid (cpu) per_cpu(x86_bios_cpu_apicid, cpu) -#define esr_disable (1)static inline int es7000_apic_id_registered (void ) {
arch/x86/include/asm/mach-default/mach_apic.h +0 -1
@@ -18,7 +18,6 @@ static inline const struct cpumask *default_target_cpus(void) }#define NO_BALANCE_IRQ (0) -#define esr_disable (0)#ifdef CONFIG_X86_64 #include <asm/genapic.h>
arch/x86/include/asm/mach-generic/mach_apic.h +0 -1
@@ -3,7 +3,6 @@#include <asm/genapic.h> -#define esr_disable (apic->ESR_DISABLE)#define NO_BALANCE_IRQ (apic->no_balance_irq)#undef APIC_DEST_LOGICAL#define APIC_DEST_LOGICAL (apic->apic_destination_logical)
arch/x86/include/asm/numaq/apic.h +0 -1
@@ -13,7 +13,6 @@ static inline const cpumask_t *numaq_target_cpus(void) }#define NO_BALANCE_IRQ (1) -#define esr_disable (1)static inline unsigned long check_apicid_used (physid_mask_t bitmap,int apicid) {
arch/x86/include/asm/summit/apic.h +0 -1
@@ -4,7 +4,6 @@#include <asm/smp.h> #include <linux/gfp.h> -#define esr_disable (1)#define NO_BALANCE_IRQ (0)/* In clustered mode, the high nibble of APIC ID is a cluster number.
arch/x86/kernel/apic.c +2 -2
@@ -1107,7 +1107,7 @@ static void __cpuinit lapic_setup_esr(void)return ; } -if (esr_disable) { +if (apic->ESR_DISABLE) {/* * Something untraceable is creating bad interrupts on * secondary quads ... for the moment, just leave the
@@ -1157,7 +1157,7 @@ void __cpuinit setup_local_APIC(void)#ifdef CONFIG_X86_32 /* Pound the ESR really hard over the head with a big hammer - mbligh */ -if (lapic_is_integrated () && esr_disable) { +if (lapic_is_integrated () && apic->ESR_DISABLE) {apic_write (APIC_ESR ,0 );apic_write (APIC_ESR ,0 );apic_write (APIC_ESR ,0 );
arch/x86/mach-generic/bigsmp.c +1 -1
@@ -69,7 +69,7 @@ struct genapic apic_bigsmp = { .irq_dest_mode = 0, .target_cpus = bigsmp_target_cpus, - .ESR_DISABLE = esr_disable, + .ESR_DISABLE = 1, .apic_destination_logical = APIC_DEST_LOGICAL, .check_apicid_used = check_apicid_used, .check_apicid_present = check_apicid_present,
arch/x86/mach-generic/default.c +1 -1
@@ -36,7 +36,7 @@ struct genapic apic_default = { .irq_dest_mode = 1, .target_cpus = default_target_cpus, - .ESR_DISABLE = esr_disable, + .ESR_DISABLE = 0, .apic_destination_logical = APIC_DEST_LOGICAL, .check_apicid_used = check_apicid_used, .check_apicid_present = check_apicid_present,
arch/x86/mach-generic/es7000.c +1 -1
@@ -112,7 +112,7 @@ struct genapic apic_es7000 = { .irq_dest_mode = 0, .target_cpus = es7000_target_cpus, - .ESR_DISABLE = esr_disable, + .ESR_DISABLE = 1, .apic_destination_logical = APIC_DEST_LOGICAL, .check_apicid_used = check_apicid_used, .check_apicid_present = check_apicid_present,
arch/x86/mach-generic/numaq.c +1 -1
@@ -56,7 +56,7 @@ struct genapic apic_numaq = { .irq_dest_mode = 0, .target_cpus = numaq_target_cpus, - .ESR_DISABLE = esr_disable, + .ESR_DISABLE = 1, .apic_destination_logical = APIC_DEST_LOGICAL, .check_apicid_used = check_apicid_used, .check_apicid_present = check_apicid_present,
arch/x86/mach-generic/summit.c +1 -1
@@ -49,7 +49,7 @@ struct genapic apic_summit = { .irq_dest_mode = 1, .target_cpus = summit_target_cpus, - .ESR_DISABLE = esr_disable, + .ESR_DISABLE = 1, .apic_destination_logical = APIC_DEST_LOGICAL, .check_apicid_used = check_apicid_used, .check_apicid_present = check_apicid_present,
Signature · 1 line
1.6.0.2
PATCH 32/114 x86: rename ->ESR_DISABLE to ->disable_esr
In reply to Ingo Molnarthe ->ESR_DISABLE shouting variant was used to enable the esr_disable macro wrappers. Those ugly macros are removed now so we can rename ->ESR_DISABLE to ->disable_esr
--- arch/x86/include/asm/genapic.h | 2 +- arch/x86/kernel/apic.c | 4 ++-- arch/x86/kernel/genapic_flat_64.c | 4 ++-- arch/x86/kernel/genx2apic_cluster.c | 2 +- arch/x86/kernel/genx2apic_phys.c | 2 +- arch/x86/kernel/genx2apic_uv_x.c | 2 +- arch/x86/mach-generic/bigsmp.c | 2 +- arch/x86/mach-generic/default.c | 2 +- arch/x86/mach-generic/es7000.c | 2 +- arch/x86/mach-generic/numaq.c | 2 +- arch/x86/mach-generic/summit.c | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-)
arch/x86/include/asm/genapic.h +1 -1
@@ -28,7 +28,7 @@ struct genapic {const struct cpumask *(*target_cpus)(void ); -int ESR_DISABLE ; +int disable_esr;int apic_destination_logical;unsigned long (*check_apicid_used)(physid_mask_t bitmap,int apicid);
arch/x86/kernel/apic.c +2 -2
@@ -1107,7 +1107,7 @@ static void __cpuinit lapic_setup_esr(void)return ; } -if (apic->ESR_DISABLE) { +if (apic->disable_esr) {/* * Something untraceable is creating bad interrupts on * secondary quads ... for the moment, just leave the
@@ -1157,7 +1157,7 @@ void __cpuinit setup_local_APIC(void)#ifdef CONFIG_X86_32 /* Pound the ESR really hard over the head with a big hammer - mbligh */ -if (lapic_is_integrated () && apic->ESR_DISABLE) { +if (lapic_is_integrated () && apic->disable_esr) {apic_write (APIC_ESR ,0 );apic_write (APIC_ESR ,0 );apic_write (APIC_ESR ,0 );
arch/x86/kernel/genapic_flat_64.c +2 -2
@@ -184,7 +184,7 @@ struct genapic apic_flat = { .irq_dest_mode = (APIC_DEST_LOGICAL != 0), .target_cpus = flat_target_cpus, - .ESR_DISABLE = 0, + .disable_esr = 0, .apic_destination_logical = 0, .check_apicid_used = NULL, .check_apicid_present = NULL,
@@ -330,7 +330,7 @@ struct genapic apic_physflat = { .irq_dest_mode = (APIC_DEST_PHYSICAL != 0), .target_cpus = physflat_target_cpus, - .ESR_DISABLE = 0, + .disable_esr = 0, .apic_destination_logical = 0, .check_apicid_used = NULL, .check_apicid_present = NULL,
arch/x86/kernel/genx2apic_cluster.c +1 -1
@@ -186,7 +186,7 @@ struct genapic apic_x2apic_cluster = { .irq_dest_mode = (APIC_DEST_LOGICAL != 0), .target_cpus = x2apic_target_cpus, - .ESR_DISABLE = 0, + .disable_esr = 0, .apic_destination_logical = 0, .check_apicid_used = NULL, .check_apicid_present = NULL,
arch/x86/kernel/genx2apic_phys.c +1 -1
@@ -182,7 +182,7 @@ struct genapic apic_x2apic_phys = { .irq_dest_mode = (APIC_DEST_PHYSICAL != 0), .target_cpus = x2apic_target_cpus, - .ESR_DISABLE = 0, + .disable_esr = 0, .apic_destination_logical = 0, .check_apicid_used = NULL, .check_apicid_present = NULL,
arch/x86/kernel/genx2apic_uv_x.c +1 -1
@@ -247,7 +247,7 @@ struct genapic apic_x2apic_uv_x = { .irq_dest_mode = (APIC_DEST_PHYSICAL != 0), .target_cpus = uv_target_cpus, - .ESR_DISABLE = 0, + .disable_esr = 0, .apic_destination_logical = 0, .check_apicid_used = NULL, .check_apicid_present = NULL,
arch/x86/mach-generic/bigsmp.c +1 -1
@@ -69,7 +69,7 @@ struct genapic apic_bigsmp = { .irq_dest_mode = 0, .target_cpus = bigsmp_target_cpus, - .ESR_DISABLE = 1, + .disable_esr = 1, .apic_destination_logical = APIC_DEST_LOGICAL, .check_apicid_used = check_apicid_used, .check_apicid_present = check_apicid_present,
arch/x86/mach-generic/default.c +1 -1
@@ -36,7 +36,7 @@ struct genapic apic_default = { .irq_dest_mode = 1, .target_cpus = default_target_cpus, - .ESR_DISABLE = 0, + .disable_esr = 0, .apic_destination_logical = APIC_DEST_LOGICAL, .check_apicid_used = check_apicid_used, .check_apicid_present = check_apicid_present,
arch/x86/mach-generic/es7000.c +1 -1
@@ -112,7 +112,7 @@ struct genapic apic_es7000 = { .irq_dest_mode = 0, .target_cpus = es7000_target_cpus, - .ESR_DISABLE = 1, + .disable_esr = 1, .apic_destination_logical = APIC_DEST_LOGICAL, .check_apicid_used = check_apicid_used, .check_apicid_present = check_apicid_present,
arch/x86/mach-generic/numaq.c +1 -1
@@ -56,7 +56,7 @@ struct genapic apic_numaq = { .irq_dest_mode = 0, .target_cpus = numaq_target_cpus, - .ESR_DISABLE = 1, + .disable_esr = 1, .apic_destination_logical = APIC_DEST_LOGICAL, .check_apicid_used = check_apicid_used, .check_apicid_present = check_apicid_present,
arch/x86/mach-generic/summit.c +1 -1
@@ -49,7 +49,7 @@ struct genapic apic_summit = { .irq_dest_mode = 1, .target_cpus = summit_target_cpus, - .ESR_DISABLE = 1, + .disable_esr = 1, .apic_destination_logical = APIC_DEST_LOGICAL, .check_apicid_used = check_apicid_used, .check_apicid_present = check_apicid_present,
Signature · 1 line
1.6.0.2
PATCH 33/114 x86: clean up the APIC_DEST_LOGICAL logic
In reply to Ingo MolnarImpact: cleanup
The bigsmp and es7000 subarchitectures un-defined APIC_DEST_LOGICAL in a rather nasty way by re-defining it to zero. That is infinitely fragile and makes it very hard to see what to code really does in a given context. The very same constant has different meanings and values - depending on which subarch is enabled.
Untangle this mess by never undefining the constant, but instead propagating the right values into the genapic driver templates.
--- arch/x86/include/asm/bigsmp/apic.h | 2 -- arch/x86/include/asm/es7000/apic.h | 2 -- arch/x86/include/asm/mach-generic/mach_apic.h | 2 -- arch/x86/kernel/genapic_flat_64.c | 12 ++++++------ arch/x86/kernel/genx2apic_cluster.c | 10 +++++----- arch/x86/kernel/genx2apic_phys.c | 2 +- arch/x86/kernel/genx2apic_uv_x.c | 4 ++-- arch/x86/kernel/io_apic.c | 2 +- arch/x86/kernel/ipi.c | 2 +- arch/x86/kernel/smpboot.c | 2 +- arch/x86/mach-generic/bigsmp.c | 2 +- arch/x86/mach-generic/es7000.c | 2 +- 12 files changed, 19 insertions(+), 25 deletions(-)
arch/x86/include/asm/bigsmp/apic.h +0 -2
@@ -17,8 +17,6 @@ static inline const cpumask_t *bigsmp_target_cpus(void)#endif } -#undef APIC_DEST_LOGICAL -#define APIC_DEST_LOGICAL 0#define APIC_DFR_VALUE (APIC_DFR_FLAT)#define NO_BALANCE_IRQ (0)
arch/x86/include/asm/es7000/apic.h +0 -2
@@ -27,8 +27,6 @@ static inline const cpumask_t *es7000_target_cpus(void)#define APIC_DFR_VALUE (APIC_DFR_FLAT)#define NO_BALANCE_IRQ (0) -#undef APIC_DEST_LOGICAL -#define APIC_DEST_LOGICAL 0x0static inline unsigned long check_apicid_used (physid_mask_t bitmap,int apicid) {
arch/x86/include/asm/mach-generic/mach_apic.h +0 -2
@@ -4,8 +4,6 @@#include <asm/genapic.h> #define NO_BALANCE_IRQ (apic->no_balance_irq) -#undef APIC_DEST_LOGICAL -#define APIC_DEST_LOGICAL (apic->apic_destination_logical)#define init_apic_ldr (apic->init_apic_ldr)#define ioapic_phys_id_map (apic->ioapic_phys_id_map)#define setup_apic_routing (apic->setup_apic_routing)
arch/x86/kernel/genapic_flat_64.c +6 -6
@@ -74,7 +74,7 @@ static inline void _flat_send_IPI_mask(unsigned long mask, int vector)unsigned long flags;local_irq_save (flags); -__send_IPI_dest_field (mask, vector,APIC_DEST_LOGICAL ); +__send_IPI_dest_field (mask, vector, apic->apic_destination_logical);local_irq_restore (flags); }
@@ -114,7 +114,7 @@ static void flat_send_IPI_allbutself(int vector)_flat_send_IPI_mask (mask, vector); } }else if (num_online_cpus () >1 ) { -__send_IPI_shortcut (APIC_DEST_ALLBUT , vector,APIC_DEST_LOGICAL ); +__send_IPI_shortcut (APIC_DEST_ALLBUT , vector, apic->apic_destination_logical); } }
@@ -123,7 +123,7 @@ static void flat_send_IPI_all(int vector)if (vector ==NMI_VECTOR )flat_send_IPI_mask (cpu_online_mask, vector);else -__send_IPI_shortcut (APIC_DEST_ALLINC , vector,APIC_DEST_LOGICAL ); +__send_IPI_shortcut (APIC_DEST_ALLINC , vector, apic->apic_destination_logical); }static unsigned int get_apic_id (unsigned long x)
@@ -181,11 +181,11 @@ struct genapic apic_flat = { .apic_id_registered = flat_apic_id_registered, .irq_delivery_mode = dest_LowestPrio, - .irq_dest_mode = (APIC_DEST_LOGICAL != 0), + .irq_dest_mode = 1, /* logical */ .target_cpus = flat_target_cpus, .disable_esr = 0, - .apic_destination_logical = 0, + .apic_destination_logical = APIC_DEST_LOGICAL, .check_apicid_used = NULL, .check_apicid_present = NULL,
@@ -327,7 +327,7 @@ struct genapic apic_physflat = { .apic_id_registered = flat_apic_id_registered, .irq_delivery_mode = dest_Fixed, - .irq_dest_mode = (APIC_DEST_PHYSICAL != 0), + .irq_dest_mode = 0, /* physical */ .target_cpus = physflat_target_cpus, .disable_esr = 0,
arch/x86/kernel/genx2apic_cluster.c +5 -5
@@ -64,7 +64,7 @@ static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector)for_each_cpu (query_cpu, mask)__x2apic_send_IPI_dest (per_cpu (x86_cpu_to_logical_apicid, query_cpu), - vector,APIC_DEST_LOGICAL ); + vector, apic->apic_destination_logical);local_irq_restore (flags); }
@@ -80,7 +80,7 @@ static void x2apic_send_IPI_mask_allbutself(const struct cpumask *mask,if (query_cpu != this_cpu)__x2apic_send_IPI_dest (per_cpu (x86_cpu_to_logical_apicid, query_cpu), - vector,APIC_DEST_LOGICAL ); + vector, apic->apic_destination_logical);local_irq_restore (flags); }
@@ -95,7 +95,7 @@ static void x2apic_send_IPI_allbutself(int vector)if (query_cpu != this_cpu)__x2apic_send_IPI_dest (per_cpu (x86_cpu_to_logical_apicid, query_cpu), - vector,APIC_DEST_LOGICAL ); + vector, apic->apic_destination_logical);local_irq_restore (flags); }
@@ -183,11 +183,11 @@ struct genapic apic_x2apic_cluster = { .apic_id_registered = x2apic_apic_id_registered, .irq_delivery_mode = dest_LowestPrio, - .irq_dest_mode = (APIC_DEST_LOGICAL != 0), + .irq_dest_mode = 1, /* logical */ .target_cpus = x2apic_target_cpus, .disable_esr = 0, - .apic_destination_logical = 0, + .apic_destination_logical = APIC_DEST_LOGICAL, .check_apicid_used = NULL, .check_apicid_present = NULL,
arch/x86/kernel/genx2apic_phys.c +1 -1
@@ -179,7 +179,7 @@ struct genapic apic_x2apic_phys = { .apic_id_registered = x2apic_apic_id_registered, .irq_delivery_mode = dest_Fixed, - .irq_dest_mode = (APIC_DEST_PHYSICAL != 0), + .irq_dest_mode = 0, /* physical */ .target_cpus = x2apic_target_cpus, .disable_esr = 0,
arch/x86/kernel/genx2apic_uv_x.c +2 -2
@@ -244,11 +244,11 @@ struct genapic apic_x2apic_uv_x = { .apic_id_registered = uv_apic_id_registered, .irq_delivery_mode = dest_Fixed, - .irq_dest_mode = (APIC_DEST_PHYSICAL != 0), + .irq_dest_mode = 1, /* logical */ .target_cpus = uv_target_cpus, .disable_esr = 0, - .apic_destination_logical = 0, + .apic_destination_logical = APIC_DEST_LOGICAL, .check_apicid_used = NULL, .check_apicid_present = NULL,
arch/x86/kernel/io_apic.c +1 -1
@@ -806,7 +806,7 @@ void send_IPI_self(int vector)* Wait for idle. */ apic_wait_icr_idle (); - cfg =APIC_DM_FIXED |APIC_DEST_SELF | vector |APIC_DEST_LOGICAL ; + cfg =APIC_DM_FIXED |APIC_DEST_SELF | vector | apic->apic_destination_logical;/* * Send the IPI. The write to APIC_ICR fires this off. */
arch/x86/kernel/ipi.c +1 -1
@@ -30,7 +30,7 @@static inline int __prepare_ICR (unsigned int shortcut,int vector) { -unsigned int icr = shortcut |APIC_DEST_LOGICAL ; +unsigned int icr = shortcut | apic->apic_destination_logical;switch (vector) {default :
arch/x86/kernel/smpboot.c +1 -1
@@ -583,7 +583,7 @@ wakeup_secondary_cpu_via_nmi(int logical_apicid, unsigned long start_eip)/* Target chip */ /* Boot on the stack */ /* Kick the second */ -apic_icr_write (APIC_DM_NMI |APIC_DEST_LOGICAL , logical_apicid); +apic_icr_write (APIC_DM_NMI | apic->apic_destination_logical, logical_apicid);pr_debug ("Waiting for send to finish...\n" ); send_status =safe_apic_wait_icr_idle ();
arch/x86/mach-generic/bigsmp.c +1 -1
@@ -70,7 +70,7 @@ struct genapic apic_bigsmp = { .target_cpus = bigsmp_target_cpus, .disable_esr = 1, - .apic_destination_logical = APIC_DEST_LOGICAL, + .apic_destination_logical = 0, .check_apicid_used = check_apicid_used, .check_apicid_present = check_apicid_present,
arch/x86/mach-generic/es7000.c +1 -1
@@ -113,7 +113,7 @@ struct genapic apic_es7000 = { .target_cpus = es7000_target_cpus, .disable_esr = 1, - .apic_destination_logical = APIC_DEST_LOGICAL, + .apic_destination_logical = 0, .check_apicid_used = check_apicid_used, .check_apicid_present = check_apicid_present,
Signature · 1 line
1.6.0.2
PATCH 34/114 x86, apic: rename genapic::apic_destination_logical to genapic::dest_logical
In reply to Ingo MolnarThis field name was unreasonably long - shorten it.
--- arch/x86/include/asm/genapic.h | 2 +- arch/x86/kernel/genapic_flat_64.c | 10 +++++----- arch/x86/kernel/genx2apic_cluster.c | 8 ++++---- arch/x86/kernel/genx2apic_phys.c | 2 +- arch/x86/kernel/genx2apic_uv_x.c | 2 +- arch/x86/kernel/io_apic.c | 2 +- arch/x86/kernel/ipi.c | 2 +- arch/x86/kernel/smpboot.c | 2 +- arch/x86/mach-generic/bigsmp.c | 2 +- arch/x86/mach-generic/default.c | 2 +- arch/x86/mach-generic/es7000.c | 2 +- arch/x86/mach-generic/numaq.c | 2 +- arch/x86/mach-generic/summit.c | 2 +- 13 files changed, 20 insertions(+), 20 deletions(-)
arch/x86/include/asm/genapic.h +1 -1
@@ -30,7 +30,7 @@ struct genapic {int disable_esr; -int apic_destination_logical; +int dest_logical;unsigned long (*check_apicid_used)(physid_mask_t bitmap,int apicid);unsigned long (*check_apicid_present)(int apicid);
arch/x86/kernel/genapic_flat_64.c +5 -5
@@ -74,7 +74,7 @@ static inline void _flat_send_IPI_mask(unsigned long mask, int vector)unsigned long flags;local_irq_save (flags); -__send_IPI_dest_field (mask, vector, apic->apic_destination_logical); +__send_IPI_dest_field (mask, vector, apic->dest_logical);local_irq_restore (flags); }
@@ -114,7 +114,7 @@ static void flat_send_IPI_allbutself(int vector)_flat_send_IPI_mask (mask, vector); } }else if (num_online_cpus () >1 ) { -__send_IPI_shortcut (APIC_DEST_ALLBUT , vector, apic->apic_destination_logical); +__send_IPI_shortcut (APIC_DEST_ALLBUT , vector, apic->dest_logical); } }
@@ -123,7 +123,7 @@ static void flat_send_IPI_all(int vector)if (vector ==NMI_VECTOR )flat_send_IPI_mask (cpu_online_mask, vector);else -__send_IPI_shortcut (APIC_DEST_ALLINC , vector, apic->apic_destination_logical); +__send_IPI_shortcut (APIC_DEST_ALLINC , vector, apic->dest_logical); }static unsigned int get_apic_id (unsigned long x)
@@ -185,7 +185,7 @@ struct genapic apic_flat = { .target_cpus = flat_target_cpus, .disable_esr = 0, - .apic_destination_logical = APIC_DEST_LOGICAL, + .dest_logical = APIC_DEST_LOGICAL, .check_apicid_used = NULL, .check_apicid_present = NULL,
@@ -331,7 +331,7 @@ struct genapic apic_physflat = { .target_cpus = physflat_target_cpus, .disable_esr = 0, - .apic_destination_logical = 0, + .dest_logical = 0, .check_apicid_used = NULL, .check_apicid_present = NULL,
arch/x86/kernel/genx2apic_cluster.c +4 -4
@@ -64,7 +64,7 @@ static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector)for_each_cpu (query_cpu, mask)__x2apic_send_IPI_dest (per_cpu (x86_cpu_to_logical_apicid, query_cpu), - vector, apic->apic_destination_logical); + vector, apic->dest_logical);local_irq_restore (flags); }
@@ -80,7 +80,7 @@ static void x2apic_send_IPI_mask_allbutself(const struct cpumask *mask,if (query_cpu != this_cpu)__x2apic_send_IPI_dest (per_cpu (x86_cpu_to_logical_apicid, query_cpu), - vector, apic->apic_destination_logical); + vector, apic->dest_logical);local_irq_restore (flags); }
@@ -95,7 +95,7 @@ static void x2apic_send_IPI_allbutself(int vector)if (query_cpu != this_cpu)__x2apic_send_IPI_dest (per_cpu (x86_cpu_to_logical_apicid, query_cpu), - vector, apic->apic_destination_logical); + vector, apic->dest_logical);local_irq_restore (flags); }
@@ -187,7 +187,7 @@ struct genapic apic_x2apic_cluster = { .target_cpus = x2apic_target_cpus, .disable_esr = 0, - .apic_destination_logical = APIC_DEST_LOGICAL, + .dest_logical = APIC_DEST_LOGICAL, .check_apicid_used = NULL, .check_apicid_present = NULL,
arch/x86/kernel/genx2apic_phys.c +1 -1
@@ -183,7 +183,7 @@ struct genapic apic_x2apic_phys = { .target_cpus = x2apic_target_cpus, .disable_esr = 0, - .apic_destination_logical = 0, + .dest_logical = 0, .check_apicid_used = NULL, .check_apicid_present = NULL,
arch/x86/kernel/genx2apic_uv_x.c +1 -1
@@ -248,7 +248,7 @@ struct genapic apic_x2apic_uv_x = { .target_cpus = uv_target_cpus, .disable_esr = 0, - .apic_destination_logical = APIC_DEST_LOGICAL, + .dest_logical = APIC_DEST_LOGICAL, .check_apicid_used = NULL, .check_apicid_present = NULL,
arch/x86/kernel/io_apic.c +1 -1
@@ -806,7 +806,7 @@ void send_IPI_self(int vector)* Wait for idle. */ apic_wait_icr_idle (); - cfg =APIC_DM_FIXED |APIC_DEST_SELF | vector | apic->apic_destination_logical; + cfg =APIC_DM_FIXED |APIC_DEST_SELF | vector | apic->dest_logical;/* * Send the IPI. The write to APIC_ICR fires this off. */
arch/x86/kernel/ipi.c +1 -1
@@ -30,7 +30,7 @@static inline int __prepare_ICR (unsigned int shortcut,int vector) { -unsigned int icr = shortcut | apic->apic_destination_logical; +unsigned int icr = shortcut | apic->dest_logical;switch (vector) {default :
arch/x86/kernel/smpboot.c +1 -1
@@ -583,7 +583,7 @@ wakeup_secondary_cpu_via_nmi(int logical_apicid, unsigned long start_eip)/* Target chip */ /* Boot on the stack */ /* Kick the second */ -apic_icr_write (APIC_DM_NMI | apic->apic_destination_logical, logical_apicid); +apic_icr_write (APIC_DM_NMI | apic->dest_logical, logical_apicid);pr_debug ("Waiting for send to finish...\n" ); send_status =safe_apic_wait_icr_idle ();
arch/x86/mach-generic/bigsmp.c +1 -1
@@ -70,7 +70,7 @@ struct genapic apic_bigsmp = { .target_cpus = bigsmp_target_cpus, .disable_esr = 1, - .apic_destination_logical = 0, + .dest_logical = 0, .check_apicid_used = check_apicid_used, .check_apicid_present = check_apicid_present,
arch/x86/mach-generic/default.c +1 -1
@@ -37,7 +37,7 @@ struct genapic apic_default = { .target_cpus = default_target_cpus, .disable_esr = 0, - .apic_destination_logical = APIC_DEST_LOGICAL, + .dest_logical = APIC_DEST_LOGICAL, .check_apicid_used = check_apicid_used, .check_apicid_present = check_apicid_present,
arch/x86/mach-generic/es7000.c +1 -1
@@ -113,7 +113,7 @@ struct genapic apic_es7000 = { .target_cpus = es7000_target_cpus, .disable_esr = 1, - .apic_destination_logical = 0, + .dest_logical = 0, .check_apicid_used = check_apicid_used, .check_apicid_present = check_apicid_present,
arch/x86/mach-generic/numaq.c +1 -1
@@ -57,7 +57,7 @@ struct genapic apic_numaq = { .target_cpus = numaq_target_cpus, .disable_esr = 1, - .apic_destination_logical = APIC_DEST_LOGICAL, + .dest_logical = APIC_DEST_LOGICAL, .check_apicid_used = check_apicid_used, .check_apicid_present = check_apicid_present,
arch/x86/mach-generic/summit.c +1 -1
@@ -50,7 +50,7 @@ struct genapic apic_summit = { .target_cpus = summit_target_cpus, .disable_esr = 1, - .apic_destination_logical = APIC_DEST_LOGICAL, + .dest_logical = APIC_DEST_LOGICAL, .check_apicid_used = check_apicid_used, .check_apicid_present = check_apicid_present,
Signature · 1 line
1.6.0.2
PATCH 35/114 x86, apic: clean up check_apicid*() callbacks
In reply to Ingo MolnarClean up these methods - to make it clearer which function is used in which case.
--- arch/x86/include/asm/bigsmp/apic.h | 9 +++++---- arch/x86/include/asm/es7000/apic.h | 5 +++-- arch/x86/include/asm/mach-default/mach_apic.h | 4 ++-- arch/x86/include/asm/mach-generic/mach_apic.h | 2 -- arch/x86/include/asm/numaq/apic.h | 5 +++-- arch/x86/include/asm/summit/apic.h | 5 +++-- arch/x86/kernel/io_apic.c | 6 +++--- arch/x86/mach-generic/bigsmp.c | 4 ++-- arch/x86/mach-generic/default.c | 4 ++-- arch/x86/mach-generic/es7000.c | 4 ++-- arch/x86/mach-generic/numaq.c | 4 ++-- arch/x86/mach-generic/summit.c | 4 ++-- 12 files changed, 29 insertions(+), 27 deletions(-)
arch/x86/include/asm/bigsmp/apic.h +5 -4
@@ -20,14 +20,15 @@ static inline const cpumask_t *bigsmp_target_cpus(void)#define APIC_DFR_VALUE (APIC_DFR_FLAT)#define NO_BALANCE_IRQ (0) -static inline unsigned long check_apicid_used (physid_mask_t bitmap,int apicid) +static inline unsigned long +bigsmp_check_apicid_used (physid_mask_t bitmap,int apicid) { -return (0 ); +return 0 ; } -static inline unsigned long check_apicid_present (int bit) +static inline unsigned long bigsmp_check_apicid_present (int bit) { -return (1 ); +return 1 ; }static inline unsigned long calculate_ldr (int cpu)
arch/x86/include/asm/es7000/apic.h +3 -2
@@ -28,11 +28,12 @@ static inline const cpumask_t *es7000_target_cpus(void)#define APIC_DFR_VALUE (APIC_DFR_FLAT)#define NO_BALANCE_IRQ (0) -static inline unsigned long check_apicid_used (physid_mask_t bitmap,int apicid) +static inline unsigned long +es7000_check_apicid_used (physid_mask_t bitmap,int apicid) {return 0 ; } -static inline unsigned long check_apicid_present (int bit) +static inline unsigned long es7000_check_apicid_present (int bit) {return physid_isset (bit, phys_cpu_present_map); }
arch/x86/include/asm/mach-default/mach_apic.h +2 -2
@@ -105,12 +105,12 @@ static inline void vector_allocation_domain(int cpu, struct cpumask *retmask) }#endif -static inline unsigned long check_apicid_used (physid_mask_t bitmap,int apicid) +static inline unsigned long default_check_apicid_used (physid_mask_t bitmap,int apicid) {return physid_isset (apicid, bitmap); } -static inline unsigned long check_apicid_present (int bit) +static inline unsigned long default_check_apicid_present (int bit) {return physid_isset (bit, phys_cpu_present_map); }
arch/x86/include/asm/mach-generic/mach_apic.h +0 -2
@@ -13,9 +13,7 @@#define cpu_present_to_apicid (apic->cpu_present_to_apicid)#define apicid_to_cpu_present (apic->apicid_to_cpu_present)#define setup_portio_remap (apic->setup_portio_remap) -#define check_apicid_present (apic->check_apicid_present)#define check_phys_apicid_present (apic->check_phys_apicid_present) -#define check_apicid_used (apic->check_apicid_used)#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)#define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and)#define vector_allocation_domain (apic->vector_allocation_domain)
arch/x86/include/asm/numaq/apic.h +3 -2
@@ -14,11 +14,12 @@ static inline const cpumask_t *numaq_target_cpus(void)#define NO_BALANCE_IRQ (1) -static inline unsigned long check_apicid_used (physid_mask_t bitmap,int apicid) +static inline unsigned long +numaq_check_apicid_used (physid_mask_t bitmap,int apicid) {return physid_isset (apicid, bitmap); } -static inline unsigned long check_apicid_present (int bit) +static inline unsigned long numaq_check_apicid_present (int bit) {return physid_isset (bit, phys_cpu_present_map); }
arch/x86/include/asm/summit/apic.h +3 -2
@@ -23,13 +23,14 @@ static inline const cpumask_t *summit_target_cpus(void)return &cpumask_of_cpu (0 ); } -static inline unsigned long check_apicid_used (physid_mask_t bitmap,int apicid) +static inline unsigned long +summit_check_apicid_used (physid_mask_t bitmap,int apicid) {return 0 ; }/* we don't use the phys_cpu_present_map to indicate apicid presence */ -static inline unsigned long check_apicid_present (int bit) +static inline unsigned long summit_check_apicid_present (int bit) {return 1 ; }
arch/x86/kernel/io_apic.c +3 -3
@@ -2135,7 +2135,7 @@ static void __init setup_ioapic_ids_from_mpc(void)* system must have a unique ID or we get lots of nice * 'stuck on smp_invalidate_needed IPI wait' messages. */ -if (check_apicid_used (phys_id_present_map, +if (apic->check_apicid_used (phys_id_present_map, mp_ioapics[apic_id].apicid)) {printk (KERN_ERR "BIOS bug, IO-APIC#%d ID %d is already used!...\n" , apic_id, mp_ioapics[apic_id].apicid);
@@ -3878,10 +3878,10 @@ int __init io_apic_get_unique_id(int ioapic, int apic_id)* Every APIC in a system must have a unique ID or we get lots of nice * 'stuck on smp_invalidate_needed IPI wait' messages. */ -if (check_apicid_used (apic_id_map, apic_id)) { +if (apic->check_apicid_used (apic_id_map, apic_id)) {for (i =0 ; i <get_physical_broadcast (); i++) { -if (!check_apicid_used (apic_id_map, i)) +if (!apic->check_apicid_used (apic_id_map, i))break ; }
arch/x86/mach-generic/bigsmp.c +2 -2
@@ -71,8 +71,8 @@ struct genapic apic_bigsmp = { .target_cpus = bigsmp_target_cpus, .disable_esr = 1, .dest_logical = 0, - .check_apicid_used = check_apicid_used, - .check_apicid_present = check_apicid_present, + .check_apicid_used = bigsmp_check_apicid_used, + .check_apicid_present = bigsmp_check_apicid_present, .no_balance_irq = NO_BALANCE_IRQ, .no_ioapic_check = 0,
arch/x86/mach-generic/default.c +2 -2
@@ -38,8 +38,8 @@ struct genapic apic_default = { .target_cpus = default_target_cpus, .disable_esr = 0, .dest_logical = APIC_DEST_LOGICAL, - .check_apicid_used = check_apicid_used, - .check_apicid_present = check_apicid_present, + .check_apicid_used = default_check_apicid_used, + .check_apicid_present = default_check_apicid_present, .no_balance_irq = NO_BALANCE_IRQ, .no_ioapic_check = 0,
arch/x86/mach-generic/es7000.c +2 -2
@@ -114,8 +114,8 @@ struct genapic apic_es7000 = { .target_cpus = es7000_target_cpus, .disable_esr = 1, .dest_logical = 0, - .check_apicid_used = check_apicid_used, - .check_apicid_present = check_apicid_present, + .check_apicid_used = es7000_check_apicid_used, + .check_apicid_present = es7000_check_apicid_present, .no_balance_irq = NO_BALANCE_IRQ, .no_ioapic_check = 0,
arch/x86/mach-generic/numaq.c +2 -2
@@ -58,8 +58,8 @@ struct genapic apic_numaq = { .target_cpus = numaq_target_cpus, .disable_esr = 1, .dest_logical = APIC_DEST_LOGICAL, - .check_apicid_used = check_apicid_used, - .check_apicid_present = check_apicid_present, + .check_apicid_used = numaq_check_apicid_used, + .check_apicid_present = numaq_check_apicid_present, .no_balance_irq = NO_BALANCE_IRQ, .no_ioapic_check = 0,
arch/x86/mach-generic/summit.c +2 -2
@@ -51,8 +51,8 @@ struct genapic apic_summit = { .target_cpus = summit_target_cpus, .disable_esr = 1, .dest_logical = APIC_DEST_LOGICAL, - .check_apicid_used = check_apicid_used, - .check_apicid_present = check_apicid_present, + .check_apicid_used = summit_check_apicid_used, + .check_apicid_present = summit_check_apicid_present, .no_balance_irq = NO_BALANCE_IRQ, .no_ioapic_check = 0,
Signature · 1 line
1.6.0.2
PATCH 36/114 x86, apic: remove no_balance_irq and no_ioapic_check flags
In reply to Ingo MolnarThese flags are completely unused. (the in-kernel IRQ balancer has been removed from the upstream kernel.)
--- arch/x86/include/asm/bigsmp/apic.h | 1 - arch/x86/include/asm/es7000/apic.h | 2 -- arch/x86/include/asm/genapic.h | 3 --- arch/x86/include/asm/mach-default/mach_apic.h | 2 -- arch/x86/include/asm/mach-generic/mach_apic.h | 1 - arch/x86/include/asm/numaq/apic.h | 2 -- arch/x86/include/asm/summit/apic.h | 2 -- arch/x86/kernel/genapic_flat_64.c | 6 ------ arch/x86/kernel/genx2apic_cluster.c | 3 --- arch/x86/kernel/genx2apic_phys.c | 3 --- arch/x86/kernel/genx2apic_uv_x.c | 3 --- arch/x86/mach-generic/bigsmp.c | 3 --- arch/x86/mach-generic/default.c | 3 --- arch/x86/mach-generic/es7000.c | 4 ---- arch/x86/mach-generic/numaq.c | 3 --- arch/x86/mach-generic/summit.c | 3 --- 16 files changed, 0 insertions(+), 44 deletions(-)
arch/x86/include/asm/bigsmp/apic.h +0 -1
@@ -18,7 +18,6 @@ static inline const cpumask_t *bigsmp_target_cpus(void) }#define APIC_DFR_VALUE (APIC_DFR_FLAT) -#define NO_BALANCE_IRQ (0)static inline unsigned long bigsmp_check_apicid_used (physid_mask_t bitmap,int apicid)
arch/x86/include/asm/es7000/apic.h +0 -2
@@ -23,10 +23,8 @@ static inline const cpumask_t *es7000_target_cpus(void)#define APIC_DFR_VALUE_CLUSTER (APIC_DFR_CLUSTER)#define INT_DELIVERY_MODE_CLUSTER (dest_LowestPrio)#define INT_DEST_MODE_CLUSTER (1)/* logical delivery broadcast to all procs */ -#define NO_BALANCE_IRQ_CLUSTER (1)#define APIC_DFR_VALUE (APIC_DFR_FLAT) -#define NO_BALANCE_IRQ (0)static inline unsigned long es7000_check_apicid_used (physid_mask_t bitmap,int apicid)
arch/x86/include/asm/genapic.h +0 -3
@@ -34,9 +34,6 @@ struct genapic {unsigned long (*check_apicid_used)(physid_mask_t bitmap,int apicid);unsigned long (*check_apicid_present)(int apicid); -int no_balance_irq; -int no_ioapic_check; -void (*vector_allocation_domain)(int cpu,struct cpumask *retmask);void (*init_apic_ldr)(void );
arch/x86/include/asm/mach-default/mach_apic.h +0 -2
@@ -17,8 +17,6 @@ static inline const struct cpumask *default_target_cpus(void)#endif } -#define NO_BALANCE_IRQ (0) -#ifdef CONFIG_X86_64 #include <asm/genapic.h> #define init_apic_ldr (apic->init_apic_ldr)
arch/x86/include/asm/mach-generic/mach_apic.h +0 -1
@@ -3,7 +3,6 @@#include <asm/genapic.h> -#define NO_BALANCE_IRQ (apic->no_balance_irq)#define init_apic_ldr (apic->init_apic_ldr)#define ioapic_phys_id_map (apic->ioapic_phys_id_map)#define setup_apic_routing (apic->setup_apic_routing)
arch/x86/include/asm/numaq/apic.h +0 -2
@@ -12,8 +12,6 @@ static inline const cpumask_t *numaq_target_cpus(void)return &CPU_MASK_ALL ; } -#define NO_BALANCE_IRQ (1) -static inline unsigned long numaq_check_apicid_used (physid_mask_t bitmap,int apicid) {
arch/x86/include/asm/summit/apic.h +0 -2
@@ -4,8 +4,6 @@#include <asm/smp.h> #include <linux/gfp.h> -#define NO_BALANCE_IRQ (0) -/* In clustered mode, the high nibble of APIC ID is a cluster number. * The low nibble is a 4-bit bitmap. */ #define XAPIC_DEST_CPUS_SHIFT 4
arch/x86/kernel/genapic_flat_64.c +0 -6
@@ -189,9 +189,6 @@ struct genapic apic_flat = { .check_apicid_used = NULL, .check_apicid_present = NULL, - .no_balance_irq = 0, - .no_ioapic_check = 0, - .vector_allocation_domain = flat_vector_allocation_domain, .init_apic_ldr = flat_init_apic_ldr,
@@ -335,9 +332,6 @@ struct genapic apic_physflat = { .check_apicid_used = NULL, .check_apicid_present = NULL, - .no_balance_irq = 0, - .no_ioapic_check = 0, - .vector_allocation_domain = physflat_vector_allocation_domain,/* not needed, but shouldn't hurt: */ .init_apic_ldr = flat_init_apic_ldr,
arch/x86/kernel/genx2apic_cluster.c +0 -3
@@ -191,9 +191,6 @@ struct genapic apic_x2apic_cluster = { .check_apicid_used = NULL, .check_apicid_present = NULL, - .no_balance_irq = 0, - .no_ioapic_check = 0, - .vector_allocation_domain = x2apic_vector_allocation_domain, .init_apic_ldr = init_x2apic_ldr,
arch/x86/kernel/genx2apic_phys.c +0 -3
@@ -187,9 +187,6 @@ struct genapic apic_x2apic_phys = { .check_apicid_used = NULL, .check_apicid_present = NULL, - .no_balance_irq = 0, - .no_ioapic_check = 0, - .vector_allocation_domain = x2apic_vector_allocation_domain, .init_apic_ldr = init_x2apic_ldr,
arch/x86/kernel/genx2apic_uv_x.c +0 -3
@@ -252,9 +252,6 @@ struct genapic apic_x2apic_uv_x = { .check_apicid_used = NULL, .check_apicid_present = NULL, - .no_balance_irq = 0, - .no_ioapic_check = 0, - .vector_allocation_domain = uv_vector_allocation_domain, .init_apic_ldr = uv_init_apic_ldr,
arch/x86/mach-generic/bigsmp.c +0 -3
@@ -74,9 +74,6 @@ struct genapic apic_bigsmp = { .check_apicid_used = bigsmp_check_apicid_used, .check_apicid_present = bigsmp_check_apicid_present, - .no_balance_irq = NO_BALANCE_IRQ, - .no_ioapic_check = 0, - .vector_allocation_domain = vector_allocation_domain, .init_apic_ldr = init_apic_ldr,
arch/x86/mach-generic/default.c +0 -3
@@ -41,9 +41,6 @@ struct genapic apic_default = { .check_apicid_used = default_check_apicid_used, .check_apicid_present = default_check_apicid_present, - .no_balance_irq = NO_BALANCE_IRQ, - .no_ioapic_check = 0, - .vector_allocation_domain = vector_allocation_domain, .init_apic_ldr = init_apic_ldr,
arch/x86/mach-generic/es7000.c +0 -4
@@ -23,7 +23,6 @@ void __init es7000_update_genapic_to_cluster(void) apic->target_cpus = target_cpus_cluster; apic->irq_delivery_mode =INT_DELIVERY_MODE_CLUSTER ; apic->irq_dest_mode =INT_DEST_MODE_CLUSTER ; - apic->no_balance_irq =NO_BALANCE_IRQ_CLUSTER ; apic->init_apic_ldr = init_apic_ldr_cluster;
@@ -117,9 +116,6 @@ struct genapic apic_es7000 = { .check_apicid_used = es7000_check_apicid_used, .check_apicid_present = es7000_check_apicid_present, - .no_balance_irq = NO_BALANCE_IRQ, - .no_ioapic_check = 0, - .vector_allocation_domain = vector_allocation_domain, .init_apic_ldr = init_apic_ldr,
arch/x86/mach-generic/numaq.c +0 -3
@@ -61,9 +61,6 @@ struct genapic apic_numaq = { .check_apicid_used = numaq_check_apicid_used, .check_apicid_present = numaq_check_apicid_present, - .no_balance_irq = NO_BALANCE_IRQ, - .no_ioapic_check = 0, - .vector_allocation_domain = vector_allocation_domain, .init_apic_ldr = init_apic_ldr,
arch/x86/mach-generic/summit.c +0 -3
@@ -54,9 +54,6 @@ struct genapic apic_summit = { .check_apicid_used = summit_check_apicid_used, .check_apicid_present = summit_check_apicid_present, - .no_balance_irq = NO_BALANCE_IRQ, - .no_ioapic_check = 0, - .vector_allocation_domain = vector_allocation_domain, .init_apic_ldr = init_apic_ldr,
Signature · 1 line
1.6.0.2
PATCH 37/114 x86, apic: clean up ->vector_allocation_domain()
In reply to Ingo Molnar- separate the namespace
- remove macros
- move the default vector-allocation-domain to mach-generic
- fix whitespace damage
--- arch/x86/include/asm/mach-default/mach_apic.h | 13 ------------- arch/x86/include/asm/mach-generic/mach_apic.h | 1 - arch/x86/kernel/io_apic.c | 2 +- arch/x86/mach-generic/bigsmp.c | 4 ++-- arch/x86/mach-generic/default.c | 16 +++++++++++++++- arch/x86/mach-generic/es7000.c | 4 ++-- arch/x86/mach-generic/numaq.c | 4 ++-- arch/x86/mach-generic/summit.c | 4 ++-- 8 files changed, 24 insertions(+), 24 deletions(-)
arch/x86/include/asm/mach-default/mach_apic.h +0 -13
@@ -23,7 +23,6 @@ static inline const struct cpumask *default_target_cpus(void)#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)#define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and)#define phys_pkg_id (apic->phys_pkg_id) -#define vector_allocation_domain (apic->vector_allocation_domain)#define read_apic_id () (GET_APIC_ID(apic_read(APIC_ID)))#define send_IPI_self (apic->send_IPI_self)#define wakeup_secondary_cpu (apic->wakeup_cpu)
@@ -89,18 +88,6 @@ static inline int apicid_to_node(int logical_apicid) #endif } -static inline void vector_allocation_domain (int cpu,struct cpumask *retmask) -{ -/* Careful. Some cpus do not strictly honor the set of cpus -* specified in the interrupt destination when using lowest -* priority interrupt delivery mode. -* -* In particular there was a hyperthreading cpu observed to -* deliver interrupts to the wrong hyperthread when only one -* hyperthread was specified in the interrupt desitination. -*/ - *retmask = (cpumask_t ) { { [0 ] =APIC_ALL_CPUS } }; -}#endif static inline unsigned long default_check_apicid_used (physid_mask_t bitmap,int apicid)
arch/x86/include/asm/mach-generic/mach_apic.h +0 -1
@@ -15,7 +15,6 @@#define check_phys_apicid_present (apic->check_phys_apicid_present)#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)#define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and) -#define vector_allocation_domain (apic->vector_allocation_domain)#define enable_apic_mode (apic->enable_apic_mode)#define phys_pkg_id (apic->phys_pkg_id)#define wakeup_secondary_cpu (apic->wakeup_cpu)
arch/x86/kernel/io_apic.c +1 -1
@@ -1316,7 +1316,7 @@ __assign_irq_vector(int irq, struct irq_cfg *cfg, const struct cpumask *mask)int new_cpu;int vector, offset; -vector_allocation_domain (cpu, tmp_mask); + apic->vector_allocation_domain (cpu, tmp_mask); vector = current_vector; offset = current_offset;
arch/x86/mach-generic/bigsmp.c +2 -2
@@ -42,7 +42,7 @@ static const struct dmi_system_id bigsmp_dmi_table[] = { { } }; -static void vector_allocation_domain (int cpu,cpumask_t *retmask) +static void bigsmp_vector_allocation_domain (int cpu,cpumask_t *retmask) {cpus_clear (*retmask);cpu_set (cpu, *retmask);
@@ -74,7 +74,7 @@ struct genapic apic_bigsmp = { .check_apicid_used = bigsmp_check_apicid_used, .check_apicid_present = bigsmp_check_apicid_present, - .vector_allocation_domain = vector_allocation_domain, + .vector_allocation_domain = bigsmp_vector_allocation_domain, .init_apic_ldr = init_apic_ldr, .ioapic_phys_id_map = ioapic_phys_id_map,
arch/x86/mach-generic/default.c +15 -1
@@ -18,6 +18,20 @@#include <asm/mach-default/mach_mpparse.h> #include <asm/mach-default/mach_wakecpu.h> +static void default_vector_allocation_domain (int cpu,struct cpumask *retmask) +{ +/* +* Careful. Some cpus do not strictly honor the set of cpus +* specified in the interrupt destination when using lowest +* priority interrupt delivery mode. +* +* In particular there was a hyperthreading cpu observed to +* deliver interrupts to the wrong hyperthread when only one +* hyperthread was specified in the interrupt desitination. +*/ + *retmask = (cpumask_t ) { { [0 ] =APIC_ALL_CPUS } }; +} +/* should be called last. */ static int probe_default (void ) {
@@ -41,7 +55,7 @@ struct genapic apic_default = { .check_apicid_used = default_check_apicid_used, .check_apicid_present = default_check_apicid_present, - .vector_allocation_domain = vector_allocation_domain, + .vector_allocation_domain = default_vector_allocation_domain, .init_apic_ldr = init_apic_ldr, .ioapic_phys_id_map = ioapic_phys_id_map,
arch/x86/mach-generic/es7000.c +2 -2
@@ -86,7 +86,7 @@ static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id) }#endif -static void vector_allocation_domain (int cpu,cpumask_t *retmask) +static void es7000_vector_allocation_domain (int cpu,cpumask_t *retmask) {/* Careful. Some cpus do not strictly honor the set of cpus * specified in the interrupt destination when using lowest
@@ -116,7 +116,7 @@ struct genapic apic_es7000 = { .check_apicid_used = es7000_check_apicid_used, .check_apicid_present = es7000_check_apicid_present, - .vector_allocation_domain = vector_allocation_domain, + .vector_allocation_domain = es7000_vector_allocation_domain, .init_apic_ldr = init_apic_ldr, .ioapic_phys_id_map = ioapic_phys_id_map,
arch/x86/mach-generic/numaq.c +2 -2
@@ -31,7 +31,7 @@ static int probe_numaq(void)return found_numaq; } -static void vector_allocation_domain (int cpu,cpumask_t *retmask) +static void numaq_vector_allocation_domain (int cpu,cpumask_t *retmask) {/* Careful. Some cpus do not strictly honor the set of cpus * specified in the interrupt destination when using lowest
@@ -61,7 +61,7 @@ struct genapic apic_numaq = { .check_apicid_used = numaq_check_apicid_used, .check_apicid_present = numaq_check_apicid_present, - .vector_allocation_domain = vector_allocation_domain, + .vector_allocation_domain = numaq_vector_allocation_domain, .init_apic_ldr = init_apic_ldr, .ioapic_phys_id_map = ioapic_phys_id_map,
arch/x86/mach-generic/summit.c +2 -2
@@ -24,7 +24,7 @@ static int probe_summit(void)return 0 ; } -static void vector_allocation_domain (int cpu,cpumask_t *retmask) +static void summit_vector_allocation_domain (int cpu,cpumask_t *retmask) {/* Careful. Some cpus do not strictly honor the set of cpus * specified in the interrupt destination when using lowest
@@ -54,7 +54,7 @@ struct genapic apic_summit = { .check_apicid_used = summit_check_apicid_used, .check_apicid_present = summit_check_apicid_present, - .vector_allocation_domain = vector_allocation_domain, + .vector_allocation_domain = summit_vector_allocation_domain, .init_apic_ldr = init_apic_ldr, .ioapic_phys_id_map = ioapic_phys_id_map,
Signature · 1 line
1.6.0.2
PATCH 38/114 x86, apic: clean up ->init_apic_ldr()
In reply to Ingo Molnar- separate the namespace
- remove macros
--- arch/x86/include/asm/bigsmp/apic.h | 2 +- arch/x86/include/asm/es7000/apic.h | 4 ++-- arch/x86/include/asm/mach-default/mach_apic.h | 3 +-- arch/x86/include/asm/mach-generic/mach_apic.h | 1 - arch/x86/include/asm/numaq/apic.h | 2 +- arch/x86/include/asm/summit/apic.h | 2 +- arch/x86/kernel/apic.c | 2 +- arch/x86/mach-generic/bigsmp.c | 2 +- arch/x86/mach-generic/default.c | 2 +- arch/x86/mach-generic/es7000.c | 4 ++-- arch/x86/mach-generic/numaq.c | 2 +- arch/x86/mach-generic/summit.c | 2 +- 12 files changed, 13 insertions(+), 15 deletions(-)
arch/x86/include/asm/bigsmp/apic.h +1 -1
@@ -46,7 +46,7 @@ static inline unsigned long calculate_ldr(int cpu)* an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel * document number 292116). So here it goes... */ -static inline void init_apic_ldr (void ) +static inline void bigsmp_init_apic_ldr (void ) {unsigned long val;int cpu =smp_processor_id ();
arch/x86/include/asm/es7000/apic.h +2 -2
@@ -52,7 +52,7 @@ static inline unsigned long calculate_ldr(int cpu)* an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel * document number 292116). So here it goes... */ -static inline void init_apic_ldr_cluster (void ) +static inline void es7000_init_apic_ldr_cluster (void ) {unsigned long val;int cpu =smp_processor_id ();
@@ -62,7 +62,7 @@ static inline void init_apic_ldr_cluster(void)apic_write (APIC_LDR , val); } -static inline void init_apic_ldr (void ) +static inline void es7000_init_apic_ldr (void ) {unsigned long val;int cpu =smp_processor_id ();
arch/x86/include/asm/mach-default/mach_apic.h +1 -2
@@ -19,7 +19,6 @@ static inline const struct cpumask *default_target_cpus(void)#ifdef CONFIG_X86_64 #include <asm/genapic.h> -#define init_apic_ldr (apic->init_apic_ldr)#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)#define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and)#define phys_pkg_id (apic->phys_pkg_id)
@@ -36,7 +35,7 @@ extern void setup_apic_routing(void);* an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel * document number 292116). So here it goes... */ -static inline void init_apic_ldr (void ) +static inline void default_init_apic_ldr (void ) {unsigned long val;
arch/x86/include/asm/mach-generic/mach_apic.h +0 -1
@@ -3,7 +3,6 @@#include <asm/genapic.h> -#define init_apic_ldr (apic->init_apic_ldr)#define ioapic_phys_id_map (apic->ioapic_phys_id_map)#define setup_apic_routing (apic->setup_apic_routing)#define multi_timer_check (apic->multi_timer_check)
arch/x86/include/asm/numaq/apic.h +1 -1
@@ -28,7 +28,7 @@ static inline int numaq_apic_id_registered(void)return 1 ; } -static inline void init_apic_ldr (void ) +static inline void numaq_init_apic_ldr (void ) {/* Already done in NUMA-Q firmware */ }
arch/x86/include/asm/summit/apic.h +1 -1
@@ -37,7 +37,7 @@ static inline unsigned long summit_check_apicid_present(int bit)extern u8 cpu_2_logical_apicid[]; -static inline void init_apic_ldr (void ) +static inline void summit_init_apic_ldr (void ) {unsigned long val, id;int count =0 ;
arch/x86/kernel/apic.c +1 -1
@@ -1179,7 +1179,7 @@ void __cpuinit setup_local_APIC(void)* an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel * document number 292116). So here it goes... */ -init_apic_ldr (); + apic->init_apic_ldr ();/* * Set Task Priority to 'accept all'. We never change this
arch/x86/mach-generic/bigsmp.c +1 -1
@@ -75,7 +75,7 @@ struct genapic apic_bigsmp = { .check_apicid_present = bigsmp_check_apicid_present, .vector_allocation_domain = bigsmp_vector_allocation_domain, - .init_apic_ldr = init_apic_ldr, + .init_apic_ldr = bigsmp_init_apic_ldr, .ioapic_phys_id_map = ioapic_phys_id_map, .setup_apic_routing = setup_apic_routing,
arch/x86/mach-generic/default.c +1 -1
@@ -56,7 +56,7 @@ struct genapic apic_default = { .check_apicid_present = default_check_apicid_present, .vector_allocation_domain = default_vector_allocation_domain, - .init_apic_ldr = init_apic_ldr, + .init_apic_ldr = default_init_apic_ldr, .ioapic_phys_id_map = ioapic_phys_id_map, .setup_apic_routing = setup_apic_routing,
arch/x86/mach-generic/es7000.c +2 -2
@@ -24,7 +24,7 @@ void __init es7000_update_genapic_to_cluster(void) apic->irq_delivery_mode =INT_DELIVERY_MODE_CLUSTER ; apic->irq_dest_mode =INT_DEST_MODE_CLUSTER ; - apic->init_apic_ldr = init_apic_ldr_cluster; + apic->init_apic_ldr = es7000_init_apic_ldr_cluster; apic->cpu_mask_to_apicid = cpu_mask_to_apicid_cluster; }
@@ -117,7 +117,7 @@ struct genapic apic_es7000 = { .check_apicid_present = es7000_check_apicid_present, .vector_allocation_domain = es7000_vector_allocation_domain, - .init_apic_ldr = init_apic_ldr, + .init_apic_ldr = es7000_init_apic_ldr, .ioapic_phys_id_map = ioapic_phys_id_map, .setup_apic_routing = setup_apic_routing,
arch/x86/mach-generic/numaq.c +1 -1
@@ -62,7 +62,7 @@ struct genapic apic_numaq = { .check_apicid_present = numaq_check_apicid_present, .vector_allocation_domain = numaq_vector_allocation_domain, - .init_apic_ldr = init_apic_ldr, + .init_apic_ldr = numaq_init_apic_ldr, .ioapic_phys_id_map = ioapic_phys_id_map, .setup_apic_routing = setup_apic_routing,
arch/x86/mach-generic/summit.c +1 -1
@@ -55,7 +55,7 @@ struct genapic apic_summit = { .check_apicid_present = summit_check_apicid_present, .vector_allocation_domain = summit_vector_allocation_domain, - .init_apic_ldr = init_apic_ldr, + .init_apic_ldr = summit_init_apic_ldr, .ioapic_phys_id_map = ioapic_phys_id_map, .setup_apic_routing = setup_apic_routing,
Signature · 1 line
1.6.0.2
PATCH 39/114 x86, apic: clean up ->ioapic_phys_id_map()
In reply to Ingo Molnar- separate the namespace
- remove macros
--- arch/x86/include/asm/bigsmp/apic.h | 2 +- arch/x86/include/asm/es7000/apic.h | 2 +- arch/x86/include/asm/mach-default/mach_apic.h | 2 +- arch/x86/include/asm/mach-generic/mach_apic.h | 1 - arch/x86/include/asm/numaq/apic.h | 2 +- arch/x86/include/asm/summit/apic.h | 3 ++- arch/x86/kernel/io_apic.c | 4 ++-- arch/x86/mach-generic/bigsmp.c | 2 +- arch/x86/mach-generic/default.c | 2 +- arch/x86/mach-generic/es7000.c | 2 +- arch/x86/mach-generic/numaq.c | 2 +- arch/x86/mach-generic/summit.c | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-)
arch/x86/include/asm/bigsmp/apic.h +1 -1
@@ -94,7 +94,7 @@ static inline int cpu_to_logical_apicid(int cpu)return cpu_physical_id (cpu); } -static inline physid_mask_t ioapic_phys_id_map (physid_mask_t phys_map) +static inline physid_mask_t bigsmp_ioapic_phys_id_map (physid_mask_t phys_map) {/* For clustered we don't have a good way to do this yet - hack */ return physids_promote (0xFFL );
arch/x86/include/asm/es7000/apic.h +1 -1
@@ -125,7 +125,7 @@ static inline int cpu_to_logical_apicid(int cpu)#endif } -static inline physid_mask_t ioapic_phys_id_map (physid_mask_t phys_map) +static inline physid_mask_t es7000_ioapic_phys_id_map (physid_mask_t phys_map) {/* For clustered we don't have a good way to do this yet - hack */ return physids_promote (0xff );
arch/x86/include/asm/mach-default/mach_apic.h +1 -1
@@ -99,7 +99,7 @@ static inline unsigned long default_check_apicid_present(int bit)return physid_isset (bit, phys_cpu_present_map); } -static inline physid_mask_t ioapic_phys_id_map (physid_mask_t phys_map) +static inline physid_mask_t default_ioapic_phys_id_map (physid_mask_t phys_map) {return phys_map; }
arch/x86/include/asm/mach-generic/mach_apic.h +0 -1
@@ -3,7 +3,6 @@#include <asm/genapic.h> -#define ioapic_phys_id_map (apic->ioapic_phys_id_map)#define setup_apic_routing (apic->setup_apic_routing)#define multi_timer_check (apic->multi_timer_check)#define apicid_to_node (apic->apicid_to_node)
arch/x86/include/asm/numaq/apic.h +1 -1
@@ -48,7 +48,7 @@ static inline int multi_timer_check(int apic, int irq)return apic !=0 && irq ==0 ; } -static inline physid_mask_t ioapic_phys_id_map (physid_mask_t phys_map) +static inline physid_mask_t numaq_ioapic_phys_id_map (physid_mask_t phys_map) {/* We don't have a good way to do this yet - hack */ return physids_promote (0xFUL );
arch/x86/include/asm/summit/apic.h +2 -1
@@ -109,7 +109,8 @@ static inline int cpu_present_to_apicid(int mps_cpu)return BAD_APICID ; } -static inline physid_mask_t ioapic_phys_id_map (physid_mask_t phys_id_map) +static inline physid_mask_t +summit_ioapic_phys_id_map (physid_mask_t phys_id_map) {/* For clustered we don't have a good way to do this yet - hack */ return physids_promote (0x0F );
arch/x86/kernel/io_apic.c +2 -2
@@ -2108,7 +2108,7 @@ static void __init setup_ioapic_ids_from_mpc(void)* This is broken; anything with a real cpu count has to * circumvent this idiocy regardless. */ - phys_id_present_map =ioapic_phys_id_map (phys_cpu_present_map); + phys_id_present_map = apic->ioapic_phys_id_map (phys_cpu_present_map);/* * Set the IOAPIC ID to the value stored in the MPC table.
@@ -3862,7 +3862,7 @@ int __init io_apic_get_unique_id(int ioapic, int apic_id)*/ if (physids_empty (apic_id_map)) - apic_id_map =ioapic_phys_id_map (phys_cpu_present_map); + apic_id_map = apic->ioapic_phys_id_map (phys_cpu_present_map);spin_lock_irqsave (&ioapic_lock, flags); reg_00.raw =io_apic_read (ioapic,0 );
arch/x86/mach-generic/bigsmp.c +1 -1
@@ -77,7 +77,7 @@ struct genapic apic_bigsmp = { .vector_allocation_domain = bigsmp_vector_allocation_domain, .init_apic_ldr = bigsmp_init_apic_ldr, - .ioapic_phys_id_map = ioapic_phys_id_map, + .ioapic_phys_id_map = bigsmp_ioapic_phys_id_map, .setup_apic_routing = setup_apic_routing, .multi_timer_check = multi_timer_check, .apicid_to_node = apicid_to_node,
arch/x86/mach-generic/default.c +1 -1
@@ -58,7 +58,7 @@ struct genapic apic_default = { .vector_allocation_domain = default_vector_allocation_domain, .init_apic_ldr = default_init_apic_ldr, - .ioapic_phys_id_map = ioapic_phys_id_map, + .ioapic_phys_id_map = default_ioapic_phys_id_map, .setup_apic_routing = setup_apic_routing, .multi_timer_check = multi_timer_check, .apicid_to_node = apicid_to_node,
arch/x86/mach-generic/es7000.c +1 -1
@@ -119,7 +119,7 @@ struct genapic apic_es7000 = { .vector_allocation_domain = es7000_vector_allocation_domain, .init_apic_ldr = es7000_init_apic_ldr, - .ioapic_phys_id_map = ioapic_phys_id_map, + .ioapic_phys_id_map = es7000_ioapic_phys_id_map, .setup_apic_routing = setup_apic_routing, .multi_timer_check = multi_timer_check, .apicid_to_node = apicid_to_node,
arch/x86/mach-generic/numaq.c +1 -1
@@ -64,7 +64,7 @@ struct genapic apic_numaq = { .vector_allocation_domain = numaq_vector_allocation_domain, .init_apic_ldr = numaq_init_apic_ldr, - .ioapic_phys_id_map = ioapic_phys_id_map, + .ioapic_phys_id_map = numaq_ioapic_phys_id_map, .setup_apic_routing = setup_apic_routing, .multi_timer_check = multi_timer_check, .apicid_to_node = apicid_to_node,
arch/x86/mach-generic/summit.c +1 -1
@@ -57,7 +57,7 @@ struct genapic apic_summit = { .vector_allocation_domain = summit_vector_allocation_domain, .init_apic_ldr = summit_init_apic_ldr, - .ioapic_phys_id_map = ioapic_phys_id_map, + .ioapic_phys_id_map = summit_ioapic_phys_id_map, .setup_apic_routing = setup_apic_routing, .multi_timer_check = multi_timer_check, .apicid_to_node = apicid_to_node,
Signature · 1 line
1.6.0.2
PATCH 40/114 x86, apic: clean up ->setup_apic_routing()
In reply to Ingo Molnar- separate the namespace
- remove macros
- remove namespace clash on 64-bit
--- arch/x86/include/asm/bigsmp/apic.h | 2 +- arch/x86/include/asm/es7000/apic.h | 2 +- arch/x86/include/asm/genapic.h | 2 +- arch/x86/include/asm/mach-default/mach_apic.h | 4 ++-- arch/x86/include/asm/mach-generic/mach_apic.h | 1 - arch/x86/include/asm/numaq/apic.h | 2 +- arch/x86/include/asm/summit/apic.h | 2 +- arch/x86/kernel/acpi/boot.c | 5 ++--- arch/x86/kernel/apic.c | 2 +- arch/x86/kernel/genapic_64.c | 2 +- arch/x86/kernel/mpparse.c | 6 +++--- arch/x86/kernel/smpboot.c | 2 +- arch/x86/mach-generic/bigsmp.c | 2 +- arch/x86/mach-generic/default.c | 2 +- arch/x86/mach-generic/es7000.c | 2 +- arch/x86/mach-generic/numaq.c | 2 +- arch/x86/mach-generic/summit.c | 2 +- 17 files changed, 20 insertions(+), 22 deletions(-)
arch/x86/include/asm/bigsmp/apic.h +1 -1
@@ -56,7 +56,7 @@ static inline void bigsmp_init_apic_ldr(void)apic_write (APIC_LDR , val); } -static inline void setup_apic_routing (void ) +static inline void bigsmp_setup_apic_routing (void ) {printk ("Enabling APIC mode: %s. Using %d I/O APICs\n" ,"Physflat" , nr_ioapics);
arch/x86/include/asm/es7000/apic.h +1 -1
@@ -73,7 +73,7 @@ static inline void es7000_init_apic_ldr(void) }extern int apic_version [MAX_APICS ]; -static inline void setup_apic_routing (void ) +static inline void es7000_setup_apic_routing (void ) {int apic =per_cpu (x86_bios_cpu_apicid,smp_processor_id ()); printk("Enabling APIC mode: %s. Using %d I/O APICs, target cpus %lx\n",
arch/x86/include/asm/genapic.h +1 -1
@@ -107,7 +107,7 @@ extern void apic_send_IPI_self(int vector);extern struct genapic apic_x2apic_uv_x;DECLARE_PER_CPU (int, x2apic_extra_bits); -extern void setup_apic_routing (void ); +extern void default_setup_apic_routing (void );#endif #endif /* _ASM_X86_GENAPIC_64_H */
arch/x86/include/asm/mach-default/mach_apic.h +2 -2
@@ -25,7 +25,7 @@ static inline const struct cpumask *default_target_cpus(void)#define read_apic_id () (GET_APIC_ID(apic_read(APIC_ID)))#define send_IPI_self (apic->send_IPI_self)#define wakeup_secondary_cpu (apic->wakeup_cpu) -extern void setup_apic_routing (void ); +extern void default_setup_apic_routing (void );#else #define wakeup_secondary_cpu wakeup_secondary_cpu_via_init/*
@@ -70,7 +70,7 @@ static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)return cpuid_apic >> index_msb; } -static inline void setup_apic_routing (void ) +static inline void default_setup_apic_routing (void ) {#ifdef CONFIG_X86_IO_APIC printk("Enabling APIC mode: %s. Using %d I/O APICs\n",
arch/x86/include/asm/mach-generic/mach_apic.h +0 -1
@@ -3,7 +3,6 @@#include <asm/genapic.h> -#define setup_apic_routing (apic->setup_apic_routing)#define multi_timer_check (apic->multi_timer_check)#define apicid_to_node (apic->apicid_to_node)#define cpu_to_logical_apicid (apic->cpu_to_logical_apicid)
arch/x86/include/asm/numaq/apic.h +1 -1
@@ -33,7 +33,7 @@ static inline void numaq_init_apic_ldr(void)/* Already done in NUMA-Q firmware */ } -static inline void setup_apic_routing (void ) +static inline void numaq_setup_apic_routing (void ) {printk ("Enabling APIC mode: %s. Using %d I/O APICs\n" ,"NUMA-Q" , nr_ioapics);
arch/x86/include/asm/summit/apic.h +1 -1
@@ -74,7 +74,7 @@ static inline int summit_apic_id_registered(void)return 1 ; } -static inline void setup_apic_routing (void ) +static inline void summit_setup_apic_routing (void ) {printk ("Enabling APIC mode: Summit. Using %d I/O APICs\n" , nr_ioapics);
arch/x86/kernel/acpi/boot.c +2 -3
@@ -1360,9 +1360,8 @@ static void __init acpi_process_madt(void) acpi_ioapic =1 ; smp_found_config =1 ; -#ifdef CONFIG_X86_32 -setup_apic_routing (); -#endif +if (apic->setup_apic_routing) + apic->setup_apic_routing (); } }if (error == -EINVAL ) {
arch/x86/kernel/apic.c +1 -1
@@ -1625,7 +1625,7 @@ int __init APIC_init_uniprocessor(void)enable_IR_x2apic ();#endif #ifdef CONFIG_X86_64 -setup_apic_routing (); +default_setup_apic_routing ();#endif verify_local_APIC ();
arch/x86/kernel/genapic_64.c +1 -1
@@ -44,7 +44,7 @@ static struct genapic *apic_probe[] __initdata = {/* * Check the APIC IDs in bios_cpu_apicid and choose the APIC mode. */ -void __init setup_apic_routing (void ) +void __init default_setup_apic_routing (void ) {if (apic == &apic_x2apic_phys || apic == &apic_x2apic_cluster) {if (!intr_remapping_enabled)
arch/x86/kernel/mpparse.c +3 -3
@@ -390,9 +390,9 @@ static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early)generic_bigsmp_probe ();#endif -#ifdef CONFIG_X86_32 -setup_apic_routing (); -#endif +if (apic->setup_apic_routing) + apic->setup_apic_routing (); +if (!num_processors)printk (KERN_ERR "MPTABLE: no processors registered!\n" );return num_processors;
arch/x86/kernel/smpboot.c +1 -1
@@ -1128,7 +1128,7 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)#ifdef CONFIG_X86_64 enable_IR_x2apic (); -setup_apic_routing (); +default_setup_apic_routing ();#endif if (smp_sanity_check (max_cpus) <0 ) {
arch/x86/mach-generic/bigsmp.c +1 -1
@@ -78,7 +78,7 @@ struct genapic apic_bigsmp = { .init_apic_ldr = bigsmp_init_apic_ldr, .ioapic_phys_id_map = bigsmp_ioapic_phys_id_map, - .setup_apic_routing = setup_apic_routing, + .setup_apic_routing = bigsmp_setup_apic_routing, .multi_timer_check = multi_timer_check, .apicid_to_node = apicid_to_node, .cpu_to_logical_apicid = cpu_to_logical_apicid,
arch/x86/mach-generic/default.c +1 -1
@@ -59,7 +59,7 @@ struct genapic apic_default = { .init_apic_ldr = default_init_apic_ldr, .ioapic_phys_id_map = default_ioapic_phys_id_map, - .setup_apic_routing = setup_apic_routing, + .setup_apic_routing = default_setup_apic_routing, .multi_timer_check = multi_timer_check, .apicid_to_node = apicid_to_node, .cpu_to_logical_apicid = cpu_to_logical_apicid,
arch/x86/mach-generic/es7000.c +1 -1
@@ -120,7 +120,7 @@ struct genapic apic_es7000 = { .init_apic_ldr = es7000_init_apic_ldr, .ioapic_phys_id_map = es7000_ioapic_phys_id_map, - .setup_apic_routing = setup_apic_routing, + .setup_apic_routing = es7000_setup_apic_routing, .multi_timer_check = multi_timer_check, .apicid_to_node = apicid_to_node, .cpu_to_logical_apicid = cpu_to_logical_apicid,
arch/x86/mach-generic/numaq.c +1 -1
@@ -65,7 +65,7 @@ struct genapic apic_numaq = { .init_apic_ldr = numaq_init_apic_ldr, .ioapic_phys_id_map = numaq_ioapic_phys_id_map, - .setup_apic_routing = setup_apic_routing, + .setup_apic_routing = numaq_setup_apic_routing, .multi_timer_check = multi_timer_check, .apicid_to_node = apicid_to_node, .cpu_to_logical_apicid = cpu_to_logical_apicid,
arch/x86/mach-generic/summit.c +1 -1
@@ -58,7 +58,7 @@ struct genapic apic_summit = { .init_apic_ldr = summit_init_apic_ldr, .ioapic_phys_id_map = summit_ioapic_phys_id_map, - .setup_apic_routing = setup_apic_routing, + .setup_apic_routing = summit_setup_apic_routing, .multi_timer_check = multi_timer_check, .apicid_to_node = apicid_to_node, .cpu_to_logical_apicid = cpu_to_logical_apicid,
Signature · 1 line
1.6.0.2
PATCH 41/114 x86, apic: streamline the ->multi_timer_check() quirk
In reply to Ingo Molnaronly NUMAQ uses this quirk: to prevent the timer IRQ from being added on secondary nodes.
All other genapic templates can have a NULL ->multi_timer_check() callback.
Also, extend the generic code to treat a NULL pointer accordingly.
--- arch/x86/include/asm/bigsmp/apic.h | 5 ----- arch/x86/include/asm/es7000/apic.h | 5 ----- arch/x86/include/asm/mach-default/mach_apic.h | 5 ----- arch/x86/include/asm/mach-generic/mach_apic.h | 1 - arch/x86/include/asm/numaq/apic.h | 2 +- arch/x86/include/asm/summit/apic.h | 5 ----- arch/x86/kernel/io_apic.c | 11 ++++++++--- arch/x86/mach-generic/bigsmp.c | 2 +- arch/x86/mach-generic/default.c | 2 +- arch/x86/mach-generic/es7000.c | 2 +- arch/x86/mach-generic/numaq.c | 2 +- arch/x86/mach-generic/summit.c | 2 +- 12 files changed, 14 insertions(+), 30 deletions(-)
arch/x86/include/asm/bigsmp/apic.h +0 -5
@@ -62,11 +62,6 @@ static inline void bigsmp_setup_apic_routing(void) "Physflat", nr_ioapics); } -static inline int multi_timer_check (int apic,int irq) -{ -return (0 ); -} -static inline int apicid_to_node (int logical_apicid) {return apicid_2_node[hard_smp_processor_id ()];
arch/x86/include/asm/es7000/apic.h +0 -5
@@ -82,11 +82,6 @@ static inline void es7000_setup_apic_routing(void) nr_ioapics, cpus_addr(*es7000_target_cpus())[0]); } -static inline int multi_timer_check (int apic,int irq) -{ -return 0 ; -} -static inline int apicid_to_node (int logical_apicid) {return 0 ;
arch/x86/include/asm/mach-default/mach_apic.h +0 -5
@@ -104,11 +104,6 @@ static inline physid_mask_t default_ioapic_phys_id_map(physid_mask_t phys_map)return phys_map; } -static inline int multi_timer_check (int apic,int irq) -{ -return 0 ; -} -/* Mapping from cpu number to logical apicid */ static inline int cpu_to_logical_apicid (int cpu) {
arch/x86/include/asm/mach-generic/mach_apic.h +0 -1
@@ -3,7 +3,6 @@#include <asm/genapic.h> -#define multi_timer_check (apic->multi_timer_check)#define apicid_to_node (apic->apicid_to_node)#define cpu_to_logical_apicid (apic->cpu_to_logical_apicid)#define cpu_present_to_apicid (apic->cpu_present_to_apicid)
arch/x86/include/asm/numaq/apic.h +1 -1
@@ -43,7 +43,7 @@ static inline void numaq_setup_apic_routing(void)* Skip adding the timer int on secondary nodes, which causes * a small but painful rift in the time-space continuum. */ -static inline int multi_timer_check (int apic,int irq) +static inline int numaq_multi_timer_check (int apic,int irq) {return apic !=0 && irq ==0 ; }
arch/x86/include/asm/summit/apic.h +0 -5
@@ -64,11 +64,6 @@ static inline void summit_init_apic_ldr(void)apic_write (APIC_LDR , val); } -static inline int multi_timer_check (int apic,int irq) -{ -return 0 ; -} -static inline int summit_apic_id_registered (void ) {return 1 ;
arch/x86/kernel/io_apic.c +8 -3
@@ -1618,10 +1618,15 @@ static void __init setup_IO_APIC_irqs(void) } irq =pin_2_irq (idx, apic_id, pin); -#ifdef CONFIG_X86_32 -if (multi_timer_check (apic_id, irq)) + +/* +* Skip the timer IRQ if there's a quirk handler +* installed and if it returns 1: +*/ +if (apic->multi_timer_check && + apic->multi_timer_check (apic_id, irq))continue ; -#endif + desc =irq_to_desc_alloc_cpu (irq, cpu);if (!desc) {printk (KERN_INFO "can not get irq_desc for %d\n" , irq);
arch/x86/mach-generic/bigsmp.c +1 -1
@@ -79,7 +79,7 @@ struct genapic apic_bigsmp = { .ioapic_phys_id_map = bigsmp_ioapic_phys_id_map, .setup_apic_routing = bigsmp_setup_apic_routing, - .multi_timer_check = multi_timer_check, + .multi_timer_check = NULL, .apicid_to_node = apicid_to_node, .cpu_to_logical_apicid = cpu_to_logical_apicid, .cpu_present_to_apicid = cpu_present_to_apicid,
arch/x86/mach-generic/default.c +1 -1
@@ -60,7 +60,7 @@ struct genapic apic_default = { .ioapic_phys_id_map = default_ioapic_phys_id_map, .setup_apic_routing = default_setup_apic_routing, - .multi_timer_check = multi_timer_check, + .multi_timer_check = NULL, .apicid_to_node = apicid_to_node, .cpu_to_logical_apicid = cpu_to_logical_apicid, .cpu_present_to_apicid = cpu_present_to_apicid,
arch/x86/mach-generic/es7000.c +1 -1
@@ -121,7 +121,7 @@ struct genapic apic_es7000 = { .ioapic_phys_id_map = es7000_ioapic_phys_id_map, .setup_apic_routing = es7000_setup_apic_routing, - .multi_timer_check = multi_timer_check, + .multi_timer_check = NULL, .apicid_to_node = apicid_to_node, .cpu_to_logical_apicid = cpu_to_logical_apicid, .cpu_present_to_apicid = cpu_present_to_apicid,
arch/x86/mach-generic/numaq.c +1 -1
@@ -66,7 +66,7 @@ struct genapic apic_numaq = { .ioapic_phys_id_map = numaq_ioapic_phys_id_map, .setup_apic_routing = numaq_setup_apic_routing, - .multi_timer_check = multi_timer_check, + .multi_timer_check = numaq_multi_timer_check, .apicid_to_node = apicid_to_node, .cpu_to_logical_apicid = cpu_to_logical_apicid, .cpu_present_to_apicid = cpu_present_to_apicid,
arch/x86/mach-generic/summit.c +1 -1
@@ -59,7 +59,7 @@ struct genapic apic_summit = { .ioapic_phys_id_map = summit_ioapic_phys_id_map, .setup_apic_routing = summit_setup_apic_routing, - .multi_timer_check = multi_timer_check, + .multi_timer_check = NULL, .apicid_to_node = apicid_to_node, .cpu_to_logical_apicid = cpu_to_logical_apicid, .cpu_present_to_apicid = cpu_present_to_apicid,
Signature · 1 line
1.6.0.2
PATCH 42/114 x86, apic: clean up ->apicid_to_node()
In reply to Ingo Molnar- separate the namespace
- remove macros
--- arch/x86/include/asm/bigsmp/apic.h | 2 +- arch/x86/include/asm/es7000/apic.h | 2 +- arch/x86/include/asm/mach-default/mach_apic.h | 2 +- arch/x86/include/asm/mach-generic/mach_apic.h | 1 - arch/x86/include/asm/numaq/apic.h | 4 ++-- arch/x86/include/asm/summit/apic.h | 2 +- arch/x86/kernel/smpboot.c | 2 +- arch/x86/mach-generic/bigsmp.c | 2 +- arch/x86/mach-generic/default.c | 2 +- arch/x86/mach-generic/es7000.c | 2 +- arch/x86/mach-generic/numaq.c | 2 +- arch/x86/mach-generic/summit.c | 2 +- 12 files changed, 12 insertions(+), 13 deletions(-)
arch/x86/include/asm/bigsmp/apic.h +1 -1
@@ -62,7 +62,7 @@ static inline void bigsmp_setup_apic_routing(void) "Physflat", nr_ioapics); } -static inline int apicid_to_node (int logical_apicid) +static inline int bigsmp_apicid_to_node (int logical_apicid) {return apicid_2_node[hard_smp_processor_id ()]; }
arch/x86/include/asm/es7000/apic.h +1 -1
@@ -82,7 +82,7 @@ static inline void es7000_setup_apic_routing(void) nr_ioapics, cpus_addr(*es7000_target_cpus())[0]); } -static inline int apicid_to_node (int logical_apicid) +static inline int es7000_apicid_to_node (int logical_apicid) {return 0 ; }
arch/x86/include/asm/mach-default/mach_apic.h +1 -1
@@ -78,7 +78,7 @@ static inline void default_setup_apic_routing(void)#endif } -static inline int apicid_to_node (int logical_apicid) +static inline int default_apicid_to_node (int logical_apicid) {#ifdef CONFIG_SMP return apicid_2_node[hard_smp_processor_id ()];
arch/x86/include/asm/mach-generic/mach_apic.h +0 -1
@@ -3,7 +3,6 @@#include <asm/genapic.h> -#define apicid_to_node (apic->apicid_to_node)#define cpu_to_logical_apicid (apic->cpu_to_logical_apicid)#define cpu_present_to_apicid (apic->cpu_present_to_apicid)#define apicid_to_cpu_present (apic->apicid_to_cpu_present)
arch/x86/include/asm/numaq/apic.h +2 -2
@@ -76,14 +76,14 @@ static inline int cpu_present_to_apicid(int mps_cpu)return BAD_APICID ; } -static inline int apicid_to_node (int logical_apicid) +static inline int numaq_apicid_to_node (int logical_apicid) {return logical_apicid >>4 ; }static inline physid_mask_t apicid_to_cpu_present (int logical_apicid) { -int node =apicid_to_node (logical_apicid); +int node =numaq_apicid_to_node (logical_apicid);int cpu =__ffs (logical_apicid &0xf );return physid_mask_of_physid (cpu +4 *node);
arch/x86/include/asm/summit/apic.h +1 -1
@@ -75,7 +75,7 @@ static inline void summit_setup_apic_routing(void) nr_ioapics); } -static inline int apicid_to_node (int logical_apicid) +static inline int summit_apicid_to_node (int logical_apicid) {#ifdef CONFIG_SMP return apicid_2_node[hard_smp_processor_id ()];
arch/x86/kernel/smpboot.c +1 -1
@@ -163,7 +163,7 @@ static void map_cpu_to_logical_apicid(void) {int cpu =smp_processor_id ();int apicid =logical_smp_processor_id (); -int node =apicid_to_node (apicid); +int node = apic->apicid_to_node (apicid);if (!node_online (node)) node = first_online_node;
arch/x86/mach-generic/bigsmp.c +1 -1
@@ -80,7 +80,7 @@ struct genapic apic_bigsmp = { .ioapic_phys_id_map = bigsmp_ioapic_phys_id_map, .setup_apic_routing = bigsmp_setup_apic_routing, .multi_timer_check = NULL, - .apicid_to_node = apicid_to_node, + .apicid_to_node = bigsmp_apicid_to_node, .cpu_to_logical_apicid = cpu_to_logical_apicid, .cpu_present_to_apicid = cpu_present_to_apicid, .apicid_to_cpu_present = apicid_to_cpu_present,
arch/x86/mach-generic/default.c +1 -1
@@ -61,7 +61,7 @@ struct genapic apic_default = { .ioapic_phys_id_map = default_ioapic_phys_id_map, .setup_apic_routing = default_setup_apic_routing, .multi_timer_check = NULL, - .apicid_to_node = apicid_to_node, + .apicid_to_node = default_apicid_to_node, .cpu_to_logical_apicid = cpu_to_logical_apicid, .cpu_present_to_apicid = cpu_present_to_apicid, .apicid_to_cpu_present = apicid_to_cpu_present,
arch/x86/mach-generic/es7000.c +1 -1
@@ -122,7 +122,7 @@ struct genapic apic_es7000 = { .ioapic_phys_id_map = es7000_ioapic_phys_id_map, .setup_apic_routing = es7000_setup_apic_routing, .multi_timer_check = NULL, - .apicid_to_node = apicid_to_node, + .apicid_to_node = es7000_apicid_to_node, .cpu_to_logical_apicid = cpu_to_logical_apicid, .cpu_present_to_apicid = cpu_present_to_apicid, .apicid_to_cpu_present = apicid_to_cpu_present,
arch/x86/mach-generic/numaq.c +1 -1
@@ -67,7 +67,7 @@ struct genapic apic_numaq = { .ioapic_phys_id_map = numaq_ioapic_phys_id_map, .setup_apic_routing = numaq_setup_apic_routing, .multi_timer_check = numaq_multi_timer_check, - .apicid_to_node = apicid_to_node, + .apicid_to_node = numaq_apicid_to_node, .cpu_to_logical_apicid = cpu_to_logical_apicid, .cpu_present_to_apicid = cpu_present_to_apicid, .apicid_to_cpu_present = apicid_to_cpu_present,
arch/x86/mach-generic/summit.c +1 -1
@@ -60,7 +60,7 @@ struct genapic apic_summit = { .ioapic_phys_id_map = summit_ioapic_phys_id_map, .setup_apic_routing = summit_setup_apic_routing, .multi_timer_check = NULL, - .apicid_to_node = apicid_to_node, + .apicid_to_node = summit_apicid_to_node, .cpu_to_logical_apicid = cpu_to_logical_apicid, .cpu_present_to_apicid = cpu_present_to_apicid, .apicid_to_cpu_present = apicid_to_cpu_present,
Signature · 1 line
1.6.0.2
PATCH 43/114 x86, apic: clean up ->cpu_to_logical_apicid()
In reply to Ingo Molnar- separate the namespace
- remove macros
--- arch/x86/include/asm/bigsmp/apic.h | 6 +++--- arch/x86/include/asm/es7000/apic.h | 16 ++++++++-------- arch/x86/include/asm/mach-default/mach_apic.h | 2 +- arch/x86/include/asm/mach-generic/mach_apic.h | 1 - arch/x86/include/asm/numaq/apic.h | 3 ++- arch/x86/include/asm/summit/apic.h | 8 ++++---- arch/x86/kernel/ipi.c | 4 ++-- arch/x86/mach-generic/bigsmp.c | 2 +- arch/x86/mach-generic/default.c | 2 +- arch/x86/mach-generic/es7000.c | 2 +- arch/x86/mach-generic/numaq.c | 2 +- arch/x86/mach-generic/summit.c | 2 +- 12 files changed, 25 insertions(+), 25 deletions(-)
arch/x86/include/asm/bigsmp/apic.h +3 -3
@@ -82,7 +82,7 @@ static inline physid_mask_t apicid_to_cpu_present(int phys_apicid)extern u8 cpu_2_logical_apicid[];/* Mapping from cpu number to logical apicid */ -static inline int cpu_to_logical_apicid (int cpu) +static inline int bigsmp_cpu_to_logical_apicid (int cpu) {if (cpu >= nr_cpu_ids)return BAD_APICID ;
@@ -115,7 +115,7 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)int apicid; cpu =first_cpu (*cpumask); - apicid =cpu_to_logical_apicid (cpu); + apicid =bigsmp_cpu_to_logical_apicid (cpu);return apicid; }
@@ -132,7 +132,7 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask,if (cpumask_test_cpu (cpu, cpu_online_mask))break ;if (cpu < nr_cpu_ids) -return cpu_to_logical_apicid (cpu); +return bigsmp_cpu_to_logical_apicid (cpu);return BAD_APICID ; }
arch/x86/include/asm/es7000/apic.h +8 -8
@@ -109,7 +109,7 @@ static inline physid_mask_t apicid_to_cpu_present(int phys_apicid)extern u8 cpu_2_logical_apicid[];/* Mapping from cpu number to logical apicid */ -static inline int cpu_to_logical_apicid (int cpu) +static inline int es7000_cpu_to_logical_apicid (int cpu) {#ifdef CONFIG_SMP if (cpu >= nr_cpu_ids)
@@ -155,10 +155,10 @@ cpu_mask_to_apicid_cluster(const struct cpumask *cpumask)* on the same apicid cluster return default value of target_cpus(): */ cpu =cpumask_first (cpumask); - apicid =cpu_to_logical_apicid (cpu); + apicid =es7000_cpu_to_logical_apicid (cpu);while (cpus_found < num_bits_set) {if (cpumask_test_cpu (cpu, cpumask)) { -int new_apicid =cpu_to_logical_apicid (cpu); +int new_apicid =es7000_cpu_to_logical_apicid (cpu);if (apicid_cluster (apicid) !=apicid_cluster (new_apicid)){printk ("%s: Not a valid mask!\n" , __func__);
@@ -182,20 +182,20 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask) num_bits_set =cpus_weight (*cpumask);/* Return id to all */ if (num_bits_set == nr_cpu_ids) -return cpu_to_logical_apicid (0 ); +return es7000_cpu_to_logical_apicid (0 );/* * The cpus in the mask must all be on the apic cluster. If are not * on the same apicid cluster return default value of target_cpus(): */ cpu =first_cpu (*cpumask); - apicid =cpu_to_logical_apicid (cpu); + apicid =es7000_cpu_to_logical_apicid (cpu);while (cpus_found < num_bits_set) {if (cpu_isset (cpu, *cpumask)) { -int new_apicid =cpu_to_logical_apicid (cpu); +int new_apicid =es7000_cpu_to_logical_apicid (cpu);if (apicid_cluster (apicid) !=apicid_cluster (new_apicid)){printk ("%s: Not a valid mask!\n" , __func__); -return cpu_to_logical_apicid (0 ); +return es7000_cpu_to_logical_apicid (0 ); } apicid = new_apicid; cpus_found++;
@@ -209,7 +209,7 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)static inline unsigned int cpu_mask_to_apicid_and (const struct cpumask *inmask,const struct cpumask *andmask) { -int apicid =cpu_to_logical_apicid (0 ); +int apicid =es7000_cpu_to_logical_apicid (0 );cpumask_var_t cpumask;if (!alloc_cpumask_var (&cpumask,GFP_ATOMIC ))
arch/x86/include/asm/mach-default/mach_apic.h +1 -1
@@ -105,7 +105,7 @@ static inline physid_mask_t default_ioapic_phys_id_map(physid_mask_t phys_map) }/* Mapping from cpu number to logical apicid */ -static inline int cpu_to_logical_apicid (int cpu) +static inline int default_cpu_to_logical_apicid (int cpu) {return 1 << cpu; }
arch/x86/include/asm/mach-generic/mach_apic.h +0 -1
@@ -3,7 +3,6 @@#include <asm/genapic.h> -#define cpu_to_logical_apicid (apic->cpu_to_logical_apicid)#define cpu_present_to_apicid (apic->cpu_present_to_apicid)#define apicid_to_cpu_present (apic->apicid_to_cpu_present)#define setup_portio_remap (apic->setup_portio_remap)
arch/x86/include/asm/numaq/apic.h +2 -1
@@ -56,7 +56,8 @@ static inline physid_mask_t numaq_ioapic_phys_id_map(physid_mask_t phys_map)/* Mapping from cpu number to logical apicid */ extern u8 cpu_2_logical_apicid[]; -static inline int cpu_to_logical_apicid (int cpu) + +static inline int numaq_cpu_to_logical_apicid (int cpu) {if (cpu >= nr_cpu_ids)return BAD_APICID ;
arch/x86/include/asm/summit/apic.h +4 -4
@@ -85,7 +85,7 @@ static inline int summit_apicid_to_node(int logical_apicid) }/* Mapping from cpu number to logical apicid */ -static inline int cpu_to_logical_apicid (int cpu) +static inline int summit_cpu_to_logical_apicid (int cpu) {#ifdef CONFIG_SMP if (cpu >= nr_cpu_ids)
@@ -145,10 +145,10 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)* on the same apicid cluster return default value of target_cpus(): */ cpu =first_cpu (*cpumask); - apicid =cpu_to_logical_apicid (cpu); + apicid =summit_cpu_to_logical_apicid (cpu);while (cpus_found < num_bits_set) {if (cpu_isset (cpu, *cpumask)) { -int new_apicid =cpu_to_logical_apicid (cpu); +int new_apicid =summit_cpu_to_logical_apicid (cpu);if (apicid_cluster (apicid) !=apicid_cluster (new_apicid)){printk ("%s: Not a valid mask!\n" , __func__);
@@ -165,7 +165,7 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)static inline unsigned int cpu_mask_to_apicid_and (const struct cpumask *inmask,const struct cpumask *andmask) { -int apicid =cpu_to_logical_apicid (0 ); +int apicid =summit_cpu_to_logical_apicid (0 );cpumask_var_t cpumask;if (!alloc_cpumask_var (&cpumask,GFP_ATOMIC ))
arch/x86/kernel/ipi.c +2 -2
@@ -140,7 +140,7 @@ void send_IPI_mask_sequence(const struct cpumask *mask, int vector)local_irq_save (flags);for_each_cpu (query_cpu, mask) -__send_IPI_dest_field (cpu_to_logical_apicid (query_cpu), vector); +__send_IPI_dest_field (apic->cpu_to_logical_apicid (query_cpu), vector);local_irq_restore (flags); }
@@ -155,7 +155,7 @@ void send_IPI_mask_allbutself(const struct cpumask *mask, int vector)local_irq_save (flags);for_each_cpu (query_cpu, mask)if (query_cpu != this_cpu) -__send_IPI_dest_field (cpu_to_logical_apicid (query_cpu), +__send_IPI_dest_field (apic->cpu_to_logical_apicid (query_cpu), vector);local_irq_restore (flags); }
arch/x86/mach-generic/bigsmp.c +1 -1
@@ -81,7 +81,7 @@ struct genapic apic_bigsmp = { .setup_apic_routing = bigsmp_setup_apic_routing, .multi_timer_check = NULL, .apicid_to_node = bigsmp_apicid_to_node, - .cpu_to_logical_apicid = cpu_to_logical_apicid, + .cpu_to_logical_apicid = bigsmp_cpu_to_logical_apicid, .cpu_present_to_apicid = cpu_present_to_apicid, .apicid_to_cpu_present = apicid_to_cpu_present, .setup_portio_remap = setup_portio_remap,
arch/x86/mach-generic/default.c +1 -1
@@ -62,7 +62,7 @@ struct genapic apic_default = { .setup_apic_routing = default_setup_apic_routing, .multi_timer_check = NULL, .apicid_to_node = default_apicid_to_node, - .cpu_to_logical_apicid = cpu_to_logical_apicid, + .cpu_to_logical_apicid = default_cpu_to_logical_apicid, .cpu_present_to_apicid = cpu_present_to_apicid, .apicid_to_cpu_present = apicid_to_cpu_present, .setup_portio_remap = setup_portio_remap,
arch/x86/mach-generic/es7000.c +1 -1
@@ -123,7 +123,7 @@ struct genapic apic_es7000 = { .setup_apic_routing = es7000_setup_apic_routing, .multi_timer_check = NULL, .apicid_to_node = es7000_apicid_to_node, - .cpu_to_logical_apicid = cpu_to_logical_apicid, + .cpu_to_logical_apicid = es7000_cpu_to_logical_apicid, .cpu_present_to_apicid = cpu_present_to_apicid, .apicid_to_cpu_present = apicid_to_cpu_present, .setup_portio_remap = setup_portio_remap,
arch/x86/mach-generic/numaq.c +1 -1
@@ -68,7 +68,7 @@ struct genapic apic_numaq = { .setup_apic_routing = numaq_setup_apic_routing, .multi_timer_check = numaq_multi_timer_check, .apicid_to_node = numaq_apicid_to_node, - .cpu_to_logical_apicid = cpu_to_logical_apicid, + .cpu_to_logical_apicid = numaq_cpu_to_logical_apicid, .cpu_present_to_apicid = cpu_present_to_apicid, .apicid_to_cpu_present = apicid_to_cpu_present, .setup_portio_remap = setup_portio_remap,
arch/x86/mach-generic/summit.c +1 -1
@@ -61,7 +61,7 @@ struct genapic apic_summit = { .setup_apic_routing = summit_setup_apic_routing, .multi_timer_check = NULL, .apicid_to_node = summit_apicid_to_node, - .cpu_to_logical_apicid = cpu_to_logical_apicid, + .cpu_to_logical_apicid = summit_cpu_to_logical_apicid, .cpu_present_to_apicid = cpu_present_to_apicid, .apicid_to_cpu_present = apicid_to_cpu_present, .setup_portio_remap = setup_portio_remap,
Signature · 1 line
1.6.0.2
PATCH 44/114 x86, apic: clean up ->cpu_present_to_apicid()
In reply to Ingo Molnar- separate the namespace
- remove macros
--- arch/x86/include/asm/bigsmp/apic.h | 2 +- arch/x86/include/asm/es7000/apic.h | 2 +- arch/x86/include/asm/genapic.h | 2 ++ arch/x86/include/asm/mach-default/mach_apic.h | 11 ++++++++++- arch/x86/include/asm/mach-generic/mach_apic.h | 1 - arch/x86/include/asm/numaq/apic.h | 2 +- arch/x86/include/asm/summit/apic.h | 2 +- arch/x86/kernel/genapic_flat_64.c | 4 ++-- arch/x86/kernel/genx2apic_cluster.c | 2 +- arch/x86/kernel/genx2apic_phys.c | 2 +- arch/x86/kernel/genx2apic_uv_x.c | 2 +- arch/x86/kernel/smpboot.c | 9 ++++++++- arch/x86/mach-generic/bigsmp.c | 2 +- arch/x86/mach-generic/default.c | 2 +- arch/x86/mach-generic/es7000.c | 2 +- arch/x86/mach-generic/numaq.c | 2 +- arch/x86/mach-generic/summit.c | 2 +- 17 files changed, 34 insertions(+), 17 deletions(-)
arch/x86/include/asm/bigsmp/apic.h +1 -1
@@ -67,7 +67,7 @@ static inline int bigsmp_apicid_to_node(int logical_apicid)return apicid_2_node[hard_smp_processor_id ()]; } -static inline int cpu_present_to_apicid (int mps_cpu) +static inline int bigsmp_cpu_present_to_apicid (int mps_cpu) {if (mps_cpu < nr_cpu_ids)return (int )per_cpu (x86_bios_cpu_apicid, mps_cpu);
arch/x86/include/asm/es7000/apic.h +1 -1
@@ -88,7 +88,7 @@ static inline int es7000_apicid_to_node(int logical_apicid) } -static inline int cpu_present_to_apicid (int mps_cpu) +static inline int es7000_cpu_present_to_apicid (int mps_cpu) {if (!mps_cpu)return boot_cpu_physical_apicid;
arch/x86/include/asm/genapic.h +2 -0
@@ -108,6 +108,8 @@ extern struct genapic apic_x2apic_uv_x;DECLARE_PER_CPU (int, x2apic_extra_bits);extern void default_setup_apic_routing (void ); + +extern int default_cpu_present_to_apicid (int mps_cpu);#endif #endif /* _ASM_X86_GENAPIC_64_H */
arch/x86/include/asm/mach-default/mach_apic.h +10 -1
@@ -110,7 +110,7 @@ static inline int default_cpu_to_logical_apicid(int cpu)return 1 << cpu; } -static inline int cpu_present_to_apicid (int mps_cpu) +static inline int __default_cpu_present_to_apicid (int mps_cpu) {if (mps_cpu < nr_cpu_ids &&cpu_present (mps_cpu))return (int )per_cpu (x86_bios_cpu_apicid, mps_cpu);
@@ -118,6 +118,15 @@ static inline int cpu_present_to_apicid(int mps_cpu)return BAD_APICID ; } +#ifdef CONFIG_X86_32 +static inline int default_cpu_present_to_apicid (int mps_cpu) +{ +return __default_cpu_present_to_apicid (mps_cpu); +} +#else +extern int default_cpu_present_to_apicid (int mps_cpu); +#endif +static inline physid_mask_t apicid_to_cpu_present (int phys_apicid) {return physid_mask_of_physid (phys_apicid);
arch/x86/include/asm/mach-generic/mach_apic.h +0 -1
@@ -3,7 +3,6 @@#include <asm/genapic.h> -#define cpu_present_to_apicid (apic->cpu_present_to_apicid)#define apicid_to_cpu_present (apic->apicid_to_cpu_present)#define setup_portio_remap (apic->setup_portio_remap)#define check_phys_apicid_present (apic->check_phys_apicid_present)
arch/x86/include/asm/numaq/apic.h +1 -1
@@ -69,7 +69,7 @@ static inline int numaq_cpu_to_logical_apicid(int cpu)* cpu to APIC ID relation to properly interact with the intelligent * mode of the cluster controller. */ -static inline int cpu_present_to_apicid (int mps_cpu) +static inline int numaq_cpu_present_to_apicid (int mps_cpu) {if (mps_cpu <60 )return ((mps_cpu >>2 ) <<4 ) | (1 << (mps_cpu &0x3 ));
arch/x86/include/asm/summit/apic.h +1 -1
@@ -96,7 +96,7 @@ static inline int summit_cpu_to_logical_apicid(int cpu)#endif } -static inline int cpu_present_to_apicid (int mps_cpu) +static inline int summit_cpu_present_to_apicid (int mps_cpu) {if (mps_cpu < nr_cpu_ids)return (int )per_cpu (x86_bios_cpu_apicid, mps_cpu);
arch/x86/kernel/genapic_flat_64.c +2 -2
@@ -197,7 +197,7 @@ struct genapic apic_flat = { .multi_timer_check = NULL, .apicid_to_node = NULL, .cpu_to_logical_apicid = NULL, - .cpu_present_to_apicid = NULL, + .cpu_present_to_apicid = default_cpu_present_to_apicid, .apicid_to_cpu_present = NULL, .setup_portio_remap = NULL, .check_phys_apicid_present = NULL,
@@ -341,7 +341,7 @@ struct genapic apic_physflat = { .multi_timer_check = NULL, .apicid_to_node = NULL, .cpu_to_logical_apicid = NULL, - .cpu_present_to_apicid = NULL, + .cpu_present_to_apicid = default_cpu_present_to_apicid, .apicid_to_cpu_present = NULL, .setup_portio_remap = NULL, .check_phys_apicid_present = NULL,
arch/x86/kernel/genx2apic_cluster.c +1 -1
@@ -199,7 +199,7 @@ struct genapic apic_x2apic_cluster = { .multi_timer_check = NULL, .apicid_to_node = NULL, .cpu_to_logical_apicid = NULL, - .cpu_present_to_apicid = NULL, + .cpu_present_to_apicid = default_cpu_present_to_apicid, .apicid_to_cpu_present = NULL, .setup_portio_remap = NULL, .check_phys_apicid_present = NULL,
arch/x86/kernel/genx2apic_phys.c +1 -1
@@ -195,7 +195,7 @@ struct genapic apic_x2apic_phys = { .multi_timer_check = NULL, .apicid_to_node = NULL, .cpu_to_logical_apicid = NULL, - .cpu_present_to_apicid = NULL, + .cpu_present_to_apicid = default_cpu_present_to_apicid, .apicid_to_cpu_present = NULL, .setup_portio_remap = NULL, .check_phys_apicid_present = NULL,
arch/x86/kernel/genx2apic_uv_x.c +1 -1
@@ -260,7 +260,7 @@ struct genapic apic_x2apic_uv_x = { .multi_timer_check = NULL, .apicid_to_node = NULL, .cpu_to_logical_apicid = NULL, - .cpu_present_to_apicid = NULL, + .cpu_present_to_apicid = default_cpu_present_to_apicid, .apicid_to_cpu_present = NULL, .setup_portio_remap = NULL, .check_phys_apicid_present = NULL,
arch/x86/kernel/smpboot.c +8 -1
@@ -903,9 +903,16 @@ do_rest:return boot_error; } +#ifdef CONFIG_X86_64 +int default_cpu_present_to_apicid (int mps_cpu) +{ +return __default_cpu_present_to_apicid (mps_cpu); +} +#endif +int __cpuinit native_cpu_up (unsigned int cpu) { -int apicid =cpu_present_to_apicid (cpu); +int apicid = apic->cpu_present_to_apicid (cpu);unsigned long flags;int err;
arch/x86/mach-generic/bigsmp.c +1 -1
@@ -82,7 +82,7 @@ struct genapic apic_bigsmp = { .multi_timer_check = NULL, .apicid_to_node = bigsmp_apicid_to_node, .cpu_to_logical_apicid = bigsmp_cpu_to_logical_apicid, - .cpu_present_to_apicid = cpu_present_to_apicid, + .cpu_present_to_apicid = bigsmp_cpu_present_to_apicid, .apicid_to_cpu_present = apicid_to_cpu_present, .setup_portio_remap = setup_portio_remap, .check_phys_apicid_present = check_phys_apicid_present,
arch/x86/mach-generic/default.c +1 -1
@@ -63,7 +63,7 @@ struct genapic apic_default = { .multi_timer_check = NULL, .apicid_to_node = default_apicid_to_node, .cpu_to_logical_apicid = default_cpu_to_logical_apicid, - .cpu_present_to_apicid = cpu_present_to_apicid, + .cpu_present_to_apicid = default_cpu_present_to_apicid, .apicid_to_cpu_present = apicid_to_cpu_present, .setup_portio_remap = setup_portio_remap, .check_phys_apicid_present = check_phys_apicid_present,
arch/x86/mach-generic/es7000.c +1 -1
@@ -124,7 +124,7 @@ struct genapic apic_es7000 = { .multi_timer_check = NULL, .apicid_to_node = es7000_apicid_to_node, .cpu_to_logical_apicid = es7000_cpu_to_logical_apicid, - .cpu_present_to_apicid = cpu_present_to_apicid, + .cpu_present_to_apicid = es7000_cpu_present_to_apicid, .apicid_to_cpu_present = apicid_to_cpu_present, .setup_portio_remap = setup_portio_remap, .check_phys_apicid_present = check_phys_apicid_present,
arch/x86/mach-generic/numaq.c +1 -1
@@ -69,7 +69,7 @@ struct genapic apic_numaq = { .multi_timer_check = numaq_multi_timer_check, .apicid_to_node = numaq_apicid_to_node, .cpu_to_logical_apicid = numaq_cpu_to_logical_apicid, - .cpu_present_to_apicid = cpu_present_to_apicid, + .cpu_present_to_apicid = numaq_cpu_present_to_apicid, .apicid_to_cpu_present = apicid_to_cpu_present, .setup_portio_remap = setup_portio_remap, .check_phys_apicid_present = check_phys_apicid_present,
arch/x86/mach-generic/summit.c +1 -1
@@ -62,7 +62,7 @@ struct genapic apic_summit = { .multi_timer_check = NULL, .apicid_to_node = summit_apicid_to_node, .cpu_to_logical_apicid = summit_cpu_to_logical_apicid, - .cpu_present_to_apicid = cpu_present_to_apicid, + .cpu_present_to_apicid = summit_cpu_present_to_apicid, .apicid_to_cpu_present = apicid_to_cpu_present, .setup_portio_remap = setup_portio_remap, .check_phys_apicid_present = check_phys_apicid_present,
Signature · 1 line
1.6.0.2
PATCH 45/114 x86, apic: clean up ->apicid_to_cpu_present()
In reply to Ingo Molnar- separate the namespace
- remove macros
--- arch/x86/include/asm/bigsmp/apic.h | 2 +- arch/x86/include/asm/es7000/apic.h | 2 +- arch/x86/include/asm/mach-default/mach_apic.h | 2 +- arch/x86/include/asm/mach-generic/mach_apic.h | 1 - arch/x86/include/asm/numaq/apic.h | 2 +- arch/x86/include/asm/summit/apic.h | 4 ++-- arch/x86/kernel/io_apic.c | 4 ++-- arch/x86/kernel/visws_quirks.c | 2 +- arch/x86/mach-generic/bigsmp.c | 2 +- arch/x86/mach-generic/default.c | 2 +- arch/x86/mach-generic/es7000.c | 2 +- arch/x86/mach-generic/numaq.c | 2 +- arch/x86/mach-generic/summit.c | 2 +- 13 files changed, 14 insertions(+), 15 deletions(-)
arch/x86/include/asm/bigsmp/apic.h +1 -1
@@ -75,7 +75,7 @@ static inline int bigsmp_cpu_present_to_apicid(int mps_cpu)return BAD_APICID ; } -static inline physid_mask_t apicid_to_cpu_present (int phys_apicid) +static inline physid_mask_t bigsmp_apicid_to_cpu_present (int phys_apicid) {return physid_mask_of_physid (phys_apicid); }
arch/x86/include/asm/es7000/apic.h +1 -1
@@ -98,7 +98,7 @@ static inline int es7000_cpu_present_to_apicid(int mps_cpu)return BAD_APICID ; } -static inline physid_mask_t apicid_to_cpu_present (int phys_apicid) +static inline physid_mask_t es7000_apicid_to_cpu_present (int phys_apicid) {static int id =0 ;physid_mask_t mask;
arch/x86/include/asm/mach-default/mach_apic.h +1 -1
@@ -127,7 +127,7 @@ static inline int default_cpu_present_to_apicid(int mps_cpu)extern int default_cpu_present_to_apicid (int mps_cpu);#endif -static inline physid_mask_t apicid_to_cpu_present (int phys_apicid) +static inline physid_mask_t default_apicid_to_cpu_present (int phys_apicid) {return physid_mask_of_physid (phys_apicid); }
arch/x86/include/asm/mach-generic/mach_apic.h +0 -1
@@ -3,7 +3,6 @@#include <asm/genapic.h> -#define apicid_to_cpu_present (apic->apicid_to_cpu_present)#define setup_portio_remap (apic->setup_portio_remap)#define check_phys_apicid_present (apic->check_phys_apicid_present)#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)
arch/x86/include/asm/numaq/apic.h +1 -1
@@ -82,7 +82,7 @@ static inline int numaq_apicid_to_node(int logical_apicid)return logical_apicid >>4 ; } -static inline physid_mask_t apicid_to_cpu_present (int logical_apicid) +static inline physid_mask_t numaq_apicid_to_cpu_present (int logical_apicid) {int node =numaq_apicid_to_node (logical_apicid);int cpu =__ffs (logical_apicid &0xf );
arch/x86/include/asm/summit/apic.h +2 -2
@@ -105,13 +105,13 @@ static inline int summit_cpu_present_to_apicid(int mps_cpu) }static inline physid_mask_t -summit_ioapic_phys_id_map (physid_mask_t phys_id_map) +summit_ioapic_phys_id_map (physid_mask_t phys_id_map) {/* For clustered we don't have a good way to do this yet - hack */ return physids_promote (0x0F ); } -static inline physid_mask_t apicid_to_cpu_present (int apicid) +static inline physid_mask_t summit_apicid_to_cpu_present (int apicid) {return physid_mask_of_physid (0 ); }
arch/x86/kernel/io_apic.c +2 -2
@@ -2155,7 +2155,7 @@ static void __init setup_ioapic_ids_from_mpc(void) mp_ioapics[apic_id].apicid = i; }else {physid_mask_t tmp; - tmp =apicid_to_cpu_present (mp_ioapics[apic_id].apicid); + tmp = apic->apicid_to_cpu_present (mp_ioapics[apic_id].apicid);apic_printk (APIC_VERBOSE ,"Setting %d in the " "phys_id_present_map\n" , mp_ioapics[apic_id].apicid);
@@ -3899,7 +3899,7 @@ int __init io_apic_get_unique_id(int ioapic, int apic_id) apic_id = i; } - tmp =apicid_to_cpu_present (apic_id); + tmp = apic->apicid_to_cpu_present (apic_id);physids_or (apic_id_map, apic_id_map, tmp);if (reg_00.bits.ID != apic_id) {
arch/x86/kernel/visws_quirks.c +1 -1
@@ -200,7 +200,7 @@ static void __init MP_processor_info(struct mpc_cpu *m)return ; } - apic_cpus =apicid_to_cpu_present (m->apicid); + apic_cpus = apic->apicid_to_cpu_present (m->apicid);physids_or (phys_cpu_present_map, phys_cpu_present_map, apic_cpus);/* * Validate version
arch/x86/mach-generic/bigsmp.c +1 -1
@@ -83,7 +83,7 @@ struct genapic apic_bigsmp = { .apicid_to_node = bigsmp_apicid_to_node, .cpu_to_logical_apicid = bigsmp_cpu_to_logical_apicid, .cpu_present_to_apicid = bigsmp_cpu_present_to_apicid, - .apicid_to_cpu_present = apicid_to_cpu_present, + .apicid_to_cpu_present = bigsmp_apicid_to_cpu_present, .setup_portio_remap = setup_portio_remap, .check_phys_apicid_present = check_phys_apicid_present, .enable_apic_mode = enable_apic_mode,
arch/x86/mach-generic/default.c +1 -1
@@ -64,7 +64,7 @@ struct genapic apic_default = { .apicid_to_node = default_apicid_to_node, .cpu_to_logical_apicid = default_cpu_to_logical_apicid, .cpu_present_to_apicid = default_cpu_present_to_apicid, - .apicid_to_cpu_present = apicid_to_cpu_present, + .apicid_to_cpu_present = default_apicid_to_cpu_present, .setup_portio_remap = setup_portio_remap, .check_phys_apicid_present = check_phys_apicid_present, .enable_apic_mode = enable_apic_mode,
arch/x86/mach-generic/es7000.c +1 -1
@@ -125,7 +125,7 @@ struct genapic apic_es7000 = { .apicid_to_node = es7000_apicid_to_node, .cpu_to_logical_apicid = es7000_cpu_to_logical_apicid, .cpu_present_to_apicid = es7000_cpu_present_to_apicid, - .apicid_to_cpu_present = apicid_to_cpu_present, + .apicid_to_cpu_present = es7000_apicid_to_cpu_present, .setup_portio_remap = setup_portio_remap, .check_phys_apicid_present = check_phys_apicid_present, .enable_apic_mode = enable_apic_mode,
arch/x86/mach-generic/numaq.c +1 -1
@@ -70,7 +70,7 @@ struct genapic apic_numaq = { .apicid_to_node = numaq_apicid_to_node, .cpu_to_logical_apicid = numaq_cpu_to_logical_apicid, .cpu_present_to_apicid = numaq_cpu_present_to_apicid, - .apicid_to_cpu_present = apicid_to_cpu_present, + .apicid_to_cpu_present = numaq_apicid_to_cpu_present, .setup_portio_remap = setup_portio_remap, .check_phys_apicid_present = check_phys_apicid_present, .enable_apic_mode = enable_apic_mode,
arch/x86/mach-generic/summit.c +1 -1
@@ -63,7 +63,7 @@ struct genapic apic_summit = { .apicid_to_node = summit_apicid_to_node, .cpu_to_logical_apicid = summit_cpu_to_logical_apicid, .cpu_present_to_apicid = summit_cpu_present_to_apicid, - .apicid_to_cpu_present = apicid_to_cpu_present, + .apicid_to_cpu_present = summit_apicid_to_cpu_present, .setup_portio_remap = setup_portio_remap, .check_phys_apicid_present = check_phys_apicid_present, .enable_apic_mode = enable_apic_mode,
Signature · 1 line
1.6.0.2
PATCH 46/114 x86: refactor ->setup_portio_remap() subarch methods
In reply to Ingo MolnarOnly NUMAQ has a real ->setup_portio_remap() method, the other subarchitectures define it but keep it empty.
So mark the vector as NULL, extend the generic code to handle NULL -setup_portio_remap() entries and remove all the empty handlers.
Also move the NUMAQ method from the header file into the
apic driver .c file.
--- arch/x86/include/asm/bigsmp/apic.h | 2 +- arch/x86/include/asm/es7000/apic.h | 4 ---- arch/x86/include/asm/mach-default/mach_apic.h | 4 ---- arch/x86/include/asm/mach-generic/mach_apic.h | 1 - arch/x86/include/asm/numaq/apic.h | 13 ------------- arch/x86/include/asm/summit/apic.h | 2 +- arch/x86/kernel/smpboot.c | 3 ++- arch/x86/mach-generic/bigsmp.c | 2 +- arch/x86/mach-generic/default.c | 2 +- arch/x86/mach-generic/es7000.c | 2 +- arch/x86/mach-generic/numaq.c | 15 ++++++++++++++- arch/x86/mach-generic/summit.c | 2 +- 12 files changed, 22 insertions(+), 30 deletions(-)
arch/x86/include/asm/bigsmp/apic.h +1 -1
@@ -95,7 +95,7 @@ static inline physid_mask_t bigsmp_ioapic_phys_id_map(physid_mask_t phys_map)return physids_promote (0xFFL ); } -static inline void setup_portio_remap (void ) +static inline void bigsmp_setup_portio_remap (void ) { }
arch/x86/include/asm/es7000/apic.h +0 -4
@@ -127,10 +127,6 @@ static inline physid_mask_t es7000_ioapic_phys_id_map(physid_mask_t phys_map) } -static inline void setup_portio_remap (void ) -{ -} -extern unsigned int boot_cpu_physical_apicid;static inline int check_phys_apicid_present (int cpu_physical_apicid) {
arch/x86/include/asm/mach-default/mach_apic.h +0 -4
@@ -132,10 +132,6 @@ static inline physid_mask_t default_apicid_to_cpu_present(int phys_apicid)return physid_mask_of_physid (phys_apicid); } -static inline void setup_portio_remap (void ) -{ -} -static inline int check_phys_apicid_present (int boot_cpu_physical_apicid) {return physid_isset (boot_cpu_physical_apicid, phys_cpu_present_map);
arch/x86/include/asm/mach-generic/mach_apic.h +0 -1
@@ -3,7 +3,6 @@#include <asm/genapic.h> -#define setup_portio_remap (apic->setup_portio_remap)#define check_phys_apicid_present (apic->check_phys_apicid_present)#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)#define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and)
arch/x86/include/asm/numaq/apic.h +0 -13
@@ -92,19 +92,6 @@ static inline physid_mask_t numaq_apicid_to_cpu_present(int logical_apicid)extern void *xquad_portio; -static inline void setup_portio_remap (void ) -{ -int num_quads =num_online_nodes (); - -if (num_quads <=1 ) -return ; - -printk ("Remapping cross-quad port I/O for %d quads\n" , num_quads); - xquad_portio =ioremap (XQUAD_PORTIO_BASE , num_quads*XQUAD_PORTIO_QUAD ); -printk ("xquad_portio vaddr 0x%08lx, len %08lx\n" , - (u_long ) xquad_portio, (u_long ) num_quads*XQUAD_PORTIO_QUAD ); -} -static inline int check_phys_apicid_present (int boot_cpu_physical_apicid) {return (1 );
arch/x86/include/asm/summit/apic.h +1 -1
@@ -116,7 +116,7 @@ static inline physid_mask_t summit_apicid_to_cpu_present(int apicid)return physid_mask_of_physid (0 ); } -static inline void setup_portio_remap (void ) +static inline void summit_setup_portio_remap (void ) { }
arch/x86/kernel/smpboot.c +2 -1
@@ -1170,7 +1170,8 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)map_cpu_to_logical_apicid (); -setup_portio_remap (); +if (apic->setup_portio_remap) + apic->setup_portio_remap ();smpboot_setup_io_apic ();/*
arch/x86/mach-generic/bigsmp.c +1 -1
@@ -84,7 +84,7 @@ struct genapic apic_bigsmp = { .cpu_to_logical_apicid = bigsmp_cpu_to_logical_apicid, .cpu_present_to_apicid = bigsmp_cpu_present_to_apicid, .apicid_to_cpu_present = bigsmp_apicid_to_cpu_present, - .setup_portio_remap = setup_portio_remap, + .setup_portio_remap = NULL, .check_phys_apicid_present = check_phys_apicid_present, .enable_apic_mode = enable_apic_mode, .phys_pkg_id = phys_pkg_id,
arch/x86/mach-generic/default.c +1 -1
@@ -65,7 +65,7 @@ struct genapic apic_default = { .cpu_to_logical_apicid = default_cpu_to_logical_apicid, .cpu_present_to_apicid = default_cpu_present_to_apicid, .apicid_to_cpu_present = default_apicid_to_cpu_present, - .setup_portio_remap = setup_portio_remap, + .setup_portio_remap = NULL, .check_phys_apicid_present = check_phys_apicid_present, .enable_apic_mode = enable_apic_mode, .phys_pkg_id = phys_pkg_id,
arch/x86/mach-generic/es7000.c +1 -1
@@ -126,7 +126,7 @@ struct genapic apic_es7000 = { .cpu_to_logical_apicid = es7000_cpu_to_logical_apicid, .cpu_present_to_apicid = es7000_cpu_present_to_apicid, .apicid_to_cpu_present = es7000_apicid_to_cpu_present, - .setup_portio_remap = setup_portio_remap, + .setup_portio_remap = NULL, .check_phys_apicid_present = check_phys_apicid_present, .enable_apic_mode = enable_apic_mode, .phys_pkg_id = phys_pkg_id,
arch/x86/mach-generic/numaq.c +14 -1
@@ -44,6 +44,19 @@ static void numaq_vector_allocation_domain(int cpu, cpumask_t *retmask) *retmask = (cpumask_t ){ { [0 ] =APIC_ALL_CPUS , } }; } +static void numaq_setup_portio_remap (void ) +{ +int num_quads =num_online_nodes (); + +if (num_quads <=1 ) +return ; + +printk ("Remapping cross-quad port I/O for %d quads\n" , num_quads); + xquad_portio =ioremap (XQUAD_PORTIO_BASE , num_quads*XQUAD_PORTIO_QUAD ); +printk ("xquad_portio vaddr 0x%08lx, len %08lx\n" , + (u_long ) xquad_portio, (u_long ) num_quads*XQUAD_PORTIO_QUAD ); +} +struct genapic apic_numaq = { .name ="NUMAQ" ,
@@ -71,7 +84,7 @@ struct genapic apic_numaq = { .cpu_to_logical_apicid = numaq_cpu_to_logical_apicid, .cpu_present_to_apicid = numaq_cpu_present_to_apicid, .apicid_to_cpu_present = numaq_apicid_to_cpu_present, - .setup_portio_remap = setup_portio_remap, + .setup_portio_remap = numaq_setup_portio_remap, .check_phys_apicid_present = check_phys_apicid_present, .enable_apic_mode = enable_apic_mode, .phys_pkg_id = phys_pkg_id,
arch/x86/mach-generic/summit.c +1 -1
@@ -64,7 +64,7 @@ struct genapic apic_summit = { .cpu_to_logical_apicid = summit_cpu_to_logical_apicid, .cpu_present_to_apicid = summit_cpu_present_to_apicid, .apicid_to_cpu_present = summit_apicid_to_cpu_present, - .setup_portio_remap = setup_portio_remap, + .setup_portio_remap = NULL, .check_phys_apicid_present = check_phys_apicid_present, .enable_apic_mode = enable_apic_mode, .phys_pkg_id = phys_pkg_id,
Signature · 1 line
1.6.0.2
PATCH 47/114 x86: refactor ->check_phys_apicid_present() subarch methods
In reply to Ingo Molnar- spread out the namespace to per driver methods
- extend it to 64-bit as well so that we can use apic->check_phys_apicid_present() unconditionally
--- arch/x86/include/asm/bigsmp/apic.h | 6 +++--- arch/x86/include/asm/es7000/apic.h | 4 ++-- arch/x86/include/asm/genapic.h | 1 + arch/x86/include/asm/mach-default/mach_apic.h | 18 +++++++++++++----- arch/x86/include/asm/mach-generic/mach_apic.h | 1 - arch/x86/include/asm/numaq/apic.h | 4 ++-- arch/x86/include/asm/summit/apic.h | 2 +- arch/x86/kernel/genapic_flat_64.c | 4 ++-- arch/x86/kernel/genx2apic_cluster.c | 2 +- arch/x86/kernel/genx2apic_phys.c | 2 +- arch/x86/kernel/genx2apic_uv_x.c | 2 +- arch/x86/kernel/smpboot.c | 7 ++++++- arch/x86/mach-generic/bigsmp.c | 2 +- arch/x86/mach-generic/default.c | 2 +- arch/x86/mach-generic/es7000.c | 2 +- arch/x86/mach-generic/numaq.c | 2 +- arch/x86/mach-generic/summit.c | 2 +- 17 files changed, 38 insertions(+), 25 deletions(-)
arch/x86/include/asm/bigsmp/apic.h +3 -3
@@ -99,13 +99,13 @@ static inline void bigsmp_setup_portio_remap(void) { } -static inline void enable_apic_mode (void ) +static inline int bigsmp_check_phys_apicid_present (int boot_cpu_physical_apicid) { +return 1 ; } -static inline int check_phys_apicid_present (int boot_cpu_physical_apicid) +static inline void enable_apic_mode (void ) { -return (1 ); }/* As we are using single CPU as destination, pick only one CPU here */
arch/x86/include/asm/es7000/apic.h +2 -2
@@ -126,9 +126,9 @@ static inline physid_mask_t es7000_ioapic_phys_id_map(physid_mask_t phys_map)return physids_promote (0xff ); } -extern unsigned int boot_cpu_physical_apicid; -static inline int check_phys_apicid_present (int cpu_physical_apicid) + +static inline int es7000_check_phys_apicid_present (int cpu_physical_apicid) { boot_cpu_physical_apicid =read_apic_id ();return (1 );
arch/x86/include/asm/genapic.h +1 -0
@@ -110,6 +110,7 @@ DECLARE_PER_CPU(int, x2apic_extra_bits);extern void default_setup_apic_routing (void );extern int default_cpu_present_to_apicid (int mps_cpu); +extern int default_check_phys_apicid_present (int boot_cpu_physical_apicid);#endif #endif /* _ASM_X86_GENAPIC_64_H */
arch/x86/include/asm/mach-default/mach_apic.h +13 -5
@@ -118,13 +118,26 @@ static inline int __default_cpu_present_to_apicid(int mps_cpu)return BAD_APICID ; } +static inline int +__default_check_phys_apicid_present (int boot_cpu_physical_apicid) +{ +return physid_isset (boot_cpu_physical_apicid, phys_cpu_present_map); +} +#ifdef CONFIG_X86_32 static inline int default_cpu_present_to_apicid (int mps_cpu) {return __default_cpu_present_to_apicid (mps_cpu); } + +static inline int +default_check_phys_apicid_present (int boot_cpu_physical_apicid) +{ +return __default_check_phys_apicid_present (boot_cpu_physical_apicid); +}#else extern int default_cpu_present_to_apicid (int mps_cpu); +extern int default_check_phys_apicid_present (int boot_cpu_physical_apicid);#endif static inline physid_mask_t default_apicid_to_cpu_present (int phys_apicid)
@@ -132,11 +145,6 @@ static inline physid_mask_t default_apicid_to_cpu_present(int phys_apicid)return physid_mask_of_physid (phys_apicid); } -static inline int check_phys_apicid_present (int boot_cpu_physical_apicid) -{ -return physid_isset (boot_cpu_physical_apicid, phys_cpu_present_map); -} -static inline void enable_apic_mode (void ) { }
arch/x86/include/asm/mach-generic/mach_apic.h +0 -1
@@ -3,7 +3,6 @@#include <asm/genapic.h> -#define check_phys_apicid_present (apic->check_phys_apicid_present)#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)#define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and)#define enable_apic_mode (apic->enable_apic_mode)
arch/x86/include/asm/numaq/apic.h +2 -2
@@ -92,9 +92,9 @@ static inline physid_mask_t numaq_apicid_to_cpu_present(int logical_apicid)extern void *xquad_portio; -static inline int check_phys_apicid_present (int boot_cpu_physical_apicid) +static inline int numaq_check_phys_apicid_present (int boot_cpu_physical_apicid) { -return (1 ); +return 1 ; }static inline void enable_apic_mode (void )
arch/x86/include/asm/summit/apic.h +1 -1
@@ -120,7 +120,7 @@ static inline void summit_setup_portio_remap(void) { } -static inline int check_phys_apicid_present (int boot_cpu_physical_apicid) +static inline int summit_check_phys_apicid_present (int boot_cpu_physical_apicid) {return 1 ; }
arch/x86/kernel/genapic_flat_64.c +2 -2
@@ -200,7 +200,7 @@ struct genapic apic_flat = { .cpu_present_to_apicid = default_cpu_present_to_apicid, .apicid_to_cpu_present = NULL, .setup_portio_remap = NULL, - .check_phys_apicid_present = NULL, + .check_phys_apicid_present = default_check_phys_apicid_present, .enable_apic_mode = NULL, .phys_pkg_id = phys_pkg_id, .mps_oem_check = NULL,
@@ -344,7 +344,7 @@ struct genapic apic_physflat = { .cpu_present_to_apicid = default_cpu_present_to_apicid, .apicid_to_cpu_present = NULL, .setup_portio_remap = NULL, - .check_phys_apicid_present = NULL, + .check_phys_apicid_present = default_check_phys_apicid_present, .enable_apic_mode = NULL, .phys_pkg_id = phys_pkg_id, .mps_oem_check = NULL,
arch/x86/kernel/genx2apic_cluster.c +1 -1
@@ -202,7 +202,7 @@ struct genapic apic_x2apic_cluster = { .cpu_present_to_apicid = default_cpu_present_to_apicid, .apicid_to_cpu_present = NULL, .setup_portio_remap = NULL, - .check_phys_apicid_present = NULL, + .check_phys_apicid_present = default_check_phys_apicid_present, .enable_apic_mode = NULL, .phys_pkg_id = phys_pkg_id, .mps_oem_check = NULL,
arch/x86/kernel/genx2apic_phys.c +1 -1
@@ -198,7 +198,7 @@ struct genapic apic_x2apic_phys = { .cpu_present_to_apicid = default_cpu_present_to_apicid, .apicid_to_cpu_present = NULL, .setup_portio_remap = NULL, - .check_phys_apicid_present = NULL, + .check_phys_apicid_present = default_check_phys_apicid_present, .enable_apic_mode = NULL, .phys_pkg_id = phys_pkg_id, .mps_oem_check = NULL,
arch/x86/kernel/genx2apic_uv_x.c +1 -1
@@ -263,7 +263,7 @@ struct genapic apic_x2apic_uv_x = { .cpu_present_to_apicid = default_cpu_present_to_apicid, .apicid_to_cpu_present = NULL, .setup_portio_remap = NULL, - .check_phys_apicid_present = NULL, + .check_phys_apicid_present = default_check_phys_apicid_present, .enable_apic_mode = NULL, .phys_pkg_id = phys_pkg_id, .mps_oem_check = NULL,
arch/x86/kernel/smpboot.c +6 -1
@@ -908,6 +908,11 @@ int default_cpu_present_to_apicid(int mps_cpu) {return __default_cpu_present_to_apicid (mps_cpu); } + +int default_check_phys_apicid_present (int boot_cpu_physical_apicid) +{ +return __default_check_phys_apicid_present (boot_cpu_physical_apicid); +}#endif int __cpuinit native_cpu_up (unsigned int cpu)
@@ -1058,7 +1063,7 @@ static int __init smp_sanity_check(unsigned max_cpus)* Should not be necessary because the MP table should list the boot * CPU too, but we do it for the sake of robustness anyway. */ -if (!check_phys_apicid_present (boot_cpu_physical_apicid)) { +if (!apic->check_phys_apicid_present (boot_cpu_physical_apicid)) {printk (KERN_NOTICE "weird, boot CPU (#%d) not listed by the BIOS.\n" , boot_cpu_physical_apicid);
arch/x86/mach-generic/bigsmp.c +1 -1
@@ -85,7 +85,7 @@ struct genapic apic_bigsmp = { .cpu_present_to_apicid = bigsmp_cpu_present_to_apicid, .apicid_to_cpu_present = bigsmp_apicid_to_cpu_present, .setup_portio_remap = NULL, - .check_phys_apicid_present = check_phys_apicid_present, + .check_phys_apicid_present = bigsmp_check_phys_apicid_present, .enable_apic_mode = enable_apic_mode, .phys_pkg_id = phys_pkg_id, .mps_oem_check = mps_oem_check,
arch/x86/mach-generic/default.c +1 -1
@@ -66,7 +66,7 @@ struct genapic apic_default = { .cpu_present_to_apicid = default_cpu_present_to_apicid, .apicid_to_cpu_present = default_apicid_to_cpu_present, .setup_portio_remap = NULL, - .check_phys_apicid_present = check_phys_apicid_present, + .check_phys_apicid_present = default_check_phys_apicid_present, .enable_apic_mode = enable_apic_mode, .phys_pkg_id = phys_pkg_id, .mps_oem_check = mps_oem_check,
arch/x86/mach-generic/es7000.c +1 -1
@@ -127,7 +127,7 @@ struct genapic apic_es7000 = { .cpu_present_to_apicid = es7000_cpu_present_to_apicid, .apicid_to_cpu_present = es7000_apicid_to_cpu_present, .setup_portio_remap = NULL, - .check_phys_apicid_present = check_phys_apicid_present, + .check_phys_apicid_present = es7000_check_phys_apicid_present, .enable_apic_mode = enable_apic_mode, .phys_pkg_id = phys_pkg_id, .mps_oem_check = mps_oem_check,
arch/x86/mach-generic/numaq.c +1 -1
@@ -85,7 +85,7 @@ struct genapic apic_numaq = { .cpu_present_to_apicid = numaq_cpu_present_to_apicid, .apicid_to_cpu_present = numaq_apicid_to_cpu_present, .setup_portio_remap = numaq_setup_portio_remap, - .check_phys_apicid_present = check_phys_apicid_present, + .check_phys_apicid_present = numaq_check_phys_apicid_present, .enable_apic_mode = enable_apic_mode, .phys_pkg_id = phys_pkg_id, .mps_oem_check = mps_oem_check,
arch/x86/mach-generic/summit.c +1 -1
@@ -65,7 +65,7 @@ struct genapic apic_summit = { .cpu_present_to_apicid = summit_cpu_present_to_apicid, .apicid_to_cpu_present = summit_apicid_to_cpu_present, .setup_portio_remap = NULL, - .check_phys_apicid_present = check_phys_apicid_present, + .check_phys_apicid_present = summit_check_phys_apicid_present, .enable_apic_mode = enable_apic_mode, .phys_pkg_id = phys_pkg_id, .mps_oem_check = mps_oem_check,
Signature · 1 line
1.6.0.2
PATCH 48/114 x86: refactor ->enable_apic_mode() subarch methods
In reply to Ingo MolnarOnly ES7000 has a real ->enable_apic_mode() method, the other subarchitectures define it but keep it empty.
So mark the vector as NULL, extend the generic code to handle NULL -setup_portio_remap() entries and remove all the empty handlers.
--- arch/x86/include/asm/bigsmp/apic.h | 4 ---- arch/x86/include/asm/mach-default/mach_apic.h | 3 --- arch/x86/include/asm/mach-generic/mach_apic.h | 1 - arch/x86/include/asm/numaq/apic.h | 4 ---- arch/x86/include/asm/summit/apic.h | 4 ---- arch/x86/kernel/apic.c | 3 ++- arch/x86/mach-generic/bigsmp.c | 2 +- arch/x86/mach-generic/default.c | 2 +- arch/x86/mach-generic/es7000.c | 6 +++--- arch/x86/mach-generic/numaq.c | 2 +- arch/x86/mach-generic/summit.c | 2 +- 11 files changed, 9 insertions(+), 24 deletions(-)
arch/x86/include/asm/bigsmp/apic.h +0 -4
@@ -104,10 +104,6 @@ static inline int bigsmp_check_phys_apicid_present(int boot_cpu_physical_apicid)return 1 ; } -static inline void enable_apic_mode (void ) -{ -} -/* As we are using single CPU as destination, pick only one CPU here */ static inline unsigned int cpu_mask_to_apicid (const cpumask_t *cpumask) {
arch/x86/include/asm/mach-default/mach_apic.h +0 -3
@@ -145,8 +145,5 @@ static inline physid_mask_t default_apicid_to_cpu_present(int phys_apicid)return physid_mask_of_physid (phys_apicid); } -static inline void enable_apic_mode (void ) -{ -}#endif /* CONFIG_X86_LOCAL_APIC */ #endif /* _ASM_X86_MACH_DEFAULT_MACH_APIC_H */
arch/x86/include/asm/mach-generic/mach_apic.h +0 -1
@@ -5,7 +5,6 @@#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)#define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and) -#define enable_apic_mode (apic->enable_apic_mode)#define phys_pkg_id (apic->phys_pkg_id)#define wakeup_secondary_cpu (apic->wakeup_cpu)
arch/x86/include/asm/numaq/apic.h +0 -4
@@ -97,10 +97,6 @@ static inline int numaq_check_phys_apicid_present(int boot_cpu_physical_apicid)return 1 ; } -static inline void enable_apic_mode (void ) -{ -} -/* * We use physical apicids here, not logical, so just return the default * physical broadcast to stop people from breaking us
arch/x86/include/asm/summit/apic.h +0 -4
@@ -125,10 +125,6 @@ static inline int summit_check_phys_apicid_present(int boot_cpu_physical_apicid)return 1 ; } -static inline void enable_apic_mode (void ) -{ -} -static inline unsigned int cpu_mask_to_apicid (const cpumask_t *cpumask) {int num_bits_set;
arch/x86/kernel/apic.c +2 -1
@@ -1763,7 +1763,8 @@ void __init connect_bsp_APIC(void) outb(0x01, 0x23); }#endif -enable_apic_mode (); +if (apic->enable_apic_mode) + apic->enable_apic_mode (); }/**
arch/x86/mach-generic/bigsmp.c +1 -1
@@ -86,7 +86,7 @@ struct genapic apic_bigsmp = { .apicid_to_cpu_present = bigsmp_apicid_to_cpu_present, .setup_portio_remap = NULL, .check_phys_apicid_present = bigsmp_check_phys_apicid_present, - .enable_apic_mode = enable_apic_mode, + .enable_apic_mode = NULL, .phys_pkg_id = phys_pkg_id, .mps_oem_check = mps_oem_check,
arch/x86/mach-generic/default.c +1 -1
@@ -67,7 +67,7 @@ struct genapic apic_default = { .apicid_to_cpu_present = default_apicid_to_cpu_present, .setup_portio_remap = NULL, .check_phys_apicid_present = default_check_phys_apicid_present, - .enable_apic_mode = enable_apic_mode, + .enable_apic_mode = NULL, .phys_pkg_id = phys_pkg_id, .mps_oem_check = mps_oem_check,
arch/x86/mach-generic/es7000.c +3 -3
@@ -36,10 +36,10 @@ static int probe_es7000(void) }extern void es7000_sw_apic (void ); -static void __init enable_apic_mode (void ) + +static void __init es7000_enable_apic_mode (void ) {es7000_sw_apic (); -return ; } static __init int
@@ -128,7 +128,7 @@ struct genapic apic_es7000 = { .apicid_to_cpu_present = es7000_apicid_to_cpu_present, .setup_portio_remap = NULL, .check_phys_apicid_present = es7000_check_phys_apicid_present, - .enable_apic_mode = enable_apic_mode, + .enable_apic_mode = es7000_enable_apic_mode, .phys_pkg_id = phys_pkg_id, .mps_oem_check = mps_oem_check,
arch/x86/mach-generic/numaq.c +1 -1
@@ -86,7 +86,7 @@ struct genapic apic_numaq = { .apicid_to_cpu_present = numaq_apicid_to_cpu_present, .setup_portio_remap = numaq_setup_portio_remap, .check_phys_apicid_present = numaq_check_phys_apicid_present, - .enable_apic_mode = enable_apic_mode, + .enable_apic_mode = NULL, .phys_pkg_id = phys_pkg_id, .mps_oem_check = mps_oem_check,
arch/x86/mach-generic/summit.c +1 -1
@@ -66,7 +66,7 @@ struct genapic apic_summit = { .apicid_to_cpu_present = summit_apicid_to_cpu_present, .setup_portio_remap = NULL, .check_phys_apicid_present = summit_check_phys_apicid_present, - .enable_apic_mode = enable_apic_mode, + .enable_apic_mode = NULL, .phys_pkg_id = phys_pkg_id, .mps_oem_check = mps_oem_check,
Signature · 1 line
1.6.0.2
PATCH 49/114 x86, es7000: clean up es7000_enable_apic_mode()
In reply to Ingo Molnar- eliminate the needless es7000_enable_apic_mode() complication which was not apparent prior the namespace cleanups
- clean up the control flow in es7000_enable_apic_mode()
- other cleanups
--- arch/x86/include/asm/es7000/apic.h | 2 ++ arch/x86/kernel/es7000_32.c | 27 ++++++++++++++------------- arch/x86/mach-generic/es7000.c | 7 ------- 3 files changed, 16 insertions(+), 20 deletions(-)
arch/x86/include/asm/es7000/apic.h +2 -0
@@ -36,6 +36,8 @@ static inline unsigned long es7000_check_apicid_present(int bit)return physid_isset (bit, phys_cpu_present_map); } +extern void es7000_enable_apic_mode (void ); +#define apicid_cluster (apicid) (apicid & 0xF0)static inline unsigned long calculate_ldr (int cpu)
arch/x86/kernel/es7000_32.c +14 -13
@@ -359,20 +359,21 @@ es7000_mip_write(struct mip_reg *mip_reg)return status; } -void __init -es7000_sw_apic (void ) +void __init es7000_enable_apic_mode (void ) { -if (es7000_plat) { -int mip_status; -struct mip_reg es7000_mip_reg; - -printk ("ES7000: Enabling APIC mode.\n" ); -memset (&es7000_mip_reg,0 ,sizeof (struct mip_reg )); - es7000_mip_reg.off_0 =MIP_SW_APIC ; - es7000_mip_reg.off_38 = (MIP_VALID ); -while ((mip_status =es7000_mip_write (&es7000_mip_reg)) !=0 ) -printk ("es7000_sw_apic: command failed, status = %x\n" , - mip_status); +struct mip_reg es7000_mip_reg; +int mip_status; + +if (!es7000_plat)return ; + +printk ("ES7000: Enabling APIC mode.\n" ); +memset (&es7000_mip_reg,0 ,sizeof (struct mip_reg )); + es7000_mip_reg.off_0 =MIP_SW_APIC ; + es7000_mip_reg.off_38 =MIP_VALID ; + +while ((mip_status =es7000_mip_write (&es7000_mip_reg)) !=0 ) { +printk ("es7000_enable_apic_mode: command failed, status = %x\n" , + mip_status); } }
arch/x86/mach-generic/es7000.c +0 -7
@@ -35,13 +35,6 @@ static int probe_es7000(void)return 0 ; } -extern void es7000_sw_apic (void ); - -static void __init es7000_enable_apic_mode (void ) -{ -es7000_sw_apic (); -} -static __init int mps_oem_check (struct mpc_table *mpc,char *oem,char *productid) {
Signature · 1 line
1.6.0.2
PATCH 50/114 x86, apic: unify phys_pkg_id()
In reply to Ingo Molnar- unify the call signature of 64-bit to that of 32-bit
- clean up the types all around
- clean up namespace contamination
--- arch/x86/include/asm/bigsmp/apic.h | 2 +- arch/x86/include/asm/es7000/apic.h | 2 +- arch/x86/include/asm/genapic.h | 6 +----- arch/x86/include/asm/mach-default/mach_apic.h | 2 +- arch/x86/include/asm/numaq/apic.h | 2 +- arch/x86/include/asm/summit/apic.h | 5 +++-- arch/x86/kernel/cpu/addon_cpuid_features.c | 10 +--------- arch/x86/kernel/cpu/common.c | 11 +---------- arch/x86/kernel/genapic_flat_64.c | 6 +++--- arch/x86/kernel/genx2apic_cluster.c | 4 ++-- arch/x86/kernel/genx2apic_phys.c | 4 ++-- arch/x86/kernel/genx2apic_uv_x.c | 4 ++-- 12 files changed, 19 insertions(+), 39 deletions(-)
arch/x86/include/asm/bigsmp/apic.h +1 -1
@@ -133,7 +133,7 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask,return BAD_APICID ; } -static inline u32 phys_pkg_id (u32 cpuid_apic,int index_msb) +static inline int phys_pkg_id (int cpuid_apic,int index_msb) {return cpuid_apic >> index_msb; }
arch/x86/include/asm/es7000/apic.h +1 -1
@@ -221,7 +221,7 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *inmask,return apicid; } -static inline u32 phys_pkg_id (u32 cpuid_apic,int index_msb) +static inline int phys_pkg_id (int cpuid_apic,int index_msb) {return cpuid_apic >> index_msb; }
arch/x86/include/asm/genapic.h +1 -5
@@ -48,11 +48,7 @@ struct genapic {void (*setup_portio_remap)(void );int (*check_phys_apicid_present)(int boot_cpu_physical_apicid);void (*enable_apic_mode)(void ); -#ifdef CONFIG_X86_32 -u32 (*phys_pkg_id)(u32 cpuid_apic,int index_msb); -#else -unsigned int (*phys_pkg_id)(int index_msb); -#endif +int (*phys_pkg_id)(int cpuid_apic,int index_msb);/* * When one of the next two hooks returns 1 the genapic
arch/x86/include/asm/mach-default/mach_apic.h +1 -1
@@ -65,7 +65,7 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask,return (unsigned int )(mask1 & mask2 & mask3); } -static inline u32 phys_pkg_id (u32 cpuid_apic,int index_msb) +static inline int phys_pkg_id (int cpuid_apic,int index_msb) {return cpuid_apic >> index_msb; }
arch/x86/include/asm/numaq/apic.h +1 -1
@@ -113,7 +113,7 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask, }/* No NUMA-Q box has a HT CPU, but it can't hurt to use the default code. */ -static inline u32 phys_pkg_id (u32 cpuid_apic,int index_msb) +static inline int phys_pkg_id (int cpuid_apic,int index_msb) {return cpuid_apic >> index_msb; }
arch/x86/include/asm/summit/apic.h +3 -2
@@ -175,13 +175,14 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *inmask,return apicid; } -/* cpuid returns the value latched in the HW at reset, not the APIC ID +/* +* cpuid returns the value latched in the HW at reset, not the APIC ID * register's value. For any box whose BIOS changes APIC IDs, like * clustered APIC systems, we must use hard_smp_processor_id. * * See Intel's IA-32 SW Dev's Manual Vol2 under CPUID. */ -static inline u32 phys_pkg_id (u32 cpuid_apic,int index_msb) +static inline int phys_pkg_id (int cpuid_apic,int index_msb) {return hard_smp_processor_id () >> index_msb; }
arch/x86/kernel/cpu/addon_cpuid_features.c +1 -9
@@ -116,7 +116,6 @@ void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c) core_select_mask = (~(-1 << core_plus_mask_width)) >> ht_mask_width; -#ifdef CONFIG_X86_32 c->cpu_core_id =phys_pkg_id (c->initial_apicid, ht_mask_width) & core_select_mask; c->phys_proc_id =phys_pkg_id (c->initial_apicid, core_plus_mask_width);
@@ -124,14 +123,7 @@ void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c)* Reinit the apicid, now that we have extended initial_apicid. */ c->apicid =phys_pkg_id (c->initial_apicid,0 ); -#else - c->cpu_core_id =phys_pkg_id (ht_mask_width) & core_select_mask; - c->phys_proc_id =phys_pkg_id (core_plus_mask_width); -/* -* Reinit the apicid, now that we have extended initial_apicid. -*/ - c->apicid =phys_pkg_id (0 ); -#endif + c->x86_max_cores = (core_level_siblings / smp_num_siblings);
arch/x86/kernel/cpu/common.c +1 -10
@@ -442,11 +442,7 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c) } index_msb =get_count_order (smp_num_siblings); -#ifdef CONFIG_X86_64 - c->phys_proc_id =phys_pkg_id (index_msb); -#else c->phys_proc_id =phys_pkg_id (c->initial_apicid, index_msb); -#endif smp_num_siblings = smp_num_siblings / c->x86_max_cores;
@@ -454,13 +450,8 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c) core_bits =get_count_order (c->x86_max_cores); -#ifdef CONFIG_X86_64 - c->cpu_core_id =phys_pkg_id (index_msb) & - ((1 << core_bits) -1 ); -#else c->cpu_core_id =phys_pkg_id (c->initial_apicid, index_msb) & ((1 << core_bits) -1 ); -#endif } out:
@@ -742,7 +733,7 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c) this_cpu->c_identify (c);#ifdef CONFIG_X86_64 - c->apicid =phys_pkg_id (0 ); + c->apicid =phys_pkg_id (c->initial_apicid,0 );#endif /*
arch/x86/kernel/genapic_flat_64.c +3 -3
@@ -169,7 +169,7 @@ static unsigned int flat_cpu_mask_to_apicid_and(const struct cpumask *cpumask,return mask1 & mask2; } -static unsigned int phys_pkg_id (int index_msb) +static int flat_phys_pkg_id (int initial_apic_id,int index_msb) {return hard_smp_processor_id () >> index_msb; }
@@ -202,7 +202,7 @@ struct genapic apic_flat = { .setup_portio_remap = NULL, .check_phys_apicid_present = default_check_phys_apicid_present, .enable_apic_mode = NULL, - .phys_pkg_id = phys_pkg_id, + .phys_pkg_id = flat_phys_pkg_id, .mps_oem_check = NULL, .get_apic_id = get_apic_id,
@@ -346,7 +346,7 @@ struct genapic apic_physflat = { .setup_portio_remap = NULL, .check_phys_apicid_present = default_check_phys_apicid_present, .enable_apic_mode = NULL, - .phys_pkg_id = phys_pkg_id, + .phys_pkg_id = flat_phys_pkg_id, .mps_oem_check = NULL, .get_apic_id = get_apic_id,
arch/x86/kernel/genx2apic_cluster.c +2 -2
@@ -157,7 +157,7 @@ static unsigned long set_apic_id(unsigned int id)return x; } -static unsigned int phys_pkg_id (int index_msb) +static int x2apic_cluster_phys_pkg_id (int initial_apicid,int index_msb) {return current_cpu_data.initial_apicid >> index_msb; }
@@ -204,7 +204,7 @@ struct genapic apic_x2apic_cluster = { .setup_portio_remap = NULL, .check_phys_apicid_present = default_check_phys_apicid_present, .enable_apic_mode = NULL, - .phys_pkg_id = phys_pkg_id, + .phys_pkg_id = x2apic_cluster_phys_pkg_id, .mps_oem_check = NULL, .get_apic_id = get_apic_id,
arch/x86/kernel/genx2apic_phys.c +2 -2
@@ -156,7 +156,7 @@ static unsigned long set_apic_id(unsigned int id)return x; } -static unsigned int phys_pkg_id (int index_msb) +static int x2apic_phys_pkg_id (int initial_apicid,int index_msb) {return current_cpu_data.initial_apicid >> index_msb; }
@@ -200,7 +200,7 @@ struct genapic apic_x2apic_phys = { .setup_portio_remap = NULL, .check_phys_apicid_present = default_check_phys_apicid_present, .enable_apic_mode = NULL, - .phys_pkg_id = phys_pkg_id, + .phys_pkg_id = x2apic_phys_pkg_id, .mps_oem_check = NULL, .get_apic_id = get_apic_id,
arch/x86/kernel/genx2apic_uv_x.c +2 -2
@@ -226,7 +226,7 @@ static unsigned int uv_read_apic_id(void)return get_apic_id (apic_read (APIC_ID )); } -static unsigned int phys_pkg_id (int index_msb) +static int uv_phys_pkg_id (int initial_apicid,int index_msb) {return uv_read_apic_id () >> index_msb; }
@@ -265,7 +265,7 @@ struct genapic apic_x2apic_uv_x = { .setup_portio_remap = NULL, .check_phys_apicid_present = default_check_phys_apicid_present, .enable_apic_mode = NULL, - .phys_pkg_id = phys_pkg_id, + .phys_pkg_id = uv_phys_pkg_id, .mps_oem_check = NULL, .get_apic_id = get_apic_id,
Signature · 1 line
1.6.0.2
PATCH 51/114 x86, apic: refactor ->phys_pkg_id()
In reply to Ingo MolnarRefactor the ->phys_pkg_id() methods:
- namespace separation
- macro wrapper removal
- open-coded calls to the methods in the generic code
--- arch/x86/include/asm/bigsmp/apic.h | 2 +- arch/x86/include/asm/es7000/apic.h | 2 +- arch/x86/include/asm/mach-default/mach_apic.h | 3 +-- arch/x86/include/asm/mach-generic/mach_apic.h | 1 - arch/x86/include/asm/numaq/apic.h | 2 +- arch/x86/include/asm/summit/apic.h | 2 +- arch/x86/kernel/cpu/addon_cpuid_features.c | 6 +++--- arch/x86/kernel/cpu/common.c | 8 ++++---- arch/x86/mach-generic/bigsmp.c | 2 +- arch/x86/mach-generic/default.c | 2 +- arch/x86/mach-generic/es7000.c | 2 +- arch/x86/mach-generic/numaq.c | 2 +- arch/x86/mach-generic/summit.c | 2 +- 13 files changed, 17 insertions(+), 19 deletions(-)
arch/x86/include/asm/bigsmp/apic.h +1 -1
@@ -133,7 +133,7 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask,return BAD_APICID ; } -static inline int phys_pkg_id (int cpuid_apic,int index_msb) +static inline int bigsmp_phys_pkg_id (int cpuid_apic,int index_msb) {return cpuid_apic >> index_msb; }
arch/x86/include/asm/es7000/apic.h +1 -1
@@ -221,7 +221,7 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *inmask,return apicid; } -static inline int phys_pkg_id (int cpuid_apic,int index_msb) +static inline int es7000_phys_pkg_id (int cpuid_apic,int index_msb) {return cpuid_apic >> index_msb; }
arch/x86/include/asm/mach-default/mach_apic.h +1 -2
@@ -21,7 +21,6 @@ static inline const struct cpumask *default_target_cpus(void)#include <asm/genapic.h> #define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)#define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and) -#define phys_pkg_id (apic->phys_pkg_id)#define read_apic_id () (GET_APIC_ID(apic_read(APIC_ID)))#define send_IPI_self (apic->send_IPI_self)#define wakeup_secondary_cpu (apic->wakeup_cpu)
@@ -65,7 +64,7 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask,return (unsigned int )(mask1 & mask2 & mask3); } -static inline int phys_pkg_id (int cpuid_apic,int index_msb) +static inline int default_phys_pkg_id (int cpuid_apic,int index_msb) {return cpuid_apic >> index_msb; }
arch/x86/include/asm/mach-generic/mach_apic.h +0 -1
@@ -5,7 +5,6 @@#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)#define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and) -#define phys_pkg_id (apic->phys_pkg_id)#define wakeup_secondary_cpu (apic->wakeup_cpu)extern void generic_bigsmp_probe (void );
arch/x86/include/asm/numaq/apic.h +1 -1
@@ -113,7 +113,7 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask, }/* No NUMA-Q box has a HT CPU, but it can't hurt to use the default code. */ -static inline int phys_pkg_id (int cpuid_apic,int index_msb) +static inline int numaq_phys_pkg_id (int cpuid_apic,int index_msb) {return cpuid_apic >> index_msb; }
arch/x86/include/asm/summit/apic.h +1 -1
@@ -182,7 +182,7 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *inmask,* * See Intel's IA-32 SW Dev's Manual Vol2 under CPUID. */ -static inline int phys_pkg_id (int cpuid_apic,int index_msb) +static inline int summit_phys_pkg_id (int cpuid_apic,int index_msb) {return hard_smp_processor_id () >> index_msb; }
arch/x86/kernel/cpu/addon_cpuid_features.c +3 -3
@@ -116,13 +116,13 @@ void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c) core_select_mask = (~(-1 << core_plus_mask_width)) >> ht_mask_width; - c->cpu_core_id =phys_pkg_id (c->initial_apicid, ht_mask_width) + c->cpu_core_id = apic->phys_pkg_id (c->initial_apicid, ht_mask_width) & core_select_mask; - c->phys_proc_id =phys_pkg_id (c->initial_apicid, core_plus_mask_width); + c->phys_proc_id = apic->phys_pkg_id (c->initial_apicid, core_plus_mask_width);/* * Reinit the apicid, now that we have extended initial_apicid. */ - c->apicid =phys_pkg_id (c->initial_apicid,0 ); + c->apicid = apic->phys_pkg_id (c->initial_apicid,0 ); c->x86_max_cores = (core_level_siblings / smp_num_siblings);
arch/x86/kernel/cpu/common.c +4 -4
@@ -442,7 +442,7 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c) } index_msb =get_count_order (smp_num_siblings); - c->phys_proc_id =phys_pkg_id (c->initial_apicid, index_msb); + c->phys_proc_id = apic->phys_pkg_id (c->initial_apicid, index_msb); smp_num_siblings = smp_num_siblings / c->x86_max_cores;
@@ -450,7 +450,7 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c) core_bits =get_count_order (c->x86_max_cores); - c->cpu_core_id =phys_pkg_id (c->initial_apicid, index_msb) & + c->cpu_core_id = apic->phys_pkg_id (c->initial_apicid, index_msb) & ((1 << core_bits) -1 ); }
@@ -686,7 +686,7 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c) c->initial_apicid = (cpuid_ebx (1 ) >>24 ) &0xFF ;#ifdef CONFIG_X86_32 # ifdef CONFIG_X86_HT - c->apicid =phys_pkg_id (c->initial_apicid,0 ); + c->apicid = apic->phys_pkg_id (c->initial_apicid,0 );# else c->apicid = c->initial_apicid;# endif
@@ -733,7 +733,7 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c) this_cpu->c_identify (c);#ifdef CONFIG_X86_64 - c->apicid =phys_pkg_id (c->initial_apicid,0 ); + c->apicid = apic->phys_pkg_id (c->initial_apicid,0 );#endif /*
arch/x86/mach-generic/bigsmp.c +1 -1
@@ -87,7 +87,7 @@ struct genapic apic_bigsmp = { .setup_portio_remap = NULL, .check_phys_apicid_present = bigsmp_check_phys_apicid_present, .enable_apic_mode = NULL, - .phys_pkg_id = phys_pkg_id, + .phys_pkg_id = bigsmp_phys_pkg_id, .mps_oem_check = mps_oem_check, .get_apic_id = get_apic_id,
arch/x86/mach-generic/default.c +1 -1
@@ -68,7 +68,7 @@ struct genapic apic_default = { .setup_portio_remap = NULL, .check_phys_apicid_present = default_check_phys_apicid_present, .enable_apic_mode = NULL, - .phys_pkg_id = phys_pkg_id, + .phys_pkg_id = default_phys_pkg_id, .mps_oem_check = mps_oem_check, .get_apic_id = get_apic_id,
arch/x86/mach-generic/es7000.c +1 -1
@@ -122,7 +122,7 @@ struct genapic apic_es7000 = { .setup_portio_remap = NULL, .check_phys_apicid_present = es7000_check_phys_apicid_present, .enable_apic_mode = es7000_enable_apic_mode, - .phys_pkg_id = phys_pkg_id, + .phys_pkg_id = es7000_phys_pkg_id, .mps_oem_check = mps_oem_check, .get_apic_id = get_apic_id,
arch/x86/mach-generic/numaq.c +1 -1
@@ -87,7 +87,7 @@ struct genapic apic_numaq = { .setup_portio_remap = numaq_setup_portio_remap, .check_phys_apicid_present = numaq_check_phys_apicid_present, .enable_apic_mode = NULL, - .phys_pkg_id = phys_pkg_id, + .phys_pkg_id = numaq_phys_pkg_id, .mps_oem_check = mps_oem_check, .get_apic_id = get_apic_id,
arch/x86/mach-generic/summit.c +1 -1
@@ -67,7 +67,7 @@ struct genapic apic_summit = { .setup_portio_remap = NULL, .check_phys_apicid_present = summit_check_phys_apicid_present, .enable_apic_mode = NULL, - .phys_pkg_id = phys_pkg_id, + .phys_pkg_id = summit_phys_pkg_id, .mps_oem_check = mps_oem_check, .get_apic_id = get_apic_id,
Signature · 1 line
1.6.0.2
PATCH 52/114 x86, smp: clean up mps_oem_check()
In reply to Ingo MolnarImpact: cleanup
- allow NULL ->mps_oem_check() entries
- clean up the code flow
--- arch/x86/include/asm/genapic.h | 3 +-- arch/x86/mach-generic/probe.c | 22 +++++++++++++--------- 2 files changed, 14 insertions(+), 11 deletions(-)
arch/x86/include/asm/genapic.h +1 -2
@@ -55,8 +55,7 @@ struct genapic {* is switched to this. Essentially they are additional * probe functions: */ -int (*mps_oem_check)(struct mpc_table *mpc,char *oem, -char *productid); +int (*mps_oem_check)(struct mpc_table *mpc,char *oem,char *productid);unsigned int (*get_apic_id)(unsigned long x);unsigned long (*set_apic_id)(unsigned int id);
arch/x86/mach-generic/probe.c +13 -9
@@ -113,17 +113,21 @@ void __init generic_apic_probe(void)int __init mps_oem_check (struct mpc_table *mpc,char *oem,char *productid) {int i; +for (i =0 ; apic_probe[i]; ++i) { -if (apic_probe[i]->mps_oem_check (mpc, oem, productid)) { -if (!cmdline_apic) { - apic = apic_probe[i]; -if (x86_quirks->update_genapic) - x86_quirks->update_genapic (); -printk (KERN_INFO "Switched to APIC driver `%s'.\n" , - apic->name); - } -return 1 ; +if (!apic_probe[i]->mps_oem_check) +continue ; +if (!apic_probe[i]->mps_oem_check (mpc, oem, productid)) +continue ; + +if (!cmdline_apic) { + apic = apic_probe[i]; +if (x86_quirks->update_genapic) + x86_quirks->update_genapic (); +printk (KERN_INFO "Switched to APIC driver `%s'.\n" , + apic->name); } +return 1 ; }return 0 ; }
Signature · 1 line
1.6.0.2
PATCH 53/114 x86, mpparse: call the generic quirk handlers early
In reply to Ingo MolnarCall all the registered MPS quirk handlers early. These methods scan low RAM typically for specific signatures so are safe to be called early.
--- arch/x86/kernel/mpparse.c | 11 +---------- 1 files changed, 1 insertions(+), 10 deletions(-)
arch/x86/kernel/mpparse.c +1 -10
@@ -292,16 +292,7 @@ static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early)return 0 ;#ifdef CONFIG_X86_32 -/* -* need to make sure summit and es7000's mps_oem_check is safe to be -* called early via genericarch 's mps_oem_check -*/ -if (early) { -#ifdef CONFIG_X86_NUMAQ -numaq_mps_oem_check (mpc, oem, str); -#endif - }else -mps_oem_check (mpc, oem, str); +mps_oem_check (mpc, oem, str);#endif /* save the local APIC address, it might be non-default */ if (!acpi_lapic)
Signature · 1 line
1.6.0.2
PATCH 54/114 x86: consolidate the ->mps_oem_check() code
In reply to Ingo Molnar- spread out the mps_oem_check() namespace on a per APIC driver basis
--- arch/x86/include/asm/es7000/mpparse.h | 6 ------ arch/x86/include/asm/mach-default/mach_mpparse.h | 2 +- arch/x86/include/asm/mach-generic/mach_mpparse.h | 3 +-- arch/x86/include/asm/summit/mpparse.h | 4 ++-- arch/x86/kernel/mpparse.c | 2 +- arch/x86/mach-generic/bigsmp.c | 2 +- arch/x86/mach-generic/default.c | 2 +- arch/x86/mach-generic/es7000.c | 5 +++-- arch/x86/mach-generic/numaq.c | 4 ++-- arch/x86/mach-generic/probe.c | 3 ++- arch/x86/mach-generic/summit.c | 2 +- 11 files changed, 15 insertions(+), 20 deletions(-)
arch/x86/include/asm/es7000/mpparse.h +0 -6
@@ -8,13 +8,7 @@ extern int find_unisys_acpi_oem_table(unsigned long *oem_addr);extern void unmap_unisys_acpi_oem_table (unsigned long oem_addr);extern void setup_unisys (void ); -#ifndef CONFIG_X86_GENERICARCH -extern int default_acpi_madt_oem_check (char *oem_id,char *oem_table_id); -extern int mps_oem_check (struct mpc_table *mpc,char *oem,char *productid); -#endif -#ifdef CONFIG_ACPI -static inline int es7000_check_dsdt (void ) {struct acpi_table_header header;
arch/x86/include/asm/mach-default/mach_mpparse.h +1 -1
@@ -2,7 +2,7 @@#define _ASM_X86_MACH_DEFAULT_MACH_MPPARSE_Hstatic inline int -mps_oem_check (struct mpc_table *mpc,char *oem,char *productid) +generic_mps_oem_check (struct mpc_table *mpc,char *oem,char *productid) {return 0 ; }
arch/x86/include/asm/mach-generic/mach_mpparse.h +1 -2
@@ -1,8 +1,7 @@#ifndef _ASM_X86_MACH_GENERIC_MACH_MPPARSE_H#define _ASM_X86_MACH_GENERIC_MACH_MPPARSE_H - -extern int mps_oem_check (struct mpc_table *,char *,char *); +extern int generic_mps_oem_check (struct mpc_table *,char *,char *);extern int default_acpi_madt_oem_check (char *,char *);
arch/x86/include/asm/summit/mpparse.h +2 -2
@@ -11,8 +11,8 @@ extern void setup_summit(void);#define setup_summit () {}#endif -static inline int mps_oem_check (struct mpc_table *mpc,char *oem, -char *productid) +static inline int +summit_mps_oem_check (struct mpc_table *mpc,char *oem,char *productid) { if (!strncmp(oem, "IBM ENSW", 8) && (!strncmp(productid, "VIGIL SMP", 9)
arch/x86/kernel/mpparse.c +1 -1
@@ -292,7 +292,7 @@ static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early)return 0 ;#ifdef CONFIG_X86_32 -mps_oem_check (mpc, oem, str); +generic_mps_oem_check (mpc, oem, str);#endif /* save the local APIC address, it might be non-default */ if (!acpi_lapic)
arch/x86/mach-generic/bigsmp.c +1 -1
@@ -88,7 +88,7 @@ struct genapic apic_bigsmp = { .check_phys_apicid_present = bigsmp_check_phys_apicid_present, .enable_apic_mode = NULL, .phys_pkg_id = bigsmp_phys_pkg_id, - .mps_oem_check = mps_oem_check, + .mps_oem_check = NULL, .get_apic_id = get_apic_id, .set_apic_id = NULL,
arch/x86/mach-generic/default.c +1 -1
@@ -69,7 +69,7 @@ struct genapic apic_default = { .check_phys_apicid_present = default_check_phys_apicid_present, .enable_apic_mode = NULL, .phys_pkg_id = default_phys_pkg_id, - .mps_oem_check = mps_oem_check, + .mps_oem_check = NULL, .get_apic_id = get_apic_id, .set_apic_id = NULL,
arch/x86/mach-generic/es7000.c +3 -2
@@ -36,11 +36,12 @@ static int probe_es7000(void) }static __init int -mps_oem_check (struct mpc_table *mpc,char *oem,char *productid) +es7000_mps_oem_check (struct mpc_table *mpc,char *oem,char *productid) {if (mpc->oemptr) {struct mpc_oemtable *oem_table = (struct mpc_oemtable *)mpc->oemptr; +if (!strncmp (oem,"UNISYS" ,6 ))return parse_unisys_oem ((char *)oem_table); }
@@ -123,7 +124,7 @@ struct genapic apic_es7000 = { .check_phys_apicid_present = es7000_check_phys_apicid_present, .enable_apic_mode = es7000_enable_apic_mode, .phys_pkg_id = es7000_phys_pkg_id, - .mps_oem_check = mps_oem_check, + .mps_oem_check = es7000_mps_oem_check, .get_apic_id = get_apic_id, .set_apic_id = NULL,
arch/x86/mach-generic/numaq.c +2 -2
@@ -19,7 +19,7 @@#include <asm/numaq/wakecpu.h> #include <asm/numaq.h> -static int mps_oem_check (struct mpc_table *mpc,char *oem,char *productid) +static int __numaq_mps_oem_check (struct mpc_table *mpc,char *oem,char *productid) {numaq_mps_oem_check (mpc, oem, productid);return found_numaq;
@@ -88,7 +88,7 @@ struct genapic apic_numaq = { .check_phys_apicid_present = numaq_check_phys_apicid_present, .enable_apic_mode = NULL, .phys_pkg_id = numaq_phys_pkg_id, - .mps_oem_check = mps_oem_check, + .mps_oem_check = __numaq_mps_oem_check, .get_apic_id = get_apic_id, .set_apic_id = NULL,
arch/x86/mach-generic/probe.c +2 -1
@@ -110,7 +110,8 @@ void __init generic_apic_probe(void)/* These functions can switch the APIC even after the initial ->probe() */ -int __init mps_oem_check (struct mpc_table *mpc,char *oem,char *productid) +int __init +generic_mps_oem_check (struct mpc_table *mpc,char *oem,char *productid) {int i;
arch/x86/mach-generic/summit.c +1 -1
@@ -68,7 +68,7 @@ struct genapic apic_summit = { .check_phys_apicid_present = summit_check_phys_apicid_present, .enable_apic_mode = NULL, .phys_pkg_id = summit_phys_pkg_id, - .mps_oem_check = mps_oem_check, + .mps_oem_check = summit_mps_oem_check, .get_apic_id = get_apic_id, .set_apic_id = NULL,
Signature · 1 line
1.6.0.2
PATCH 55/114 x86, apic: refactor ->get_apic_id() & GET_APIC_ID()
In reply to Ingo Molnar- spread out the namespace on a per driver basis
- get rid of macro wrappers
- small cleanups
--- arch/x86/include/asm/bigsmp/apicdef.h | 6 ++---- arch/x86/include/asm/es7000/apicdef.h | 6 ++---- arch/x86/include/asm/mach-default/mach_apic.h | 2 +- arch/x86/include/asm/mach-default/mach_apicdef.h | 10 +++++----- arch/x86/include/asm/mach-generic/mach_apicdef.h | 1 - arch/x86/include/asm/numaq/apicdef.h | 7 ++----- arch/x86/include/asm/smp.h | 2 +- arch/x86/include/asm/summit/apicdef.h | 6 ++---- arch/x86/kernel/genapic_flat_64.c | 9 +++++---- arch/x86/kernel/genx2apic_cluster.c | 4 ++-- arch/x86/kernel/genx2apic_phys.c | 4 ++-- arch/x86/kernel/genx2apic_uv_x.c | 6 +++--- arch/x86/mach-generic/bigsmp.c | 2 +- arch/x86/mach-generic/default.c | 2 +- arch/x86/mach-generic/es7000.c | 2 +- arch/x86/mach-generic/numaq.c | 2 +- arch/x86/mach-generic/summit.c | 2 +- 17 files changed, 32 insertions(+), 41 deletions(-)
arch/x86/include/asm/bigsmp/apicdef.h +2 -4
@@ -3,11 +3,9 @@#define APIC_ID_MASK (0xFF<<24) -static inline unsigned get_apic_id (unsigned long x) +static inline unsigned bigsmp_get_apic_id (unsigned long x) { -return (((x)>>24 )&0xFF ); +return (x >>24 ) &0xFF ; } -#define GET_APIC_ID (x) get_apic_id(x) -#endif
arch/x86/include/asm/es7000/apicdef.h +2 -4
@@ -3,11 +3,9 @@#define APIC_ID_MASK (0xFF<<24) -static inline unsigned get_apic_id (unsigned long x) +static inline unsigned int es7000_get_apic_id (unsigned long x) { -return (((x)>>24 )&0xFF ); +return (x >>24 ) &0xFF ; } -#define GET_APIC_ID (x) get_apic_id(x) -#endif
arch/x86/include/asm/mach-default/mach_apic.h +1 -1
@@ -21,7 +21,7 @@ static inline const struct cpumask *default_target_cpus(void)#include <asm/genapic.h> #define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)#define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and) -#define read_apic_id () (GET_APIC_ID(apic_read(APIC_ID))) +#define read_apic_id () (apic->get_apic_id(apic_read(APIC_ID)))#define send_IPI_self (apic->send_IPI_self)#define wakeup_secondary_cpu (apic->wakeup_cpu)extern void default_setup_apic_routing (void );
arch/x86/include/asm/mach-default/mach_apicdef.h +5 -5
@@ -5,20 +5,20 @@#ifdef CONFIG_X86_64 #define APIC_ID_MASK (apic->apic_id_mask) -#define GET_APIC_ID (x) (apic->get_apic_id(x))#define SET_APIC_ID (x) (apic->set_apic_id(x))#else #define APIC_ID_MASK (0xF<<24) -static inline unsigned get_apic_id (unsigned long x) + +static inline unsigned default_get_apic_id (unsigned long x) {unsigned int ver =GET_APIC_VERSION (apic_read (APIC_LVR )); +if (APIC_XAPIC (ver)) -return (((x)>>24 )&0xFF ); +return (x >>24 ) &0xFF ;else -return (((x)>>24 )&0xF ); +return (x >>24 ) &0x0F ; } -#define GET_APIC_ID (x) get_apic_id(x)#endif #endif /* _ASM_X86_MACH_DEFAULT_MACH_APICDEF_H */
arch/x86/include/asm/mach-generic/mach_apicdef.h +0 -1
@@ -4,7 +4,6 @@#ifndef APIC_DEFINITION #include <asm/genapic.h> -#define GET_APIC_ID (apic->get_apic_id)#define APIC_ID_MASK (apic->apic_id_mask)#endif
arch/x86/include/asm/numaq/apicdef.h +2 -5
@@ -1,14 +1,11 @@#ifndef __ASM_NUMAQ_APICDEF_H#define __ASM_NUMAQ_APICDEF_H -#define APIC_ID_MASK (0xF<<24) -static inline unsigned get_apic_id (unsigned long x) +static inline unsigned int numaq_get_apic_id (unsigned long x) { -return (((x)>>24 )&0x0F ); +return (x >>24 ) &0x0F ; } -#define GET_APIC_ID (x) get_apic_id(x) -#endif
arch/x86/include/asm/smp.h +1 -1
@@ -189,7 +189,7 @@ static inline unsigned int read_apic_id(void) reg = *(u32 *)(APIC_BASE +APIC_ID ); - return GET_APIC_ID(reg); + return apic->get_apic_id(reg); }#endif
arch/x86/include/asm/summit/apicdef.h +2 -4
@@ -3,11 +3,9 @@#define APIC_ID_MASK (0xFF<<24) -static inline unsigned get_apic_id (unsigned long x) +static inline unsigned summit_get_apic_id (unsigned long x) { -return (x>>24 )&0xFF ; +return (x >>24 ) &0xFF ; } -#define GET_APIC_ID (x) get_apic_id(x) -#endif
arch/x86/kernel/genapic_flat_64.c +5 -4
@@ -126,11 +126,12 @@ static void flat_send_IPI_all(int vector)__send_IPI_shortcut (APIC_DEST_ALLINC , vector, apic->dest_logical); } -static unsigned int get_apic_id (unsigned long x) +static unsigned int flat_get_apic_id (unsigned long x) {unsigned int id; id = (((x)>>24 ) &0xFFu ); +return id; }
@@ -146,7 +147,7 @@ static unsigned int read_xapic_id(void) {unsigned int id; - id =get_apic_id (apic_read (APIC_ID )); + id =flat_get_apic_id (apic_read (APIC_ID ));return id; }
@@ -205,7 +206,7 @@ struct genapic apic_flat = { .phys_pkg_id = flat_phys_pkg_id, .mps_oem_check = NULL, - .get_apic_id = get_apic_id, + .get_apic_id = flat_get_apic_id, .set_apic_id = set_apic_id, .apic_id_mask = 0xFFu << 24,
@@ -349,7 +350,7 @@ struct genapic apic_physflat = { .phys_pkg_id = flat_phys_pkg_id, .mps_oem_check = NULL, - .get_apic_id = get_apic_id, + .get_apic_id = flat_get_apic_id, .set_apic_id = set_apic_id, .apic_id_mask = 0xFFu<<24,
arch/x86/kernel/genx2apic_cluster.c +2 -2
@@ -141,7 +141,7 @@ static unsigned int x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,return BAD_APICID ; } -static unsigned int get_apic_id (unsigned long x) +static unsigned int x2apic_cluster_phys_get_apic_id (unsigned long x) {unsigned int id;
@@ -207,7 +207,7 @@ struct genapic apic_x2apic_cluster = { .phys_pkg_id = x2apic_cluster_phys_pkg_id, .mps_oem_check = NULL, - .get_apic_id = get_apic_id, + .get_apic_id = x2apic_cluster_phys_get_apic_id, .set_apic_id = set_apic_id, .apic_id_mask = 0xFFFFFFFFu,
arch/x86/kernel/genx2apic_phys.c +2 -2
@@ -140,7 +140,7 @@ static unsigned int x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,return BAD_APICID ; } -static unsigned int get_apic_id (unsigned long x) +static unsigned int x2apic_phys_get_apic_id (unsigned long x) {unsigned int id;
@@ -203,7 +203,7 @@ struct genapic apic_x2apic_phys = { .phys_pkg_id = x2apic_phys_pkg_id, .mps_oem_check = NULL, - .get_apic_id = get_apic_id, + .get_apic_id = x2apic_phys_get_apic_id, .set_apic_id = set_apic_id, .apic_id_mask = 0xFFFFFFFFu,
arch/x86/kernel/genx2apic_uv_x.c +3 -3
@@ -201,7 +201,7 @@ static unsigned int uv_cpu_mask_to_apicid_and(const struct cpumask *cpumask,return BAD_APICID ; } -static unsigned int get_apic_id (unsigned long x) +static unsigned int x2apic_get_apic_id (unsigned long x) {unsigned int id;
@@ -223,7 +223,7 @@ static unsigned long set_apic_id(unsigned int id)static unsigned int uv_read_apic_id (void ) { -return get_apic_id (apic_read (APIC_ID )); +return x2apic_get_apic_id (apic_read (APIC_ID )); }static int uv_phys_pkg_id (int initial_apicid,int index_msb)
@@ -268,7 +268,7 @@ struct genapic apic_x2apic_uv_x = { .phys_pkg_id = uv_phys_pkg_id, .mps_oem_check = NULL, - .get_apic_id = get_apic_id, + .get_apic_id = x2apic_get_apic_id, .set_apic_id = set_apic_id, .apic_id_mask = 0xFFFFFFFFu,
arch/x86/mach-generic/bigsmp.c +1 -1
@@ -90,7 +90,7 @@ struct genapic apic_bigsmp = { .phys_pkg_id = bigsmp_phys_pkg_id, .mps_oem_check = NULL, - .get_apic_id = get_apic_id, + .get_apic_id = bigsmp_get_apic_id, .set_apic_id = NULL, .apic_id_mask = APIC_ID_MASK,
arch/x86/mach-generic/default.c +1 -1
@@ -71,7 +71,7 @@ struct genapic apic_default = { .phys_pkg_id = default_phys_pkg_id, .mps_oem_check = NULL, - .get_apic_id = get_apic_id, + .get_apic_id = default_get_apic_id, .set_apic_id = NULL, .apic_id_mask = APIC_ID_MASK,
arch/x86/mach-generic/es7000.c +1 -1
@@ -126,7 +126,7 @@ struct genapic apic_es7000 = { .phys_pkg_id = es7000_phys_pkg_id, .mps_oem_check = es7000_mps_oem_check, - .get_apic_id = get_apic_id, + .get_apic_id = es7000_get_apic_id, .set_apic_id = NULL, .apic_id_mask = APIC_ID_MASK,
arch/x86/mach-generic/numaq.c +1 -1
@@ -90,7 +90,7 @@ struct genapic apic_numaq = { .phys_pkg_id = numaq_phys_pkg_id, .mps_oem_check = __numaq_mps_oem_check, - .get_apic_id = get_apic_id, + .get_apic_id = numaq_get_apic_id, .set_apic_id = NULL, .apic_id_mask = APIC_ID_MASK,
arch/x86/mach-generic/summit.c +1 -1
@@ -70,7 +70,7 @@ struct genapic apic_summit = { .phys_pkg_id = summit_phys_pkg_id, .mps_oem_check = summit_mps_oem_check, - .get_apic_id = get_apic_id, + .get_apic_id = summit_get_apic_id, .set_apic_id = NULL, .apic_id_mask = APIC_ID_MASK,
Signature · 1 line
1.6.0.2
PATCH 56/114 x86, apic: refactor ->apic_id_mask & APIC_ID_MASK
In reply to Ingo Molnar- spread out the namespace on a per driver basis
- get rid of wrapper macros
--- arch/x86/include/asm/bigsmp/apicdef.h | 2 +- arch/x86/include/asm/es7000/apicdef.h | 2 +- arch/x86/include/asm/mach-default/mach_apicdef.h | 3 +-- arch/x86/include/asm/mach-generic/mach_apicdef.h | 2 -- arch/x86/include/asm/numaq/apicdef.h | 2 +- arch/x86/include/asm/summit/apicdef.h | 2 +- arch/x86/kernel/apic.c | 4 ++-- arch/x86/kernel/genapic_flat_64.c | 2 +- arch/x86/mach-generic/bigsmp.c | 2 +- arch/x86/mach-generic/default.c | 2 +- arch/x86/mach-generic/es7000.c | 2 +- arch/x86/mach-generic/numaq.c | 2 +- arch/x86/mach-generic/summit.c | 2 +- 13 files changed, 13 insertions(+), 16 deletions(-)
arch/x86/include/asm/bigsmp/apicdef.h +1 -1
@@ -1,7 +1,7 @@#ifndef __ASM_MACH_APICDEF_H#define __ASM_MACH_APICDEF_H -#define APIC_ID_MASK (0xFF<<24) +#define BIGSMP_APIC_ID_MASK (0xFF<<24)static inline unsigned bigsmp_get_apic_id (unsigned long x) {
arch/x86/include/asm/es7000/apicdef.h +1 -1
@@ -1,7 +1,7 @@#ifndef __ASM_ES7000_APICDEF_H#define __ASM_ES7000_APICDEF_H -#define APIC_ID_MASK (0xFF<<24) +#define ES7000_APIC_ID_MASK (0xFF<<24)static inline unsigned int es7000_get_apic_id (unsigned long x) {
arch/x86/include/asm/mach-default/mach_apicdef.h +1 -2
@@ -4,10 +4,9 @@#include <asm/apic.h> #ifdef CONFIG_X86_64 -#define APIC_ID_MASK (apic->apic_id_mask)#define SET_APIC_ID (x) (apic->set_apic_id(x))#else -#define APIC_ID_MASK (0xF<<24) +#define DEFAULT_APIC_ID_MASK (0x0F<<24)static inline unsigned default_get_apic_id (unsigned long x) {
arch/x86/include/asm/mach-generic/mach_apicdef.h +0 -2
@@ -3,8 +3,6 @@#ifndef APIC_DEFINITION #include <asm/genapic.h> - -#define APIC_ID_MASK (apic->apic_id_mask)#endif #endif /* _ASM_X86_MACH_GENERIC_MACH_APICDEF_H */
arch/x86/include/asm/numaq/apicdef.h +1 -1
@@ -1,7 +1,7 @@#ifndef __ASM_NUMAQ_APICDEF_H#define __ASM_NUMAQ_APICDEF_H -#define APIC_ID_MASK (0xF<<24) +#define NUMAQ_APIC_ID_MASK (0xF<<24)static inline unsigned int numaq_get_apic_id (unsigned long x) {
arch/x86/include/asm/summit/apicdef.h +1 -1
@@ -1,7 +1,7 @@#ifndef __ASM_SUMMIT_APICDEF_H#define __ASM_SUMMIT_APICDEF_H -#define APIC_ID_MASK (0xFF<<24) +#define SUMMIT_APIC_ID_MASK (0xFF<<24)static inline unsigned summit_get_apic_id (unsigned long x) {
arch/x86/kernel/apic.c +2 -2
@@ -1009,11 +1009,11 @@ int __init verify_local_APIC(void)*/ reg0 =apic_read (APIC_ID );apic_printk (APIC_DEBUG ,"Getting ID: %x\n" , reg0); -apic_write (APIC_ID , reg0 ^APIC_ID_MASK ); +apic_write (APIC_ID , reg0 ^ apic->apic_id_mask); reg1 =apic_read (APIC_ID );apic_printk (APIC_DEBUG ,"Getting ID: %x\n" , reg1);apic_write (APIC_ID , reg0); -if (reg1 != (reg0 ^APIC_ID_MASK )) +if (reg1 != (reg0 ^ apic->apic_id_mask))return 0 ;/*
arch/x86/kernel/genapic_flat_64.c +1 -1
@@ -352,7 +352,7 @@ struct genapic apic_physflat = { .get_apic_id = flat_get_apic_id, .set_apic_id = set_apic_id, - .apic_id_mask = 0xFFu<<24, + .apic_id_mask = 0xFFu << 24, .cpu_mask_to_apicid = physflat_cpu_mask_to_apicid, .cpu_mask_to_apicid_and = physflat_cpu_mask_to_apicid_and,
arch/x86/mach-generic/bigsmp.c +1 -1
@@ -92,7 +92,7 @@ struct genapic apic_bigsmp = { .get_apic_id = bigsmp_get_apic_id, .set_apic_id = NULL, - .apic_id_mask = APIC_ID_MASK, + .apic_id_mask = BIGSMP_APIC_ID_MASK, .cpu_mask_to_apicid = cpu_mask_to_apicid, .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and,
arch/x86/mach-generic/default.c +1 -1
@@ -73,7 +73,7 @@ struct genapic apic_default = { .get_apic_id = default_get_apic_id, .set_apic_id = NULL, - .apic_id_mask = APIC_ID_MASK, + .apic_id_mask = DEFAULT_APIC_ID_MASK, .cpu_mask_to_apicid = cpu_mask_to_apicid, .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and,
arch/x86/mach-generic/es7000.c +1 -1
@@ -128,7 +128,7 @@ struct genapic apic_es7000 = { .get_apic_id = es7000_get_apic_id, .set_apic_id = NULL, - .apic_id_mask = APIC_ID_MASK, + .apic_id_mask = ES7000_APIC_ID_MASK, .cpu_mask_to_apicid = cpu_mask_to_apicid, .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and,
arch/x86/mach-generic/numaq.c +1 -1
@@ -92,7 +92,7 @@ struct genapic apic_numaq = { .get_apic_id = numaq_get_apic_id, .set_apic_id = NULL, - .apic_id_mask = APIC_ID_MASK, + .apic_id_mask = NUMAQ_APIC_ID_MASK, .cpu_mask_to_apicid = cpu_mask_to_apicid, .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and,
arch/x86/mach-generic/summit.c +1 -1
@@ -72,7 +72,7 @@ struct genapic apic_summit = { .get_apic_id = summit_get_apic_id, .set_apic_id = NULL, - .apic_id_mask = APIC_ID_MASK, + .apic_id_mask = SUMMIT_APIC_ID_MASK, .cpu_mask_to_apicid = cpu_mask_to_apicid, .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and,
Signature · 1 line
1.6.0.2
PATCH 57/114 x86, apic: get rid of *_APIC_ID_MASK definitions
In reply to Ingo MolnarImpact: cleanup
Remove the *_APIC_ID_MASK subarch definitions and move them straight to the genapic driver initialization code.
--- arch/x86/include/asm/bigsmp/apicdef.h | 2 -- arch/x86/include/asm/es7000/apicdef.h | 2 -- arch/x86/include/asm/mach-default/mach_apicdef.h | 1 - arch/x86/include/asm/numaq/apicdef.h | 2 -- arch/x86/include/asm/summit/apicdef.h | 2 -- arch/x86/mach-generic/bigsmp.c | 2 +- arch/x86/mach-generic/default.c | 2 +- arch/x86/mach-generic/es7000.c | 2 +- arch/x86/mach-generic/numaq.c | 2 +- arch/x86/mach-generic/summit.c | 2 +- 10 files changed, 5 insertions(+), 14 deletions(-)
arch/x86/include/asm/bigsmp/apicdef.h +0 -2
@@ -1,8 +1,6 @@#ifndef __ASM_MACH_APICDEF_H#define __ASM_MACH_APICDEF_H -#define BIGSMP_APIC_ID_MASK (0xFF<<24) -static inline unsigned bigsmp_get_apic_id (unsigned long x) {return (x >>24 ) &0xFF ;
arch/x86/include/asm/es7000/apicdef.h +0 -2
@@ -1,8 +1,6 @@#ifndef __ASM_ES7000_APICDEF_H#define __ASM_ES7000_APICDEF_H -#define ES7000_APIC_ID_MASK (0xFF<<24) -static inline unsigned int es7000_get_apic_id (unsigned long x) {return (x >>24 ) &0xFF ;
arch/x86/include/asm/mach-default/mach_apicdef.h +0 -1
@@ -6,7 +6,6 @@#ifdef CONFIG_X86_64 #define SET_APIC_ID (x) (apic->set_apic_id(x))#else -#define DEFAULT_APIC_ID_MASK (0x0F<<24)static inline unsigned default_get_apic_id (unsigned long x) {
arch/x86/include/asm/numaq/apicdef.h +0 -2
@@ -1,8 +1,6 @@#ifndef __ASM_NUMAQ_APICDEF_H#define __ASM_NUMAQ_APICDEF_H -#define NUMAQ_APIC_ID_MASK (0xF<<24) -static inline unsigned int numaq_get_apic_id (unsigned long x) {return (x >>24 ) &0x0F ;
arch/x86/include/asm/summit/apicdef.h +0 -2
@@ -1,8 +1,6 @@#ifndef __ASM_SUMMIT_APICDEF_H#define __ASM_SUMMIT_APICDEF_H -#define SUMMIT_APIC_ID_MASK (0xFF<<24) -static inline unsigned summit_get_apic_id (unsigned long x) {return (x >>24 ) &0xFF ;
arch/x86/mach-generic/bigsmp.c +1 -1
@@ -92,7 +92,7 @@ struct genapic apic_bigsmp = { .get_apic_id = bigsmp_get_apic_id, .set_apic_id = NULL, - .apic_id_mask = BIGSMP_APIC_ID_MASK, + .apic_id_mask = 0xFF << 24, .cpu_mask_to_apicid = cpu_mask_to_apicid, .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and,
arch/x86/mach-generic/default.c +1 -1
@@ -73,7 +73,7 @@ struct genapic apic_default = { .get_apic_id = default_get_apic_id, .set_apic_id = NULL, - .apic_id_mask = DEFAULT_APIC_ID_MASK, + .apic_id_mask = 0x0F << 24, .cpu_mask_to_apicid = cpu_mask_to_apicid, .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and,
arch/x86/mach-generic/es7000.c +1 -1
@@ -128,7 +128,7 @@ struct genapic apic_es7000 = { .get_apic_id = es7000_get_apic_id, .set_apic_id = NULL, - .apic_id_mask = ES7000_APIC_ID_MASK, + .apic_id_mask = 0xFF << 24, .cpu_mask_to_apicid = cpu_mask_to_apicid, .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and,
arch/x86/mach-generic/numaq.c +1 -1
@@ -92,7 +92,7 @@ struct genapic apic_numaq = { .get_apic_id = numaq_get_apic_id, .set_apic_id = NULL, - .apic_id_mask = NUMAQ_APIC_ID_MASK, + .apic_id_mask = 0x0F << 24, .cpu_mask_to_apicid = cpu_mask_to_apicid, .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and,
arch/x86/mach-generic/summit.c +1 -1
@@ -72,7 +72,7 @@ struct genapic apic_summit = { .get_apic_id = summit_get_apic_id, .set_apic_id = NULL, - .apic_id_mask = SUMMIT_APIC_ID_MASK, + .apic_id_mask = 0xFF << 24, .cpu_mask_to_apicid = cpu_mask_to_apicid, .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and,
Signature · 1 line
1.6.0.2
PATCH 58/114 x86, apic: refactor ->cpu_mask_to_apicid*()
In reply to Ingo Molnar- spread out the namespace on a per driver basis
- clean up the functions
- get rid of macros
--- arch/x86/include/asm/bigsmp/apic.h | 17 ++++++-------- arch/x86/include/asm/es7000/apic.h | 29 +++++++++++++++--------- arch/x86/include/asm/mach-default/mach_apic.h | 10 ++++---- arch/x86/include/asm/mach-generic/mach_apic.h | 2 - arch/x86/include/asm/numaq/apic.h | 11 +++++---- arch/x86/include/asm/summit/apic.h | 21 +++++++++++------- arch/x86/kernel/genapic_flat_64.c | 4 ++- arch/x86/kernel/genx2apic_cluster.c | 15 +++++++----- arch/x86/kernel/genx2apic_phys.c | 15 +++++++----- arch/x86/kernel/genx2apic_uv_x.c | 14 +++++++----- arch/x86/kernel/io_apic.c | 21 ++++++++++------- arch/x86/mach-generic/bigsmp.c | 4 +- arch/x86/mach-generic/default.c | 4 +- arch/x86/mach-generic/es7000.c | 6 ++-- arch/x86/mach-generic/numaq.c | 4 +- arch/x86/mach-generic/summit.c | 4 +- 16 files changed, 101 insertions(+), 80 deletions(-)
arch/x86/include/asm/bigsmp/apic.h +7 -10
@@ -105,18 +105,14 @@ static inline int bigsmp_check_phys_apicid_present(int boot_cpu_physical_apicid) }/* As we are using single CPU as destination, pick only one CPU here */ -static inline unsigned int cpu_mask_to_apicid (const cpumask_t *cpumask) +static inline unsigned int bigsmp_cpu_mask_to_apicid (const cpumask_t *cpumask) { -int cpu; -int apicid; - - cpu =first_cpu (*cpumask); - apicid =bigsmp_cpu_to_logical_apicid (cpu); -return apicid; +return bigsmp_cpu_to_logical_apicid (first_cpu (*cpumask)); } -static inline unsigned int cpu_mask_to_apicid_and (const struct cpumask *cpumask, -const struct cpumask *andmask) +static inline unsigned int +bigsmp_cpu_mask_to_apicid_and (const struct cpumask *cpumask, +const struct cpumask *andmask) {int cpu;
@@ -124,9 +120,10 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask,* We're using fixed IRQ delivery, can only return one phys APIC ID. * May as well be the first. */ -for_each_cpu_and (cpu, cpumask, andmask) +for_each_cpu_and (cpu, cpumask, andmask) {if (cpumask_test_cpu (cpu, cpu_online_mask))break ; + }if (cpu < nr_cpu_ids)return bigsmp_cpu_to_logical_apicid (cpu);
arch/x86/include/asm/es7000/apic.h +18 -11
@@ -137,12 +137,12 @@ static inline int es7000_check_phys_apicid_present(int cpu_physical_apicid) }static inline unsigned int -cpu_mask_to_apicid_cluster (const struct cpumask *cpumask) +es7000_cpu_mask_to_apicid_cluster (const struct cpumask *cpumask) { -int num_bits_set;int cpus_found =0 ; -int cpu; +int num_bits_set;int apicid; +int cpu; num_bits_set =cpumask_weight (cpumask);/* Return id to all */
@@ -154,12 +154,15 @@ cpu_mask_to_apicid_cluster(const struct cpumask *cpumask)*/ cpu =cpumask_first (cpumask); apicid =es7000_cpu_to_logical_apicid (cpu); +while (cpus_found < num_bits_set) {if (cpumask_test_cpu (cpu, cpumask)) {int new_apicid =es7000_cpu_to_logical_apicid (cpu); +if (apicid_cluster (apicid) != -apicid_cluster (new_apicid)){ +apicid_cluster (new_apicid)) {printk ("%s: Not a valid mask!\n" , __func__); +return 0xFF ; } apicid = new_apicid;
@@ -170,12 +173,12 @@ cpu_mask_to_apicid_cluster(const struct cpumask *cpumask)return apicid; } -static inline unsigned int cpu_mask_to_apicid (const cpumask_t *cpumask) +static inline unsigned int es7000_cpu_mask_to_apicid (const cpumask_t *cpumask) { -int num_bits_set;int cpus_found =0 ; -int cpu; +int num_bits_set;int apicid; +int cpu; num_bits_set =cpus_weight (*cpumask);/* Return id to all */
@@ -190,9 +193,11 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)while (cpus_found < num_bits_set) {if (cpu_isset (cpu, *cpumask)) {int new_apicid =es7000_cpu_to_logical_apicid (cpu); +if (apicid_cluster (apicid) != -apicid_cluster (new_apicid)){ +apicid_cluster (new_apicid)) {printk ("%s: Not a valid mask!\n" , __func__); +return es7000_cpu_to_logical_apicid (0 ); } apicid = new_apicid;
@@ -204,8 +209,9 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask) } -static inline unsigned int cpu_mask_to_apicid_and (const struct cpumask *inmask, -const struct cpumask *andmask) +static inline unsigned int +es7000_cpu_mask_to_apicid_and (const struct cpumask *inmask, +const struct cpumask *andmask) {int apicid =es7000_cpu_to_logical_apicid (0 );cpumask_var_t cpumask;
@@ -215,9 +221,10 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *inmask,cpumask_and (cpumask, inmask, andmask);cpumask_and (cpumask, cpumask, cpu_online_mask); - apicid =cpu_mask_to_apicid (cpumask); + apicid =es7000_cpu_mask_to_apicid (cpumask);free_cpumask_var (cpumask); +return apicid; }
arch/x86/include/asm/mach-default/mach_apic.h +5 -5
@@ -19,8 +19,6 @@ static inline const struct cpumask *default_target_cpus(void)#ifdef CONFIG_X86_64 #include <asm/genapic.h> -#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid) -#define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and)#define read_apic_id () (apic->get_apic_id(apic_read(APIC_ID)))#define send_IPI_self (apic->send_IPI_self)#define wakeup_secondary_cpu (apic->wakeup_cpu)
@@ -49,13 +47,15 @@ static inline int default_apic_id_registered(void)return physid_isset (read_apic_id (), phys_cpu_present_map); } -static inline unsigned int cpu_mask_to_apicid (const struct cpumask *cpumask) +static inline unsigned int +default_cpu_mask_to_apicid (const struct cpumask *cpumask) {return cpumask_bits (cpumask)[0 ]; } -static inline unsigned int cpu_mask_to_apicid_and (const struct cpumask *cpumask, -const struct cpumask *andmask) +static inline unsigned int +default_cpu_mask_to_apicid_and (const struct cpumask *cpumask, +const struct cpumask *andmask) {unsigned long mask1 =cpumask_bits (cpumask)[0 ];unsigned long mask2 =cpumask_bits (andmask)[0 ];
arch/x86/include/asm/mach-generic/mach_apic.h +0 -2
@@ -3,8 +3,6 @@#include <asm/genapic.h> -#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid) -#define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and)#define wakeup_secondary_cpu (apic->wakeup_cpu)extern void generic_bigsmp_probe (void );
arch/x86/include/asm/numaq/apic.h +6 -5
@@ -101,15 +101,16 @@ static inline int numaq_check_phys_apicid_present(int boot_cpu_physical_apicid)* We use physical apicids here, not logical, so just return the default * physical broadcast to stop people from breaking us */ -static inline unsigned int cpu_mask_to_apicid (const cpumask_t *cpumask) +static inline unsigned int numaq_cpu_mask_to_apicid (const cpumask_t *cpumask) { -return (int )0xF ; +return 0x0F ; } -static inline unsigned int cpu_mask_to_apicid_and (const struct cpumask *cpumask, -const struct cpumask *andmask) +static inline unsigned int +numaq_cpu_mask_to_apicid_and (const struct cpumask *cpumask, +const struct cpumask *andmask) { -return (int )0xF ; +return 0x0F ; }/* No NUMA-Q box has a HT CPU, but it can't hurt to use the default code. */
arch/x86/include/asm/summit/apic.h +13 -8
@@ -125,29 +125,32 @@ static inline int summit_check_phys_apicid_present(int boot_cpu_physical_apicid)return 1 ; } -static inline unsigned int cpu_mask_to_apicid (const cpumask_t *cpumask) +static inline unsigned int summit_cpu_mask_to_apicid (const cpumask_t *cpumask) { -int num_bits_set;int cpus_found =0 ; -int cpu; +int num_bits_set;int apicid; +int cpu; num_bits_set =cpus_weight (*cpumask);/* Return id to all */ if (num_bits_set >= nr_cpu_ids) -return (int )0xFF ; +return 0xFF ;/* * The cpus in the mask must all be on the apic cluster. If are not * on the same apicid cluster return default value of target_cpus(): */ cpu =first_cpu (*cpumask); apicid =summit_cpu_to_logical_apicid (cpu); +while (cpus_found < num_bits_set) {if (cpu_isset (cpu, *cpumask)) {int new_apicid =summit_cpu_to_logical_apicid (cpu); +if (apicid_cluster (apicid) != -apicid_cluster (new_apicid)){ +apicid_cluster (new_apicid)) {printk ("%s: Not a valid mask!\n" , __func__); +return 0xFF ; } apicid = apicid | new_apicid;
@@ -158,8 +161,9 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)return apicid; } -static inline unsigned int cpu_mask_to_apicid_and (const struct cpumask *inmask, -const struct cpumask *andmask) +static inline unsigned int +summit_cpu_mask_to_apicid_and (const struct cpumask *inmask, +const struct cpumask *andmask) {int apicid =summit_cpu_to_logical_apicid (0 );cpumask_var_t cpumask;
@@ -169,9 +173,10 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *inmask,cpumask_and (cpumask, inmask, andmask);cpumask_and (cpumask, cpumask, cpu_online_mask); - apicid =cpu_mask_to_apicid (cpumask); + apicid =summit_cpu_mask_to_apicid (cpumask);free_cpumask_var (cpumask); +return apicid; }
arch/x86/kernel/genapic_flat_64.c +3 -1
@@ -309,11 +309,13 @@ physflat_cpu_mask_to_apicid_and(const struct cpumask *cpumask,* We're using fixed IRQ delivery, can only return one phys APIC ID. * May as well be the first. */ -for_each_cpu_and (cpu, cpumask, andmask) +for_each_cpu_and (cpu, cpumask, andmask) {if (cpumask_test_cpu (cpu, cpu_online_mask))break ; + }if (cpu < nr_cpu_ids)return per_cpu (x86_cpu_to_apicid, cpu); +return BAD_APICID ; }
arch/x86/kernel/genx2apic_cluster.c +9 -6
@@ -111,21 +111,21 @@ static int x2apic_apic_id_registered(void)static unsigned int x2apic_cpu_mask_to_apicid (const struct cpumask *cpumask) { -int cpu; -/* * We're using fixed IRQ delivery, can only return one logical APIC ID. * May as well be the first. */ - cpu =cpumask_first (cpumask); +int cpu =cpumask_first (cpumask); +if ((unsigned )cpu < nr_cpu_ids)return per_cpu (x86_cpu_to_logical_apicid, cpu);else return BAD_APICID ; } -static unsigned int x2apic_cpu_mask_to_apicid_and (const struct cpumask *cpumask, -const struct cpumask *andmask) +static unsigned int +x2apic_cpu_mask_to_apicid_and (const struct cpumask *cpumask, +const struct cpumask *andmask) {int cpu;
@@ -133,11 +133,14 @@ static unsigned int x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,* We're using fixed IRQ delivery, can only return one logical APIC ID. * May as well be the first. */ -for_each_cpu_and (cpu, cpumask, andmask) +for_each_cpu_and (cpu, cpumask, andmask) {if (cpumask_test_cpu (cpu, cpu_online_mask))break ; + } +if (cpu < nr_cpu_ids)return per_cpu (x86_cpu_to_logical_apicid, cpu); +return BAD_APICID ; }
arch/x86/kernel/genx2apic_phys.c +9 -6
@@ -110,21 +110,21 @@ static int x2apic_apic_id_registered(void)static unsigned int x2apic_cpu_mask_to_apicid (const struct cpumask *cpumask) { -int cpu; -/* * We're using fixed IRQ delivery, can only return one phys APIC ID. * May as well be the first. */ - cpu =cpumask_first (cpumask); +int cpu =cpumask_first (cpumask); +if ((unsigned )cpu < nr_cpu_ids)return per_cpu (x86_cpu_to_apicid, cpu);else return BAD_APICID ; } -static unsigned int x2apic_cpu_mask_to_apicid_and (const struct cpumask *cpumask, -const struct cpumask *andmask) +static unsigned int +x2apic_cpu_mask_to_apicid_and (const struct cpumask *cpumask, +const struct cpumask *andmask) {int cpu;
@@ -132,11 +132,14 @@ static unsigned int x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,* We're using fixed IRQ delivery, can only return one phys APIC ID. * May as well be the first. */ -for_each_cpu_and (cpu, cpumask, andmask) +for_each_cpu_and (cpu, cpumask, andmask) {if (cpumask_test_cpu (cpu, cpu_online_mask))break ; + } +if (cpu < nr_cpu_ids)return per_cpu (x86_cpu_to_apicid, cpu); +return BAD_APICID ; }
arch/x86/kernel/genx2apic_uv_x.c +8 -6
@@ -171,21 +171,21 @@ static void uv_init_apic_ldr(void)static unsigned int uv_cpu_mask_to_apicid (const struct cpumask *cpumask) { -int cpu; -/* * We're using fixed IRQ delivery, can only return one phys APIC ID. * May as well be the first. */ - cpu =cpumask_first (cpumask); +int cpu =cpumask_first (cpumask); +if ((unsigned )cpu < nr_cpu_ids)return per_cpu (x86_cpu_to_apicid, cpu);else return BAD_APICID ; } -static unsigned int uv_cpu_mask_to_apicid_and (const struct cpumask *cpumask, -const struct cpumask *andmask) +static unsigned int +uv_cpu_mask_to_apicid_and (const struct cpumask *cpumask, +const struct cpumask *andmask) {int cpu;
@@ -193,11 +193,13 @@ static unsigned int uv_cpu_mask_to_apicid_and(const struct cpumask *cpumask,* We're using fixed IRQ delivery, can only return one phys APIC ID. * May as well be the first. */ -for_each_cpu_and (cpu, cpumask, andmask) +for_each_cpu_and (cpu, cpumask, andmask) {if (cpumask_test_cpu (cpu, cpu_online_mask))break ; + }if (cpu < nr_cpu_ids)return per_cpu (x86_cpu_to_apicid, cpu); +return BAD_APICID ; }
arch/x86/kernel/io_apic.c +12 -9
@@ -563,8 +563,9 @@ static int assign_irq_vector(int irq, struct irq_cfg *cfg, const struct cpumask *mask);/* -* Either sets desc->affinity to a valid value, and returns cpu_mask_to_apicid -* of that, or returns BAD_APICID and leaves desc->affinity untouched. +* Either sets desc->affinity to a valid value, and returns +* ->cpu_mask_to_apicid of that, or returns BAD_APICID and +* leaves desc->affinity untouched. */ static unsigned int set_desc_affinity (struct irq_desc *desc,const struct cpumask *mask)
@@ -582,7 +583,8 @@ set_desc_affinity(struct irq_desc *desc, const struct cpumask *mask)cpumask_and (desc->affinity, cfg->domain, mask);set_extra_move_desc (desc, mask); -return cpu_mask_to_apicid_and (desc->affinity, cpu_online_mask); + +return apic->cpu_mask_to_apicid_and (desc->affinity, cpu_online_mask); } static void
@@ -1562,7 +1564,7 @@ static void setup_IO_APIC_irq(int apic_id, int pin, unsigned int irq, struct irqif (assign_irq_vector (irq, cfg, apic->target_cpus ()))return ; - dest =cpu_mask_to_apicid_and (cfg->domain, apic->target_cpus ()); + dest = apic->cpu_mask_to_apicid_and (cfg->domain, apic->target_cpus ());apic_printk (APIC_VERBOSE ,KERN_DEBUG "IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> "
@@ -1666,7 +1668,7 @@ static void __init setup_timer_IRQ0_pin(unsigned int apic_id, unsigned int pin,*/ entry.dest_mode = apic->irq_dest_mode; entry.mask =1 ;/* mask IRQ now */ - entry.dest =cpu_mask_to_apicid (apic->target_cpus ()); + entry.dest = apic->cpu_mask_to_apicid (apic->target_cpus ()); entry.delivery_mode = apic->irq_delivery_mode; entry.polarity =0 ; entry.trigger =0 ;
@@ -2367,7 +2369,7 @@ migrate_ioapic_irq_desc(struct irq_desc *desc, const struct cpumask *mask)set_extra_move_desc (desc, mask); - dest =cpu_mask_to_apicid_and (cfg->domain, mask); + dest = apic->cpu_mask_to_apicid_and (cfg->domain, mask); modify_ioapic_rte = desc->status &IRQ_LEVEL ;if (modify_ioapic_rte) {
@@ -3270,7 +3272,7 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_msif (err)return err; - dest =cpu_mask_to_apicid_and (cfg->domain, apic->target_cpus ()); + dest = apic->cpu_mask_to_apicid_and (cfg->domain, apic->target_cpus ());#ifdef CONFIG_INTR_REMAP if (irq_remapped (irq)) {
@@ -3708,7 +3710,8 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)struct ht_irq_msg msg;unsigned dest; - dest =cpu_mask_to_apicid_and (cfg->domain, apic->target_cpus ()); + dest = apic->cpu_mask_to_apicid_and (cfg->domain, + apic->target_cpus ()); msg.address_hi =HT_IRQ_HIGH_DEST_ID (dest);
@@ -3773,7 +3776,7 @@ int arch_enable_uv_irq(char *irq_name, unsigned int irq, int cpu, int mmr_blade, entry->polarity =0 ; entry->trigger =0 ; entry->mask =0 ; - entry->dest =cpu_mask_to_apicid (eligible_cpu); + entry->dest = apic->cpu_mask_to_apicid (eligible_cpu); mmr_pnode =uv_blade_to_pnode (mmr_blade);uv_write_global_mmr64 (mmr_pnode, mmr_offset, mmr_value);
arch/x86/mach-generic/bigsmp.c +2 -2
@@ -94,8 +94,8 @@ struct genapic apic_bigsmp = { .set_apic_id = NULL, .apic_id_mask = 0xFF << 24, - .cpu_mask_to_apicid = cpu_mask_to_apicid, - .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and, + .cpu_mask_to_apicid = bigsmp_cpu_mask_to_apicid, + .cpu_mask_to_apicid_and = bigsmp_cpu_mask_to_apicid_and, .send_IPI_mask = send_IPI_mask, .send_IPI_mask_allbutself = NULL,
arch/x86/mach-generic/default.c +2 -2
@@ -75,8 +75,8 @@ struct genapic apic_default = { .set_apic_id = NULL, .apic_id_mask = 0x0F << 24, - .cpu_mask_to_apicid = cpu_mask_to_apicid, - .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and, + .cpu_mask_to_apicid = default_cpu_mask_to_apicid, + .cpu_mask_to_apicid_and = default_cpu_mask_to_apicid_and, .send_IPI_mask = send_IPI_mask, .send_IPI_mask_allbutself = NULL,
arch/x86/mach-generic/es7000.c +3 -3
@@ -26,7 +26,7 @@ void __init es7000_update_genapic_to_cluster(void) apic->init_apic_ldr = es7000_init_apic_ldr_cluster; - apic->cpu_mask_to_apicid = cpu_mask_to_apicid_cluster; + apic->cpu_mask_to_apicid = es7000_cpu_mask_to_apicid_cluster; }static int probe_es7000 (void )
@@ -130,8 +130,8 @@ struct genapic apic_es7000 = { .set_apic_id = NULL, .apic_id_mask = 0xFF << 24, - .cpu_mask_to_apicid = cpu_mask_to_apicid, - .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and, + .cpu_mask_to_apicid = es7000_cpu_mask_to_apicid, + .cpu_mask_to_apicid_and = es7000_cpu_mask_to_apicid_and, .send_IPI_mask = send_IPI_mask, .send_IPI_mask_allbutself = NULL,
arch/x86/mach-generic/numaq.c +2 -2
@@ -94,8 +94,8 @@ struct genapic apic_numaq = { .set_apic_id = NULL, .apic_id_mask = 0x0F << 24, - .cpu_mask_to_apicid = cpu_mask_to_apicid, - .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and, + .cpu_mask_to_apicid = numaq_cpu_mask_to_apicid, + .cpu_mask_to_apicid_and = numaq_cpu_mask_to_apicid_and, .send_IPI_mask = send_IPI_mask, .send_IPI_mask_allbutself = NULL,
arch/x86/mach-generic/summit.c +2 -2
@@ -74,8 +74,8 @@ struct genapic apic_summit = { .set_apic_id = NULL, .apic_id_mask = 0xFF << 24, - .cpu_mask_to_apicid = cpu_mask_to_apicid, - .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and, + .cpu_mask_to_apicid = summit_cpu_mask_to_apicid, + .cpu_mask_to_apicid_and = summit_cpu_mask_to_apicid_and, .send_IPI_mask = send_IPI_mask, .send_IPI_mask_allbutself = NULL,
Signature · 1 line
1.6.0.2
PATCH 59/114 x86, apic: untangle the send_IPI_*() jungle
In reply to Ingo MolnarOur send_IPI_*() methods and definitions are a twisted mess: the same symbol is defined to different things depending on .config details, in a non-transparent way.
- spread out the quirks into separately named per apic driver methods
- prefix the standard PC methods with default_
- get rid of wrapper macro obfuscation
- clean up various details
--- arch/x86/include/asm/bigsmp/ipi.h | 44 +++++----- arch/x86/include/asm/es7000/ipi.h | 44 +++++----- arch/x86/include/asm/hw_irq.h | 4 +- arch/x86/include/asm/ipi.h | 38 ++++---- arch/x86/include/asm/mach-default/mach_apic.h | 1 - arch/x86/include/asm/mach-default/mach_ipi.h | 122 ++++++++++++------------- arch/x86/include/asm/mach-generic/mach_ipi.h | 4 - arch/x86/include/asm/numaq/ipi.h | 44 +++++----- arch/x86/include/asm/summit/ipi.h | 52 +++++----- arch/x86/kernel/apic.c | 2 +- arch/x86/kernel/genapic_64.c | 2 +- arch/x86/kernel/genapic_flat_64.c | 24 +++-- arch/x86/kernel/genx2apic_cluster.c | 38 ++++---- arch/x86/kernel/genx2apic_phys.c | 36 +++---- arch/x86/kernel/genx2apic_uv_x.c | 21 +++-- arch/x86/kernel/io_apic.c | 10 +- arch/x86/kernel/ipi.c | 28 +++--- arch/x86/kernel/kgdb.c | 2 +- arch/x86/kernel/reboot.c | 2 +- arch/x86/kernel/smp.c | 10 +- arch/x86/mach-generic/bigsmp.c | 6 +- arch/x86/mach-generic/default.c | 6 +- arch/x86/mach-generic/es7000.c | 6 +- arch/x86/mach-generic/numaq.c | 6 +- arch/x86/mach-generic/summit.c | 6 +- arch/x86/mm/tlb.c | 2 +- 26 files changed, 279 insertions(+), 281 deletions(-)
rewrite arch/x86/include/asm/bigsmp/ipi.h (81%) rewrite arch/x86/include/asm/es7000/ipi.h (81%) rewrite arch/x86/include/asm/mach-default/mach_ipi.h (65%) rewrite arch/x86/include/asm/numaq/ipi.h (81%) rewrite arch/x86/include/asm/summit/ipi.h (66%)
arch/x86/include/asm/bigsmp/ipi.h +22 -22
@@ -1,22 +1,22 @@ -#ifndef __ASM_MACH_IPI_H -#define __ASM_MACH_IPI_H - -void send_IPI_mask_sequence (const struct cpumask *mask,int vector); -void send_IPI_mask_allbutself (const struct cpumask *mask,int vector); - -static inline void send_IPI_mask (const struct cpumask *mask,int vector) -{ -send_IPI_mask_sequence (mask, vector); -} - -static inline void send_IPI_allbutself (int vector) -{ -send_IPI_mask_allbutself (cpu_online_mask, vector); -} - -static inline void send_IPI_all (int vector) -{ -send_IPI_mask (cpu_online_mask, vector); -} - -#endif /* __ASM_MACH_IPI_H */ +#ifndef __ASM_MACH_IPI_H +#define __ASM_MACH_IPI_H + +void default_send_IPI_mask_sequence (const struct cpumask *mask,int vector); +void default_send_IPI_mask_allbutself (const struct cpumask *mask,int vector); + +static inline void default_send_IPI_mask (const struct cpumask *mask,int vector) +{ +default_send_IPI_mask_sequence (mask, vector); +} + +static inline void bigsmp_send_IPI_allbutself (int vector) +{ +default_send_IPI_mask_allbutself (cpu_online_mask, vector); +} + +static inline void bigsmp_send_IPI_all (int vector) +{ +default_send_IPI_mask (cpu_online_mask, vector); +} + +#endif /* __ASM_MACH_IPI_H */
arch/x86/include/asm/es7000/ipi.h +22 -22
44 lines not on this page · raw message
arch/x86/include/asm/hw_irq.h +2 -2
@@ -73,9 +73,9 @@ extern void enable_IO_APIC(void);/* IPI functions */ #ifdef CONFIG_X86_32 -extern void send_IPI_self (int vector); +extern void default_send_IPI_self (int vector);#endif -extern void send_IPI (int dest,int vector); +extern void default_send_IPI (int dest,int vector);/* Statistics */ extern atomic_t irq_err_count;
arch/x86/include/asm/ipi.h +20 -18
@@ -55,8 +55,9 @@ static inline void __xapic_wait_icr_idle(void)cpu_relax (); } -static inline void __send_IPI_shortcut (unsigned int shortcut,int vector, -unsigned int dest) +static inline void +__default_send_IPI_shortcut (unsigned int shortcut, +int vector,unsigned int dest) {/* * Subtle. In the case of the 'never do double writes' workaround
@@ -87,8 +88,8 @@ static inline void __send_IPI_shortcut(unsigned int shortcut, int vector,* This is used to send an IPI with no shorthand notation (the destination is * specified in bits 56 to 63 of the ICR). */ -static inline void __send_IPI_dest_field (unsigned int mask,int vector, -unsigned int dest) +static inline void +__default_send_IPI_dest_field (unsigned int mask,int vector,unsigned int dest) {unsigned long cfg;
@@ -117,11 +118,11 @@ static inline void __send_IPI_dest_field(unsigned int mask, int vector,native_apic_mem_write (APIC_ICR , cfg); } -static inline void send_IPI_mask_sequence (const struct cpumask *mask, -int vector) +static inline void +default_send_IPI_mask_sequence (const struct cpumask *mask,int vector) { -unsigned long flags;unsigned long query_cpu; +unsigned long flags;/* * Hack. The clustered APIC addressing mode doesn't allow us to send
@@ -130,27 +131,28 @@ static inline void send_IPI_mask_sequence(const struct cpumask *mask,*/ local_irq_save (flags);for_each_cpu (query_cpu, mask) { -__send_IPI_dest_field (per_cpu (x86_cpu_to_apicid, query_cpu), - vector,APIC_DEST_PHYSICAL ); +__default_send_IPI_dest_field (per_cpu (x86_cpu_to_apicid, + query_cpu), vector,APIC_DEST_PHYSICAL ); }local_irq_restore (flags); } -static inline void send_IPI_mask_allbutself (const struct cpumask *mask, -int vector) +static inline void +default_send_IPI_mask_allbutself (const struct cpumask *mask,int vector) { -unsigned long flags; -unsigned int query_cpu;unsigned int this_cpu =smp_processor_id (); +unsigned int query_cpu; +unsigned long flags;/* See Hack comment above */ local_irq_save (flags); -for_each_cpu (query_cpu, mask) -if (query_cpu != this_cpu) -__send_IPI_dest_field ( -per_cpu (x86_cpu_to_apicid, query_cpu), - vector,APIC_DEST_PHYSICAL ); +for_each_cpu (query_cpu, mask) { +if (query_cpu == this_cpu) +continue ; +__default_send_IPI_dest_field (per_cpu (x86_cpu_to_apicid, + query_cpu), vector,APIC_DEST_PHYSICAL ); + }local_irq_restore (flags); }
arch/x86/include/asm/mach-default/mach_apic.h +0 -1
@@ -20,7 +20,6 @@ static inline const struct cpumask *default_target_cpus(void)#ifdef CONFIG_X86_64 #include <asm/genapic.h> #define read_apic_id () (apic->get_apic_id(apic_read(APIC_ID))) -#define send_IPI_self (apic->send_IPI_self)#define wakeup_secondary_cpu (apic->wakeup_cpu)extern void default_setup_apic_routing (void );#else
arch/x86/include/asm/mach-default/mach_ipi.h +58 -64
122 lines not on this page · raw message
arch/x86/include/asm/mach-generic/mach_ipi.h +0 -4
@@ -3,8 +3,4 @@#include <asm/genapic.h> -#define send_IPI_mask (apic->send_IPI_mask) -#define send_IPI_allbutself (apic->send_IPI_allbutself) -#define send_IPI_all (apic->send_IPI_all) -#endif /* _ASM_X86_MACH_GENERIC_MACH_IPI_H */
arch/x86/include/asm/numaq/ipi.h +22 -22
44 lines not on this page · raw message
arch/x86/include/asm/summit/ipi.h +26 -26
52 lines not on this page · raw message
arch/x86/kernel/apic.c +1 -1
@@ -475,7 +475,7 @@ static void lapic_timer_setup(enum clock_event_mode mode,static void lapic_timer_broadcast (const struct cpumask *mask) {#ifdef CONFIG_SMP -send_IPI_mask (mask,LOCAL_TIMER_VECTOR ); + apic->send_IPI_mask (mask,LOCAL_TIMER_VECTOR );#endif }
arch/x86/kernel/genapic_64.c +1 -1
@@ -65,7 +65,7 @@ void __init default_setup_apic_routing(void)void apic_send_IPI_self (int vector) { -__send_IPI_shortcut (APIC_DEST_SELF , vector,APIC_DEST_PHYSICAL ); +__default_send_IPI_shortcut (APIC_DEST_SELF , vector,APIC_DEST_PHYSICAL ); }int __init default_acpi_madt_oem_check (char *oem_id,char *oem_table_id)
arch/x86/kernel/genapic_flat_64.c +14 -10
@@ -74,7 +74,7 @@ static inline void _flat_send_IPI_mask(unsigned long mask, int vector)unsigned long flags;local_irq_save (flags); -__send_IPI_dest_field (mask, vector, apic->dest_logical); +__default_send_IPI_dest_field (mask, vector, apic->dest_logical);local_irq_restore (flags); }
@@ -85,14 +85,15 @@ static void flat_send_IPI_mask(const struct cpumask *cpumask, int vector)_flat_send_IPI_mask (mask, vector); } -static void flat_send_IPI_mask_allbutself (const struct cpumask *cpumask, -int vector) +static void +flat_send_IPI_mask_allbutself (const struct cpumask *cpumask,int vector) {unsigned long mask =cpumask_bits (cpumask)[0 ];int cpu =smp_processor_id ();if (cpu <BITS_PER_LONG )clear_bit (cpu, &mask); +_flat_send_IPI_mask (mask, vector); }
@@ -114,16 +115,19 @@ static void flat_send_IPI_allbutself(int vector)_flat_send_IPI_mask (mask, vector); } }else if (num_online_cpus () >1 ) { -__send_IPI_shortcut (APIC_DEST_ALLBUT , vector, apic->dest_logical); +__default_send_IPI_shortcut (APIC_DEST_ALLBUT , + vector, apic->dest_logical); } }static void flat_send_IPI_all (int vector) { -if (vector ==NMI_VECTOR ) +if (vector ==NMI_VECTOR ) {flat_send_IPI_mask (cpu_online_mask, vector); -else -__send_IPI_shortcut (APIC_DEST_ALLINC , vector, apic->dest_logical); + }else { +__default_send_IPI_shortcut (APIC_DEST_ALLINC , + vector, apic->dest_logical); + } }static unsigned int flat_get_apic_id (unsigned long x)
@@ -265,18 +269,18 @@ static void physflat_vector_allocation_domain(int cpu, struct cpumask *retmask)static void physflat_send_IPI_mask (const struct cpumask *cpumask,int vector) { -send_IPI_mask_sequence (cpumask, vector); +default_send_IPI_mask_sequence (cpumask, vector); }static void physflat_send_IPI_mask_allbutself (const struct cpumask *cpumask,int vector) { -send_IPI_mask_allbutself (cpumask, vector); +default_send_IPI_mask_allbutself (cpumask, vector); }static void physflat_send_IPI_allbutself (int vector) { -send_IPI_mask_allbutself (cpu_online_mask, vector); +default_send_IPI_mask_allbutself (cpu_online_mask, vector); }static void physflat_send_IPI_all (int vector)
arch/x86/kernel/genx2apic_cluster.c +21 -17
@@ -36,8 +36,8 @@ static void x2apic_vector_allocation_domain(int cpu, struct cpumask *retmask)cpumask_set_cpu (cpu, retmask); } -static void __x2apic_send_IPI_dest (unsigned int apicid,int vector, -unsigned int dest) +static void +__x2apic_send_IPI_dest (unsigned int apicid,int vector,unsigned int dest) {unsigned long cfg;
@@ -57,45 +57,50 @@ static void __x2apic_send_IPI_dest(unsigned int apicid, int vector,*/ static void x2apic_send_IPI_mask (const struct cpumask *mask,int vector) { -unsigned long flags;unsigned long query_cpu; +unsigned long flags;local_irq_save (flags); -for_each_cpu (query_cpu, mask) +for_each_cpu (query_cpu, mask) {__x2apic_send_IPI_dest (per_cpu (x86_cpu_to_logical_apicid, query_cpu), vector, apic->dest_logical); + }local_irq_restore (flags); } -static void x2apic_send_IPI_mask_allbutself (const struct cpumask *mask, -int vector) +static void +x2apic_send_IPI_mask_allbutself (const struct cpumask *mask,int vector) { -unsigned long flags; -unsigned long query_cpu;unsigned long this_cpu =smp_processor_id (); +unsigned long query_cpu; +unsigned long flags;local_irq_save (flags); -for_each_cpu (query_cpu, mask) -if (query_cpu != this_cpu) -__x2apic_send_IPI_dest ( +for_each_cpu (query_cpu, mask) { +if (query_cpu == this_cpu) +continue ; +__x2apic_send_IPI_dest (per_cpu (x86_cpu_to_logical_apicid, query_cpu), vector, apic->dest_logical); + }local_irq_restore (flags); }static void x2apic_send_IPI_allbutself (int vector) { -unsigned long flags; -unsigned long query_cpu;unsigned long this_cpu =smp_processor_id (); +unsigned long query_cpu; +unsigned long flags;local_irq_save (flags); -for_each_online_cpu (query_cpu) -if (query_cpu != this_cpu) -__x2apic_send_IPI_dest ( +for_each_online_cpu (query_cpu) { +if (query_cpu == this_cpu) +continue ; +__x2apic_send_IPI_dest (per_cpu (x86_cpu_to_logical_apicid, query_cpu), vector, apic->dest_logical); + }local_irq_restore (flags); }
@@ -175,7 +180,6 @@ static void init_x2apic_ldr(void)int cpu =smp_processor_id ();per_cpu (x86_cpu_to_logical_apicid, cpu) =apic_read (APIC_LDR ); -return ; }struct genapic apic_x2apic_cluster = {
arch/x86/kernel/genx2apic_phys.c +15 -21
@@ -55,8 +55,8 @@ static void __x2apic_send_IPI_dest(unsigned int apicid, int vector,static void x2apic_send_IPI_mask (const struct cpumask *mask,int vector) { -unsigned long flags;unsigned long query_cpu; +unsigned long flags;local_irq_save (flags);for_each_cpu (query_cpu, mask) {
@@ -66,12 +66,12 @@ static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector)local_irq_restore (flags); } -static void x2apic_send_IPI_mask_allbutself (const struct cpumask *mask, -int vector) +static void +x2apic_send_IPI_mask_allbutself (const struct cpumask *mask,int vector) { -unsigned long flags; -unsigned long query_cpu;unsigned long this_cpu =smp_processor_id (); +unsigned long query_cpu; +unsigned long flags;local_irq_save (flags);for_each_cpu (query_cpu, mask) {
@@ -85,16 +85,17 @@ static void x2apic_send_IPI_mask_allbutself(const struct cpumask *mask,static void x2apic_send_IPI_allbutself (int vector) { -unsigned long flags; -unsigned long query_cpu;unsigned long this_cpu =smp_processor_id (); +unsigned long query_cpu; +unsigned long flags;local_irq_save (flags); -for_each_online_cpu (query_cpu) -if (query_cpu != this_cpu) -__x2apic_send_IPI_dest ( -per_cpu (x86_cpu_to_apicid, query_cpu), - vector,APIC_DEST_PHYSICAL ); +for_each_online_cpu (query_cpu) { +if (query_cpu == this_cpu) +continue ; +__x2apic_send_IPI_dest (per_cpu (x86_cpu_to_apicid, query_cpu), + vector,APIC_DEST_PHYSICAL ); + }local_irq_restore (flags); }
@@ -145,18 +146,12 @@ x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,static unsigned int x2apic_phys_get_apic_id (unsigned long x) { -unsigned int id; - - id = x; -return id; +return x; }static unsigned long set_apic_id (unsigned int id) { -unsigned long x; - - x = id; -return x; +return id; }static int x2apic_phys_pkg_id (int initial_apicid,int index_msb)
@@ -171,7 +166,6 @@ static void x2apic_send_IPI_self(int vector)static void init_x2apic_ldr (void ) { -return ; }struct genapic apic_x2apic_phys = {
arch/x86/kernel/genx2apic_uv_x.c +12 -9
@@ -118,12 +118,13 @@ static void uv_send_IPI_one(int cpu, int vector)int pnode; apicid =per_cpu (x86_cpu_to_apicid, cpu); - lapicid = apicid &0x3f ;/* ZZZ macro needed */ + lapicid = apicid &0x3f ;/* ZZZ macro needed */ pnode =uv_apicid_to_pnode (apicid); - val = - (1UL <<UVH_IPI_INT_SEND_SHFT ) | (lapicid << -UVH_IPI_INT_APIC_ID_SHFT ) | - (vector <<UVH_IPI_INT_VECTOR_SHFT ); + + val = (1UL <<UVH_IPI_INT_SEND_SHFT ) | + ( lapicid <<UVH_IPI_INT_APIC_ID_SHFT ) | + ( vector <<UVH_IPI_INT_VECTOR_SHFT ); +uv_write_global_mmr64 (pnode,UVH_IPI_INT , val); }
@@ -137,22 +138,24 @@ static void uv_send_IPI_mask(const struct cpumask *mask, int vector)static void uv_send_IPI_mask_allbutself (const struct cpumask *mask,int vector) { -unsigned int cpu;unsigned int this_cpu =smp_processor_id (); +unsigned int cpu; -for_each_cpu (cpu, mask) +for_each_cpu (cpu, mask) {if (cpu != this_cpu)uv_send_IPI_one (cpu, vector); + } }static void uv_send_IPI_allbutself (int vector) { -unsigned int cpu;unsigned int this_cpu =smp_processor_id (); +unsigned int cpu; -for_each_online_cpu (cpu) +for_each_online_cpu (cpu) {if (cpu != this_cpu)uv_send_IPI_one (cpu, vector); + } }static void uv_send_IPI_all (int vector)
arch/x86/kernel/io_apic.c +5 -5
@@ -514,11 +514,11 @@ static void send_cleanup_vector(struct irq_cfg *cfg)for_each_cpu_and (i, cfg->old_domain, cpu_online_mask) cfg->move_cleanup_count++;for_each_cpu_and (i, cfg->old_domain, cpu_online_mask) -send_IPI_mask (cpumask_of (i),IRQ_MOVE_CLEANUP_VECTOR ); + apic->send_IPI_mask (cpumask_of (i),IRQ_MOVE_CLEANUP_VECTOR ); }else {cpumask_and (cleanup_mask, cfg->old_domain, cpu_online_mask); cfg->move_cleanup_count =cpumask_weight (cleanup_mask); -send_IPI_mask (cleanup_mask,IRQ_MOVE_CLEANUP_VECTOR ); + apic->send_IPI_mask (cleanup_mask,IRQ_MOVE_CLEANUP_VECTOR );free_cpumask_var (cleanup_mask); } cfg->move_in_progress =0 ;
@@ -800,7 +800,7 @@ static void clear_IO_APIC (void) }#if !defined(CONFIG_SMP ) && defined(CONFIG_X86_32 ) -void send_IPI_self (int vector) +void default_send_IPI_self (int vector) {unsigned int cfg;
@@ -2297,7 +2297,7 @@ static int ioapic_retrigger_irq(unsigned int irq)unsigned long flags;spin_lock_irqsave (&vector_lock, flags); -send_IPI_mask (cpumask_of (cpumask_first (cfg->domain)), cfg->vector); + apic->send_IPI_mask (cpumask_of (cpumask_first (cfg->domain)), cfg->vector);spin_unlock_irqrestore (&vector_lock, flags);return 1 ;
@@ -2305,7 +2305,7 @@ static int ioapic_retrigger_irq(unsigned int irq)#else static int ioapic_retrigger_irq (unsigned int irq) { -send_IPI_self (irq_cfg (irq)->vector); + apic->send_IPI_self (irq_cfg (irq)->vector);return 1 ; }
arch/x86/kernel/ipi.c +15 -13
@@ -48,7 +48,7 @@ static inline int __prepare_ICR2(unsigned int mask)return SET_APIC_DEST_FIELD (mask); } -void __send_IPI_shortcut (unsigned int shortcut,int vector) +void __default_send_IPI_shortcut (unsigned int shortcut,int vector) {/* * Subtle. In the case of the 'never do double writes' workaround
@@ -75,16 +75,16 @@ void __send_IPI_shortcut(unsigned int shortcut, int vector)apic_write (APIC_ICR , cfg); } -void send_IPI_self (int vector) +void default_send_IPI_self (int vector) { -__send_IPI_shortcut (APIC_DEST_SELF , vector); +__default_send_IPI_shortcut (APIC_DEST_SELF , vector); }/* * This is used to send an IPI with no shorthand notation (the destination is * specified in bits 56 to 63 of the ICR). */ -static inline void __send_IPI_dest_field (unsigned long mask,int vector) +static inline void __default_send_IPI_dest_field (unsigned long mask,int vector) {unsigned long cfg;
@@ -116,18 +116,18 @@ static inline void __send_IPI_dest_field(unsigned long mask, int vector)/* * This is only used on smaller machines. */ -void send_IPI_mask_bitmask (const struct cpumask *cpumask,int vector) +void default_send_IPI_mask_bitmask (const struct cpumask *cpumask,int vector) {unsigned long mask =cpumask_bits (cpumask)[0 ];unsigned long flags;local_irq_save (flags);WARN_ON (mask & ~cpumask_bits (cpu_online_mask)[0 ]); -__send_IPI_dest_field (mask, vector); +__default_send_IPI_dest_field (mask, vector);local_irq_restore (flags); } -void send_IPI_mask_sequence (const struct cpumask *mask,int vector) +void default_send_IPI_mask_sequence (const struct cpumask *mask,int vector) {unsigned long flags;unsigned int query_cpu;
@@ -140,11 +140,11 @@ void send_IPI_mask_sequence(const struct cpumask *mask, int vector)local_irq_save (flags);for_each_cpu (query_cpu, mask) -__send_IPI_dest_field (apic->cpu_to_logical_apicid (query_cpu), vector); +__default_send_IPI_dest_field (apic->cpu_to_logical_apicid (query_cpu), vector);local_irq_restore (flags); } -void send_IPI_mask_allbutself (const struct cpumask *mask,int vector) +void default_send_IPI_mask_allbutself (const struct cpumask *mask,int vector) {unsigned long flags;unsigned int query_cpu;
@@ -153,10 +153,12 @@ void send_IPI_mask_allbutself(const struct cpumask *mask, int vector)/* See Hack comment above */ local_irq_save (flags); -for_each_cpu (query_cpu, mask) -if (query_cpu != this_cpu) -__send_IPI_dest_field (apic->cpu_to_logical_apicid (query_cpu), - vector); +for_each_cpu (query_cpu, mask) { +if (query_cpu == this_cpu) +continue ; +__default_send_IPI_dest_field ( + apic->cpu_to_logical_apicid (query_cpu), vector); + }local_irq_restore (flags); }
arch/x86/kernel/kgdb.c +1 -1
@@ -347,7 +347,7 @@ void kgdb_post_primary_code(struct pt_regs *regs, int e_vector, int err_code)*/ void kgdb_roundup_cpus (unsigned long flags) { -send_IPI_allbutself (APIC_DM_NMI ); + apic->send_IPI_allbutself (APIC_DM_NMI ); }#endif
arch/x86/kernel/reboot.c +1 -1
@@ -651,7 +651,7 @@ static int crash_nmi_callback(struct notifier_block *self,static void smp_send_nmi_allbutself (void ) { -send_IPI_allbutself (NMI_VECTOR ); + apic->send_IPI_allbutself (NMI_VECTOR ); }static struct notifier_block crash_nmi_nb = {
arch/x86/kernel/smp.c +5 -5
@@ -118,12 +118,12 @@ static void native_smp_send_reschedule(int cpu)WARN_ON (1 );return ; } -send_IPI_mask (cpumask_of (cpu),RESCHEDULE_VECTOR ); + apic->send_IPI_mask (cpumask_of (cpu),RESCHEDULE_VECTOR ); }void native_send_call_func_single_ipi (int cpu) { -send_IPI_mask (cpumask_of (cpu),CALL_FUNCTION_SINGLE_VECTOR ); + apic->send_IPI_mask (cpumask_of (cpu),CALL_FUNCTION_SINGLE_VECTOR ); }void native_send_call_func_ipi (const struct cpumask *mask)
@@ -131,7 +131,7 @@ void native_send_call_func_ipi(const struct cpumask *mask)cpumask_var_t allbutself;if (!alloc_cpumask_var (&allbutself,GFP_ATOMIC )) { -send_IPI_mask (mask,CALL_FUNCTION_VECTOR ); + apic->send_IPI_mask (mask,CALL_FUNCTION_VECTOR );return ; }
@@ -140,9 +140,9 @@ void native_send_call_func_ipi(const struct cpumask *mask)if (cpumask_equal (mask, allbutself) &&cpumask_equal (cpu_online_mask, cpu_callout_mask)) -send_IPI_allbutself (CALL_FUNCTION_VECTOR ); + apic->send_IPI_allbutself (CALL_FUNCTION_VECTOR );else -send_IPI_mask (mask,CALL_FUNCTION_VECTOR ); + apic->send_IPI_mask (mask,CALL_FUNCTION_VECTOR );free_cpumask_var (allbutself); }
arch/x86/mach-generic/bigsmp.c +3 -3
@@ -97,10 +97,10 @@ struct genapic apic_bigsmp = { .cpu_mask_to_apicid = bigsmp_cpu_mask_to_apicid, .cpu_mask_to_apicid_and = bigsmp_cpu_mask_to_apicid_and, - .send_IPI_mask = send_IPI_mask, + .send_IPI_mask = default_send_IPI_mask, .send_IPI_mask_allbutself = NULL, - .send_IPI_allbutself = send_IPI_allbutself, - .send_IPI_all = send_IPI_all, + .send_IPI_allbutself = bigsmp_send_IPI_allbutself, + .send_IPI_all = bigsmp_send_IPI_all, .send_IPI_self = NULL, .wakeup_cpu = NULL,
arch/x86/mach-generic/default.c +3 -3
@@ -78,10 +78,10 @@ struct genapic apic_default = { .cpu_mask_to_apicid = default_cpu_mask_to_apicid, .cpu_mask_to_apicid_and = default_cpu_mask_to_apicid_and, - .send_IPI_mask = send_IPI_mask, + .send_IPI_mask = default_send_IPI_mask, .send_IPI_mask_allbutself = NULL, - .send_IPI_allbutself = send_IPI_allbutself, - .send_IPI_all = send_IPI_all, + .send_IPI_allbutself = default_send_IPI_allbutself, + .send_IPI_all = default_send_IPI_all, .send_IPI_self = NULL, .wakeup_cpu = NULL,
arch/x86/mach-generic/es7000.c +3 -3
@@ -133,10 +133,10 @@ struct genapic apic_es7000 = { .cpu_mask_to_apicid = es7000_cpu_mask_to_apicid, .cpu_mask_to_apicid_and = es7000_cpu_mask_to_apicid_and, - .send_IPI_mask = send_IPI_mask, + .send_IPI_mask = es7000_send_IPI_mask, .send_IPI_mask_allbutself = NULL, - .send_IPI_allbutself = send_IPI_allbutself, - .send_IPI_all = send_IPI_all, + .send_IPI_allbutself = es7000_send_IPI_allbutself, + .send_IPI_all = es7000_send_IPI_all, .send_IPI_self = NULL, .wakeup_cpu = NULL,
arch/x86/mach-generic/numaq.c +3 -3
@@ -97,10 +97,10 @@ struct genapic apic_numaq = { .cpu_mask_to_apicid = numaq_cpu_mask_to_apicid, .cpu_mask_to_apicid_and = numaq_cpu_mask_to_apicid_and, - .send_IPI_mask = send_IPI_mask, + .send_IPI_mask = numaq_send_IPI_mask, .send_IPI_mask_allbutself = NULL, - .send_IPI_allbutself = send_IPI_allbutself, - .send_IPI_all = send_IPI_all, + .send_IPI_allbutself = numaq_send_IPI_allbutself, + .send_IPI_all = numaq_send_IPI_all, .send_IPI_self = NULL, .wakeup_cpu = NULL,
arch/x86/mach-generic/summit.c +3 -3
@@ -77,10 +77,10 @@ struct genapic apic_summit = { .cpu_mask_to_apicid = summit_cpu_mask_to_apicid, .cpu_mask_to_apicid_and = summit_cpu_mask_to_apicid_and, - .send_IPI_mask = send_IPI_mask, + .send_IPI_mask = summit_send_IPI_mask, .send_IPI_mask_allbutself = NULL, - .send_IPI_allbutself = send_IPI_allbutself, - .send_IPI_all = send_IPI_all, + .send_IPI_allbutself = summit_send_IPI_allbutself, + .send_IPI_all = summit_send_IPI_all, .send_IPI_self = NULL, .wakeup_cpu = NULL,
arch/x86/mm/tlb.c +1 -1
@@ -196,7 +196,7 @@ static void flush_tlb_others_ipi(const struct cpumask *cpumask,* We have to send the IPI only to * CPUs affected. */ -send_IPI_mask (to_cpumask (f->flush_cpumask), + apic->send_IPI_mask (to_cpumask (f->flush_cpumask),INVALIDATE_TLB_VECTOR_START + sender);while (!cpumask_empty (to_cpumask (f->flush_cpumask)))
Signature · 1 line
1.6.0.2
PATCH 60/114 x86, smp: clean up ->trampoline_phys_low/high handling
In reply to Ingo Molnar- spread out the namespace on a per apic driver basis
- remove wrapper macros
--- arch/x86/include/asm/es7000/wakecpu.h | 4 ++-- arch/x86/include/asm/mach-default/mach_wakecpu.h | 4 ++-- arch/x86/include/asm/mach-default/smpboot_hooks.h | 6 +++--- arch/x86/include/asm/mach-generic/mach_wakecpu.h | 2 -- arch/x86/include/asm/numaq/wakecpu.h | 12 ++++++------ arch/x86/mach-generic/bigsmp.c | 4 ++-- arch/x86/mach-generic/default.c | 4 ++-- arch/x86/mach-generic/es7000.c | 4 ++-- arch/x86/mach-generic/numaq.c | 4 ++-- arch/x86/mach-generic/summit.c | 4 ++-- 10 files changed, 23 insertions(+), 25 deletions(-)
arch/x86/include/asm/es7000/wakecpu.h +2 -2
@@ -1,8 +1,8 @@#ifndef __ASM_ES7000_WAKECPU_H#define __ASM_ES7000_WAKECPU_H -#define TRAMPOLINE_PHYS_LOW 0x467 -#define TRAMPOLINE_PHYS_HIGH 0x469 +#define ES7000_TRAMPOLINE_PHYS_LOW 0x467 +#define ES7000_TRAMPOLINE_PHYS_HIGH 0x469static inline void wait_for_init_deassert (atomic_t *deassert) {
arch/x86/include/asm/mach-default/mach_wakecpu.h +2 -2
@@ -1,8 +1,8 @@#ifndef _ASM_X86_MACH_DEFAULT_MACH_WAKECPU_H#define _ASM_X86_MACH_DEFAULT_MACH_WAKECPU_H -#define TRAMPOLINE_PHYS_LOW (0x467) -#define TRAMPOLINE_PHYS_HIGH (0x469) +#define DEFAULT_TRAMPOLINE_PHYS_LOW (0x467) +#define DEFAULT_TRAMPOLINE_PHYS_HIGH (0x469)static inline void wait_for_init_deassert (atomic_t *deassert) {
arch/x86/include/asm/mach-default/smpboot_hooks.h +3 -3
@@ -13,10 +13,10 @@ static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip)CMOS_WRITE (0xa ,0xf );local_flush_tlb ();pr_debug ("1.\n" ); - *((volatile unsigned short *)phys_to_virt (TRAMPOLINE_PHYS_HIGH )) = + *((volatile unsigned short *)phys_to_virt (apic->trampoline_phys_high)) = start_eip >>4 ;pr_debug ("2.\n" ); - *((volatile unsigned short *)phys_to_virt (TRAMPOLINE_PHYS_LOW )) = + *((volatile unsigned short *)phys_to_virt (apic->trampoline_phys_low)) = start_eip &0xf ;pr_debug ("3.\n" ); }
@@ -34,7 +34,7 @@ static inline void smpboot_restore_warm_reset_vector(void)*/ CMOS_WRITE (0 ,0xf ); - *((volatile long *)phys_to_virt (TRAMPOLINE_PHYS_LOW )) =0 ; + *((volatile long *)phys_to_virt (apic->trampoline_phys_low)) =0 ; }static inline void __init smpboot_setup_io_apic (void )
arch/x86/include/asm/mach-generic/mach_wakecpu.h +0 -2
@@ -1,8 +1,6 @@#ifndef _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H#define _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H -#define TRAMPOLINE_PHYS_LOW (apic->trampoline_phys_low) -#define TRAMPOLINE_PHYS_HIGH (apic->trampoline_phys_high)#define wait_for_init_deassert (apic->wait_for_init_deassert)#define smp_callin_clear_local_apic (apic->smp_callin_clear_local_apic)#define store_NMI_vector (apic->store_NMI_vector)
arch/x86/include/asm/numaq/wakecpu.h +6 -6
@@ -3,8 +3,8 @@/* This file copes with machines that wakeup secondary CPUs by NMIs */ -#define TRAMPOLINE_PHYS_LOW (0x8) -#define TRAMPOLINE_PHYS_HIGH (0xa) +#define NUMAQ_TRAMPOLINE_PHYS_LOW (0x8) +#define NUMAQ_TRAMPOLINE_PHYS_HIGH (0xa)/* We don't do anything here because we use NMI's to boot instead */ static inline void wait_for_init_deassert (atomic_t *deassert)
@@ -24,17 +24,17 @@ static inline void store_NMI_vector(unsigned short *high, unsigned short *low) {printk ("Storing NMI vector\n" ); *high = - *((volatile unsigned short *)phys_to_virt (TRAMPOLINE_PHYS_HIGH )); + *((volatile unsigned short *)phys_to_virt (NUMAQ_TRAMPOLINE_PHYS_HIGH )); *low = - *((volatile unsigned short *)phys_to_virt (TRAMPOLINE_PHYS_LOW )); + *((volatile unsigned short *)phys_to_virt (NUMAQ_TRAMPOLINE_PHYS_LOW )); }static inline void restore_NMI_vector (unsigned short *high,unsigned short *low) {printk ("Restoring NMI vector\n" ); - *((volatile unsigned short *)phys_to_virt (TRAMPOLINE_PHYS_HIGH )) = + *((volatile unsigned short *)phys_to_virt (NUMAQ_TRAMPOLINE_PHYS_HIGH )) = *high; - *((volatile unsigned short *)phys_to_virt (TRAMPOLINE_PHYS_LOW )) = + *((volatile unsigned short *)phys_to_virt (NUMAQ_TRAMPOLINE_PHYS_LOW )) = *low; }
arch/x86/mach-generic/bigsmp.c +2 -2
@@ -104,8 +104,8 @@ struct genapic apic_bigsmp = { .send_IPI_self = NULL, .wakeup_cpu = NULL, - .trampoline_phys_low = TRAMPOLINE_PHYS_LOW, - .trampoline_phys_high = TRAMPOLINE_PHYS_HIGH, + .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, + .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, .wait_for_init_deassert = wait_for_init_deassert, .smp_callin_clear_local_apic = smp_callin_clear_local_apic, .store_NMI_vector = store_NMI_vector,
arch/x86/mach-generic/default.c +2 -2
@@ -85,8 +85,8 @@ struct genapic apic_default = { .send_IPI_self = NULL, .wakeup_cpu = NULL, - .trampoline_phys_low = TRAMPOLINE_PHYS_LOW, - .trampoline_phys_high = TRAMPOLINE_PHYS_HIGH, + .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, + .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, .wait_for_init_deassert = wait_for_init_deassert, .smp_callin_clear_local_apic = smp_callin_clear_local_apic, .store_NMI_vector = store_NMI_vector,
arch/x86/mach-generic/es7000.c +2 -2
@@ -140,8 +140,8 @@ struct genapic apic_es7000 = { .send_IPI_self = NULL, .wakeup_cpu = NULL, - .trampoline_phys_low = TRAMPOLINE_PHYS_LOW, - .trampoline_phys_high = TRAMPOLINE_PHYS_HIGH, + .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, + .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, .wait_for_init_deassert = wait_for_init_deassert, .smp_callin_clear_local_apic = smp_callin_clear_local_apic, .store_NMI_vector = store_NMI_vector,
arch/x86/mach-generic/numaq.c +2 -2
@@ -104,8 +104,8 @@ struct genapic apic_numaq = { .send_IPI_self = NULL, .wakeup_cpu = NULL, - .trampoline_phys_low = TRAMPOLINE_PHYS_LOW, - .trampoline_phys_high = TRAMPOLINE_PHYS_HIGH, + .trampoline_phys_low = NUMAQ_TRAMPOLINE_PHYS_LOW, + .trampoline_phys_high = NUMAQ_TRAMPOLINE_PHYS_HIGH, .wait_for_init_deassert = wait_for_init_deassert, .smp_callin_clear_local_apic = smp_callin_clear_local_apic, .store_NMI_vector = store_NMI_vector,
arch/x86/mach-generic/summit.c +2 -2
@@ -84,8 +84,8 @@ struct genapic apic_summit = { .send_IPI_self = NULL, .wakeup_cpu = NULL, - .trampoline_phys_low = TRAMPOLINE_PHYS_LOW, - .trampoline_phys_high = TRAMPOLINE_PHYS_HIGH, + .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, + .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, .wait_for_init_deassert = wait_for_init_deassert, .smp_callin_clear_local_apic = smp_callin_clear_local_apic, .store_NMI_vector = store_NMI_vector,
Signature · 1 line
1.6.0.2
PATCH 61/114 x86: set ->trampoline_phys_low/high on 64-bit too
In reply to Ingo Molnar64-bit x86 has zero for ->trampoline_phys_low/high, but the smpboot code can use these values - so it's better to set them up to their correct values.
--- arch/x86/include/asm/genapic.h | 6 ++++++ arch/x86/include/asm/mach-default/mach_wakecpu.h | 3 --- arch/x86/kernel/genapic_flat_64.c | 8 ++++---- arch/x86/kernel/genx2apic_cluster.c | 4 ++-- arch/x86/kernel/genx2apic_phys.c | 4 ++-- arch/x86/kernel/genx2apic_uv_x.c | 4 ++-- 6 files changed, 16 insertions(+), 13 deletions(-)
arch/x86/include/asm/genapic.h +6 -0
@@ -88,6 +88,12 @@ struct genapic {extern struct genapic *apic; +/* +* Warm reset vector default position: +*/ +#define DEFAULT_TRAMPOLINE_PHYS_LOW 0x467 +#define DEFAULT_TRAMPOLINE_PHYS_HIGH 0x469 +#ifdef CONFIG_X86_32 extern void es7000_update_genapic_to_cluster (void );#else
arch/x86/include/asm/mach-default/mach_wakecpu.h +0 -3
@@ -1,9 +1,6 @@#ifndef _ASM_X86_MACH_DEFAULT_MACH_WAKECPU_H#define _ASM_X86_MACH_DEFAULT_MACH_WAKECPU_H -#define DEFAULT_TRAMPOLINE_PHYS_LOW (0x467) -#define DEFAULT_TRAMPOLINE_PHYS_HIGH (0x469) -static inline void wait_for_init_deassert (atomic_t *deassert) {while (!atomic_read (deassert))
arch/x86/kernel/genapic_flat_64.c +4 -4
@@ -224,8 +224,8 @@ struct genapic apic_flat = { .send_IPI_self = apic_send_IPI_self, .wakeup_cpu = NULL, - .trampoline_phys_low = 0, - .trampoline_phys_high = 0, + .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, + .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, .wait_for_init_deassert = NULL, .smp_callin_clear_local_apic = NULL, .store_NMI_vector = NULL,
@@ -370,8 +370,8 @@ struct genapic apic_physflat = { .send_IPI_self = apic_send_IPI_self, .wakeup_cpu = NULL, - .trampoline_phys_low = 0, - .trampoline_phys_high = 0, + .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, + .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, .wait_for_init_deassert = NULL, .smp_callin_clear_local_apic = NULL, .store_NMI_vector = NULL,
arch/x86/kernel/genx2apic_cluster.c +2 -2
@@ -228,8 +228,8 @@ struct genapic apic_x2apic_cluster = { .send_IPI_self = x2apic_send_IPI_self, .wakeup_cpu = NULL, - .trampoline_phys_low = 0, - .trampoline_phys_high = 0, + .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, + .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, .wait_for_init_deassert = NULL, .smp_callin_clear_local_apic = NULL, .store_NMI_vector = NULL,
arch/x86/kernel/genx2apic_phys.c +2 -2
@@ -214,8 +214,8 @@ struct genapic apic_x2apic_phys = { .send_IPI_self = x2apic_send_IPI_self, .wakeup_cpu = NULL, - .trampoline_phys_low = 0, - .trampoline_phys_high = 0, + .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, + .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, .wait_for_init_deassert = NULL, .smp_callin_clear_local_apic = NULL, .store_NMI_vector = NULL,
arch/x86/kernel/genx2apic_uv_x.c +2 -2
@@ -287,8 +287,8 @@ struct genapic apic_x2apic_uv_x = { .send_IPI_self = uv_send_IPI_self, .wakeup_cpu = NULL, - .trampoline_phys_low = 0, - .trampoline_phys_high = 0, + .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, + .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, .wait_for_init_deassert = NULL, .smp_callin_clear_local_apic = NULL, .store_NMI_vector = NULL,
Signature · 1 line
1.6.0.2
PATCH 62/114 x86, smp: refactor ->wait_for_init_deassert()
In reply to Ingo Molnar- spread out the namespace on a per APIC driver basis
- handle a NULL ->wait_for_init_deassert() as a 'dont wait' default method
- remove NUMAQ and Summit handlers
--- arch/x86/include/asm/es7000/wakecpu.h | 2 +- arch/x86/include/asm/mach-default/mach_wakecpu.h | 2 +- arch/x86/include/asm/mach-generic/mach_wakecpu.h | 1 - arch/x86/include/asm/numaq/wakecpu.h | 5 ----- arch/x86/kernel/es7000_32.c | 6 +----- arch/x86/kernel/smpboot.c | 3 ++- arch/x86/mach-generic/bigsmp.c | 4 +++- arch/x86/mach-generic/default.c | 4 +++- arch/x86/mach-generic/es7000.c | 4 +++- arch/x86/mach-generic/numaq.c | 5 ++++- arch/x86/mach-generic/summit.c | 4 +++- 11 files changed, 21 insertions(+), 19 deletions(-)
arch/x86/include/asm/es7000/wakecpu.h +1 -1
@@ -4,7 +4,7 @@#define ES7000_TRAMPOLINE_PHYS_LOW 0x467#define ES7000_TRAMPOLINE_PHYS_HIGH 0x469 -static inline void wait_for_init_deassert (atomic_t *deassert) +static inline void es7000_wait_for_init_deassert (atomic_t *deassert) {#ifndef CONFIG_ES7000_CLUSTERED_APIC while (!atomic_read (deassert))
arch/x86/include/asm/mach-default/mach_wakecpu.h +1 -1
@@ -1,7 +1,7 @@#ifndef _ASM_X86_MACH_DEFAULT_MACH_WAKECPU_H#define _ASM_X86_MACH_DEFAULT_MACH_WAKECPU_H -static inline void wait_for_init_deassert (atomic_t *deassert) +static inline void default_wait_for_init_deassert (atomic_t *deassert) {while (!atomic_read (deassert))cpu_relax ();
arch/x86/include/asm/mach-generic/mach_wakecpu.h +0 -1
@@ -1,7 +1,6 @@#ifndef _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H#define _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H -#define wait_for_init_deassert (apic->wait_for_init_deassert)#define smp_callin_clear_local_apic (apic->smp_callin_clear_local_apic)#define store_NMI_vector (apic->store_NMI_vector)#define restore_NMI_vector (apic->restore_NMI_vector)
arch/x86/include/asm/numaq/wakecpu.h +0 -5
@@ -6,11 +6,6 @@#define NUMAQ_TRAMPOLINE_PHYS_LOW (0x8)#define NUMAQ_TRAMPOLINE_PHYS_HIGH (0xa) -/* We don't do anything here because we use NMI's to boot instead */ -static inline void wait_for_init_deassert (atomic_t *deassert) -{ -} -/* * Because we use NMIs rather than the INIT-STARTUP sequence to * bootstrap the CPUs, the APIC may be in a weird state. Kick it.
arch/x86/kernel/es7000_32.c +1 -5
@@ -182,10 +182,6 @@ static int wakeup_secondary_cpu_via_mip(int cpu, unsigned long eip)return 0 ; } -static void noop_wait_for_deassert (atomic_t *deassert_not_used) -{ -} -static int __init es7000_update_genapic (void ) { apic->wakeup_cpu = wakeup_secondary_cpu_via_mip;
@@ -194,7 +190,7 @@ static int __init es7000_update_genapic(void)if (boot_cpu_data.x86 ==6 && (boot_cpu_data.x86_model >=7 || boot_cpu_data.x86_model <=11 )) {es7000_update_genapic_to_cluster (); - apic->wait_for_init_deassert = noop_wait_for_deassert; + apic->wait_for_init_deassert =NULL ; apic->wakeup_cpu = wakeup_secondary_cpu_via_mip; }
arch/x86/kernel/smpboot.c +2 -1
@@ -196,7 +196,8 @@ static void __cpuinit smp_callin(void)* our local APIC. We have to wait for the IPI or we'll * lock up on an APIC access. */ -wait_for_init_deassert (&init_deasserted); +if (apic->wait_for_init_deassert) + apic->wait_for_init_deassert (&init_deasserted);/* * (This works even if the APIC is not enabled.)
arch/x86/mach-generic/bigsmp.c +3 -1
@@ -106,7 +106,9 @@ struct genapic apic_bigsmp = { .wakeup_cpu = NULL, .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, - .wait_for_init_deassert = wait_for_init_deassert, + + .wait_for_init_deassert = default_wait_for_init_deassert, + .smp_callin_clear_local_apic = smp_callin_clear_local_apic, .store_NMI_vector = store_NMI_vector, .restore_NMI_vector = restore_NMI_vector,
arch/x86/mach-generic/default.c +3 -1
@@ -87,7 +87,9 @@ struct genapic apic_default = { .wakeup_cpu = NULL, .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, - .wait_for_init_deassert = wait_for_init_deassert, + + .wait_for_init_deassert = default_wait_for_init_deassert, + .smp_callin_clear_local_apic = smp_callin_clear_local_apic, .store_NMI_vector = store_NMI_vector, .restore_NMI_vector = restore_NMI_vector,
arch/x86/mach-generic/es7000.c +3 -1
@@ -142,7 +142,9 @@ struct genapic apic_es7000 = { .wakeup_cpu = NULL, .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, - .wait_for_init_deassert = wait_for_init_deassert, + + .wait_for_init_deassert = default_wait_for_init_deassert, + .smp_callin_clear_local_apic = smp_callin_clear_local_apic, .store_NMI_vector = store_NMI_vector, .restore_NMI_vector = restore_NMI_vector,
arch/x86/mach-generic/numaq.c +4 -1
@@ -106,7 +106,10 @@ struct genapic apic_numaq = { .wakeup_cpu = NULL, .trampoline_phys_low = NUMAQ_TRAMPOLINE_PHYS_LOW, .trampoline_phys_high = NUMAQ_TRAMPOLINE_PHYS_HIGH, - .wait_for_init_deassert = wait_for_init_deassert, + +/* We don't do anything here because we use NMI's to boot instead */ + .wait_for_init_deassert = NULL, + .smp_callin_clear_local_apic = smp_callin_clear_local_apic, .store_NMI_vector = store_NMI_vector, .restore_NMI_vector = restore_NMI_vector,
arch/x86/mach-generic/summit.c +3 -1
@@ -86,7 +86,9 @@ struct genapic apic_summit = { .wakeup_cpu = NULL, .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, - .wait_for_init_deassert = wait_for_init_deassert, + + .wait_for_init_deassert = default_wait_for_init_deassert, + .smp_callin_clear_local_apic = smp_callin_clear_local_apic, .store_NMI_vector = store_NMI_vector, .restore_NMI_vector = restore_NMI_vector,
Signature · 1 line
1.6.0.2
PATCH 63/114 x86, smp: refactor ->smp_callin_clear_local_apic() methods
In reply to Ingo MolnarOnly NUMAQ does something substantial here, because it initializes via NMIs (not via INIT as standard SMP startup) - so it needs to reset the APIC.
- extend the generic code to handle NULL methods
- clear out dummy methods and replace them with NULL
- clean up: remove wrapper macros, etc.
--- arch/x86/include/asm/es7000/wakecpu.h | 5 ----- arch/x86/include/asm/mach-default/mach_wakecpu.h | 5 ----- arch/x86/include/asm/mach-generic/mach_wakecpu.h | 1 - arch/x86/include/asm/numaq/wakecpu.h | 4 ++-- arch/x86/kernel/smpboot.c | 3 ++- arch/x86/mach-generic/bigsmp.c | 3 ++- arch/x86/mach-generic/default.c | 2 +- arch/x86/mach-generic/es7000.c | 4 +++- arch/x86/mach-generic/numaq.c | 2 +- arch/x86/mach-generic/summit.c | 3 ++- 10 files changed, 13 insertions(+), 19 deletions(-)
arch/x86/include/asm/es7000/wakecpu.h +0 -5
@@ -13,11 +13,6 @@ static inline void es7000_wait_for_init_deassert(atomic_t *deassert)return ; } -/* Nothing to do for most platforms, since cleared by the INIT cycle */ -static inline void smp_callin_clear_local_apic (void ) -{ -} -static inline void store_NMI_vector (unsigned short *high,unsigned short *low) { }
arch/x86/include/asm/mach-default/mach_wakecpu.h +0 -5
@@ -8,11 +8,6 @@ static inline void default_wait_for_init_deassert(atomic_t *deassert)return ; } -/* Nothing to do for most platforms, since cleared by the INIT cycle */ -static inline void smp_callin_clear_local_apic (void ) -{ -} -static inline void store_NMI_vector (unsigned short *high,unsigned short *low) { }
arch/x86/include/asm/mach-generic/mach_wakecpu.h +0 -1
@@ -1,7 +1,6 @@#ifndef _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H#define _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H -#define smp_callin_clear_local_apic (apic->smp_callin_clear_local_apic)#define store_NMI_vector (apic->store_NMI_vector)#define restore_NMI_vector (apic->restore_NMI_vector)#define inquire_remote_apic (apic->inquire_remote_apic)
arch/x86/include/asm/numaq/wakecpu.h +2 -2
@@ -8,9 +8,9 @@/* * Because we use NMIs rather than the INIT-STARTUP sequence to -* bootstrap the CPUs, the APIC may be in a weird state. Kick it. +* bootstrap the CPUs, the APIC may be in a weird state. Kick it: */ -static inline void smp_callin_clear_local_apic (void ) +static inline void numaq_smp_callin_clear_local_apic (void ) {clear_local_APIC (); }
arch/x86/kernel/smpboot.c +2 -1
@@ -244,7 +244,8 @@ static void __cpuinit smp_callin(void)*/ pr_debug ("CALLIN, before setup_local_APIC().\n" ); -smp_callin_clear_local_apic (); +if (apic->smp_callin_clear_local_apic) + apic->smp_callin_clear_local_apic ();setup_local_APIC ();end_local_APIC_setup ();map_cpu_to_logical_apicid ();
arch/x86/mach-generic/bigsmp.c +2 -1
@@ -109,7 +109,8 @@ struct genapic apic_bigsmp = { .wait_for_init_deassert = default_wait_for_init_deassert, - .smp_callin_clear_local_apic = smp_callin_clear_local_apic, + .smp_callin_clear_local_apic = NULL, + .store_NMI_vector = store_NMI_vector, .restore_NMI_vector = restore_NMI_vector, .inquire_remote_apic = inquire_remote_apic,
arch/x86/mach-generic/default.c +1 -1
@@ -90,7 +90,7 @@ struct genapic apic_default = { .wait_for_init_deassert = default_wait_for_init_deassert, - .smp_callin_clear_local_apic = smp_callin_clear_local_apic, + .smp_callin_clear_local_apic = NULL, .store_NMI_vector = store_NMI_vector, .restore_NMI_vector = restore_NMI_vector, .inquire_remote_apic = inquire_remote_apic,
arch/x86/mach-generic/es7000.c +3 -1
@@ -145,7 +145,9 @@ struct genapic apic_es7000 = { .wait_for_init_deassert = default_wait_for_init_deassert, - .smp_callin_clear_local_apic = smp_callin_clear_local_apic, +/* 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, .inquire_remote_apic = inquire_remote_apic,
arch/x86/mach-generic/numaq.c +1 -1
@@ -110,7 +110,7 @@ struct genapic apic_numaq = {/* We don't do anything here because we use NMI's to boot instead */ .wait_for_init_deassert = NULL, - .smp_callin_clear_local_apic = smp_callin_clear_local_apic, + .smp_callin_clear_local_apic = numaq_smp_callin_clear_local_apic, .store_NMI_vector = store_NMI_vector, .restore_NMI_vector = restore_NMI_vector, .inquire_remote_apic = inquire_remote_apic,
arch/x86/mach-generic/summit.c +2 -1
@@ -89,7 +89,8 @@ struct genapic apic_summit = { .wait_for_init_deassert = default_wait_for_init_deassert, - .smp_callin_clear_local_apic = smp_callin_clear_local_apic, + .smp_callin_clear_local_apic = NULL, + .store_NMI_vector = store_NMI_vector, .restore_NMI_vector = restore_NMI_vector, .inquire_remote_apic = inquire_remote_apic,
Signature · 1 line
1.6.0.2
PATCH 64/114 x86, smp: refactor ->store/restore_NMI_vector() methods
In reply to Ingo MolnarOnly 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.
--- arch/x86/include/asm/es7000/wakecpu.h | 8 -------- arch/x86/include/asm/mach-default/mach_wakecpu.h | 8 -------- arch/x86/include/asm/mach-generic/mach_wakecpu.h | 2 -- arch/x86/include/asm/numaq/wakecpu.h | 6 ++++-- arch/x86/kernel/smpboot.c | 3 ++- arch/x86/mach-generic/bigsmp.c | 5 ++--- arch/x86/mach-generic/default.c | 4 ++-- arch/x86/mach-generic/es7000.c | 5 ++--- arch/x86/mach-generic/numaq.c | 4 ++-- arch/x86/mach-generic/summit.c | 5 ++--- 10 files changed, 16 insertions(+), 34 deletions(-)
arch/x86/include/asm/es7000/wakecpu.h +0 -8
@@ -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)
arch/x86/include/asm/mach-default/mach_wakecpu.h +0 -8
@@ -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 */
arch/x86/include/asm/mach-generic/mach_wakecpu.h +0 -2
@@ -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 */
arch/x86/include/asm/numaq/wakecpu.h +4 -2
@@ -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 =
@@ -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)) =
arch/x86/kernel/smpboot.c +2 -1
@@ -826,7 +826,8 @@ do_rest: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);/*
arch/x86/mach-generic/bigsmp.c +2 -3
@@ -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, };
arch/x86/mach-generic/default.c +2 -2
@@ -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, };
arch/x86/mach-generic/es7000.c +2 -3
@@ -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, };
arch/x86/mach-generic/numaq.c +2 -2
@@ -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, };
arch/x86/mach-generic/summit.c +2 -3
@@ -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, };
Signature · 1 line
1.6.0.2
PATCH 65/114 x86, smp: remove ->restore_NMI_vector()
In reply to Ingo MolnarNothing actually restores the NMI vector - so remove this logic altogether.
--- arch/x86/include/asm/genapic.h | 1 - arch/x86/include/asm/numaq/wakecpu.h | 10 ---------- arch/x86/kernel/genapic_flat_64.c | 2 -- arch/x86/kernel/genx2apic_cluster.c | 1 - arch/x86/kernel/genx2apic_phys.c | 1 - arch/x86/kernel/genx2apic_uv_x.c | 1 - arch/x86/mach-generic/bigsmp.c | 1 - arch/x86/mach-generic/default.c | 1 - arch/x86/mach-generic/es7000.c | 1 - arch/x86/mach-generic/numaq.c | 1 - arch/x86/mach-generic/summit.c | 1 - 11 files changed, 0 insertions(+), 21 deletions(-)
arch/x86/include/asm/genapic.h +0 -1
@@ -82,7 +82,6 @@ struct genapic {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); };
arch/x86/include/asm/numaq/wakecpu.h +0 -10
@@ -25,16 +25,6 @@ numaq_store_NMI_vector(unsigned short *high, unsigned short *low) *((volatile unsigned short *)phys_to_virt (NUMAQ_TRAMPOLINE_PHYS_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 )) = - *high; - *((volatile unsigned short *)phys_to_virt (NUMAQ_TRAMPOLINE_PHYS_LOW )) = - *low; -} -static inline void inquire_remote_apic (int apicid) { }
arch/x86/kernel/genapic_flat_64.c +0 -2
@@ -229,7 +229,6 @@ struct genapic apic_flat = { .wait_for_init_deassert = NULL, .smp_callin_clear_local_apic = NULL, .store_NMI_vector = NULL, - .restore_NMI_vector = NULL, .inquire_remote_apic = NULL, };
@@ -375,6 +374,5 @@ struct genapic apic_physflat = { .wait_for_init_deassert = NULL, .smp_callin_clear_local_apic = NULL, .store_NMI_vector = NULL, - .restore_NMI_vector = NULL, .inquire_remote_apic = NULL, };
arch/x86/kernel/genx2apic_cluster.c +0 -1
@@ -233,6 +233,5 @@ struct genapic apic_x2apic_cluster = { .wait_for_init_deassert = NULL, .smp_callin_clear_local_apic = NULL, .store_NMI_vector = NULL, - .restore_NMI_vector = NULL, .inquire_remote_apic = NULL, };
arch/x86/kernel/genx2apic_phys.c +0 -1
@@ -219,6 +219,5 @@ struct genapic apic_x2apic_phys = { .wait_for_init_deassert = NULL, .smp_callin_clear_local_apic = NULL, .store_NMI_vector = NULL, - .restore_NMI_vector = NULL, .inquire_remote_apic = NULL, };
arch/x86/kernel/genx2apic_uv_x.c +0 -1
@@ -292,7 +292,6 @@ struct genapic apic_x2apic_uv_x = { .wait_for_init_deassert = NULL, .smp_callin_clear_local_apic = NULL, .store_NMI_vector = NULL, - .restore_NMI_vector = NULL, .inquire_remote_apic = NULL, };
arch/x86/mach-generic/bigsmp.c +0 -1
@@ -111,6 +111,5 @@ struct genapic apic_bigsmp = { .smp_callin_clear_local_apic = NULL, .store_NMI_vector = NULL, - .restore_NMI_vector = NULL, .inquire_remote_apic = inquire_remote_apic, };
arch/x86/mach-generic/default.c +0 -1
@@ -92,6 +92,5 @@ struct genapic apic_default = { .smp_callin_clear_local_apic = NULL, .store_NMI_vector = NULL, - .restore_NMI_vector = NULL, .inquire_remote_apic = inquire_remote_apic, };
arch/x86/mach-generic/es7000.c +0 -1
@@ -148,6 +148,5 @@ 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 = NULL, - .restore_NMI_vector = NULL, .inquire_remote_apic = inquire_remote_apic, };
arch/x86/mach-generic/numaq.c +0 -1
@@ -112,6 +112,5 @@ struct genapic apic_numaq = { .smp_callin_clear_local_apic = numaq_smp_callin_clear_local_apic, .store_NMI_vector = numaq_store_NMI_vector, - .restore_NMI_vector = numaq_restore_NMI_vector, .inquire_remote_apic = inquire_remote_apic, };
arch/x86/mach-generic/summit.c +0 -1
@@ -91,6 +91,5 @@ struct genapic apic_summit = { .smp_callin_clear_local_apic = NULL, .store_NMI_vector = NULL, - .restore_NMI_vector = NULL, .inquire_remote_apic = inquire_remote_apic, };
Signature · 1 line
1.6.0.2