* [PATCH 001/114] x86, genapic: refactor genapic_64.h
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 002/114] x86, genapic: refactor genapic_32.h Ingo Molnar
` (114 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
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.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/genapic_64.h | 68 ++++++++++++++++++++++++++++++++-----
1 files changed, 59 insertions(+), 9 deletions(-)
diff --git a/arch/x86/include/asm/genapic_64.h b/arch/x86/include/asm/genapic_64.h
index 7bb092c..0a5f712 100644
--- a/arch/x86/include/asm/genapic_64.h
+++ b/arch/x86/include/asm/genapic_64.h
@@ -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;
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 002/114] x86, genapic: refactor genapic_32.h
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
2009-01-28 23:41 ` [PATCH 001/114] x86, genapic: refactor genapic_64.h Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 003/114] x86, genapic: unify struct genapic Ingo Molnar
` (113 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Impact: 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.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/genapic_32.h | 37 +++++++++++++++++++++++++++----------
1 files changed, 27 insertions(+), 10 deletions(-)
diff --git a/arch/x86/include/asm/genapic_32.h b/arch/x86/include/asm/genapic_32.h
index 4334502..5808b7d 100644
--- a/arch/x86/include/asm/genapic_32.h
+++ b/arch/x86/include/asm/genapic_32.h
@@ -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);
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 003/114] x86, genapic: unify struct genapic
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
2009-01-28 23:41 ` [PATCH 001/114] x86, genapic: refactor genapic_64.h Ingo Molnar
2009-01-28 23:41 ` [PATCH 002/114] x86, genapic: refactor genapic_32.h Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 004/114] x86, genapic: finish unification Ingo Molnar
` (112 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Move over the (now identical) struct genapic definitions from
genapic_32/64.h to genapic.h.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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%)
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h
index d48bee6..3dea66a 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -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 */
diff --git a/arch/x86/include/asm/genapic_32.h b/arch/x86/include/asm/genapic_32.h
index 5808b7d..a56785e 100644
--- a/arch/x86/include/asm/genapic_32.h
+++ b/arch/x86/include/asm/genapic_32.h
@@ -4,99 +4,6 @@
#include <asm/mpspec.h>
#include <asm/atomic.h>
-/*
- * Generic APIC driver interface.
- *
- * An straight forward mapping of the APIC related parts of the
- * x86 subarchitecture interface to a dynamic object.
- *
- * This is used by the "generic" x86 subarchitecture.
- *
- * Copyright 2003 Andi Kleen, SuSE Labs.
- */
-
-struct mpc_bus;
-struct mpc_table;
-struct mpc_cpu;
-
-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);
-};
-
#define APICFUNC(x) .x = x,
/* More functions could be probably marked IPIFUNC and save some space
diff --git a/arch/x86/include/asm/genapic_64.h b/arch/x86/include/asm/genapic_64.h
dissimilarity index 84%
index 0a5f712..c70ca0d 100644
--- a/arch/x86/include/asm/genapic_64.h
+++ b/arch/x86/include/asm/genapic_64.h
@@ -1,110 +1,19 @@
-#ifndef _ASM_X86_GENAPIC_64_H
-#define _ASM_X86_GENAPIC_64_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);
-};
-
-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 */
+#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 */
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 004/114] x86, genapic: finish unification
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (2 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 003/114] x86, genapic: unify struct genapic Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 005/114] x86, genapic: cleanups Ingo Molnar
` (111 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Unify remaining bits of genapic_32/64.h.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h
index 3dea66a..7df1b48 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -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 */
diff --git a/arch/x86/include/asm/genapic_32.h b/arch/x86/include/asm/genapic_32.h
deleted file mode 100644
index a56785e..0000000
--- a/arch/x86/include/asm/genapic_32.h
+++ /dev/null
@@ -1,65 +0,0 @@
-#ifndef _ASM_X86_GENAPIC_32_H
-#define _ASM_X86_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
-#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);
-
-#endif /* _ASM_X86_GENAPIC_32_H */
diff --git a/arch/x86/include/asm/genapic_64.h b/arch/x86/include/asm/genapic_64.h
deleted file mode 100644
index c70ca0d..0000000
--- a/arch/x86/include/asm/genapic_64.h
+++ /dev/null
@@ -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 */
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 005/114] x86, genapic: cleanups
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (3 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 004/114] x86, genapic: finish unification Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 006/114] x86, genapic: provide IPI callbacks unconditionally Ingo Molnar
` (110 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Unify genapic.h some more.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/genapic.h | 17 ++++++++---------
1 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h
index 7df1b48..19a5193 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -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;
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 006/114] x86, genapic: provide IPI callbacks unconditionally
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (4 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 005/114] x86, genapic: cleanups Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 007/114] x86: rename 'genapic' to 'apic' Ingo Molnar
` (109 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
64-bit x86 uses the IPI callbacks even on UP - so provide them
generally.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/genapic.h | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h
index 19a5193..c27efde 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -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);
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 007/114] x86: rename 'genapic' to 'apic'
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (5 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 006/114] x86, genapic: provide IPI callbacks unconditionally Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 008/114] x86: clean up genapic_flat Ingo Molnar
` (108 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Rename 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.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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%)
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h
index c27efde..3970da3 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -94,7 +94,7 @@ struct genapic {
void (*inquire_remote_apic)(int apicid);
};
-extern struct genapic *genapic;
+extern struct genapic *apic;
#ifdef CONFIG_X86_32
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index cc09cbb..2448b92 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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
diff --git a/arch/x86/include/asm/mach-default/mach_apicdef.h b/arch/x86/include/asm/mach-default/mach_apicdef.h
index 5317993..b4dcc09 100644
--- a/arch/x86/include/asm/mach-default/mach_apicdef.h
+++ b/arch/x86/include/asm/mach-default/mach_apicdef.h
@@ -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)
diff --git a/arch/x86/include/asm/mach-default/mach_ipi.h b/arch/x86/include/asm/mach-default/mach_ipi.h
index 191312d..0893996 100644
--- a/arch/x86/include/asm/mach-default/mach_ipi.h
+++ b/arch/x86/include/asm/mach-default/mach_ipi.h
@@ -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)
{
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
dissimilarity index 86%
index 48553e9..59972d9 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -1,35 +1,35 @@
-#ifndef _ASM_X86_MACH_GENERIC_MACH_APIC_H
-#define _ASM_X86_MACH_GENERIC_MACH_APIC_H
-
-#include <asm/genapic.h>
-
-#define esr_disable (genapic->ESR_DISABLE)
-#define NO_BALANCE_IRQ (genapic->no_balance_irq)
-#define INT_DELIVERY_MODE (genapic->int_delivery_mode)
-#define INT_DEST_MODE (genapic->int_dest_mode)
-#undef APIC_DEST_LOGICAL
-#define APIC_DEST_LOGICAL (genapic->apic_destination_logical)
-#define TARGET_CPUS (genapic->target_cpus())
-#define apic_id_registered (genapic->apic_id_registered)
-#define init_apic_ldr (genapic->init_apic_ldr)
-#define ioapic_phys_id_map (genapic->ioapic_phys_id_map)
-#define setup_apic_routing (genapic->setup_apic_routing)
-#define multi_timer_check (genapic->multi_timer_check)
-#define apicid_to_node (genapic->apicid_to_node)
-#define cpu_to_logical_apicid (genapic->cpu_to_logical_apicid)
-#define cpu_present_to_apicid (genapic->cpu_present_to_apicid)
-#define apicid_to_cpu_present (genapic->apicid_to_cpu_present)
-#define setup_portio_remap (genapic->setup_portio_remap)
-#define check_apicid_present (genapic->check_apicid_present)
-#define check_phys_apicid_present (genapic->check_phys_apicid_present)
-#define check_apicid_used (genapic->check_apicid_used)
-#define cpu_mask_to_apicid (genapic->cpu_mask_to_apicid)
-#define cpu_mask_to_apicid_and (genapic->cpu_mask_to_apicid_and)
-#define vector_allocation_domain (genapic->vector_allocation_domain)
-#define enable_apic_mode (genapic->enable_apic_mode)
-#define phys_pkg_id (genapic->phys_pkg_id)
-#define wakeup_secondary_cpu (genapic->wakeup_cpu)
-
-extern void generic_bigsmp_probe(void);
-
-#endif /* _ASM_X86_MACH_GENERIC_MACH_APIC_H */
+#ifndef _ASM_X86_MACH_GENERIC_MACH_APIC_H
+#define _ASM_X86_MACH_GENERIC_MACH_APIC_H
+
+#include <asm/genapic.h>
+
+#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)
+#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)
+#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)
+#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)
+#define enable_apic_mode (apic->enable_apic_mode)
+#define phys_pkg_id (apic->phys_pkg_id)
+#define wakeup_secondary_cpu (apic->wakeup_cpu)
+
+extern void generic_bigsmp_probe(void);
+
+#endif /* _ASM_X86_MACH_GENERIC_MACH_APIC_H */
diff --git a/arch/x86/include/asm/mach-generic/mach_apicdef.h b/arch/x86/include/asm/mach-generic/mach_apicdef.h
index 68041f3..acc9add 100644
--- a/arch/x86/include/asm/mach-generic/mach_apicdef.h
+++ b/arch/x86/include/asm/mach-generic/mach_apicdef.h
@@ -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 */
diff --git a/arch/x86/include/asm/mach-generic/mach_ipi.h b/arch/x86/include/asm/mach-generic/mach_ipi.h
index ffd637e..75e54bd 100644
--- a/arch/x86/include/asm/mach-generic/mach_ipi.h
+++ b/arch/x86/include/asm/mach-generic/mach_ipi.h
@@ -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 */
diff --git a/arch/x86/include/asm/mach-generic/mach_wakecpu.h b/arch/x86/include/asm/mach-generic/mach_wakecpu.h
dissimilarity index 75%
index 1ab16b1..22006bb 100644
--- a/arch/x86/include/asm/mach-generic/mach_wakecpu.h
+++ b/arch/x86/include/asm/mach-generic/mach_wakecpu.h
@@ -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 */
diff --git a/arch/x86/kernel/es7000_32.c b/arch/x86/kernel/es7000_32.c
index 53699c9..20a2a43 100644
--- a/arch/x86/kernel/es7000_32.c
+++ b/arch/x86/kernel/es7000_32.c
@@ -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;
diff --git a/arch/x86/kernel/genapic_64.c b/arch/x86/kernel/genapic_64.c
index e656c27..2b98638 100644
--- a/arch/x86/kernel/genapic_64.c
+++ b/arch/x86/kernel/genapic_64.c
@@ -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;
}
}
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index bfb7d73..7283234 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -1486,7 +1486,7 @@ static void ioapic_register_intr(int irq, struct irq_desc *desc, unsigned long t
handle_edge_irq, "edge");
}
-static int setup_ioapic_entry(int apic, int irq,
+static int setup_ioapic_entry(int apic_id, int irq,
struct IO_APIC_route_entry *entry,
unsigned int destination, int trigger,
int polarity, int vector)
@@ -1498,18 +1498,18 @@ static int setup_ioapic_entry(int apic, int irq,
#ifdef CONFIG_INTR_REMAP
if (intr_remapping_enabled) {
- struct intel_iommu *iommu = map_ioapic_to_ir(apic);
+ struct intel_iommu *iommu = map_ioapic_to_ir(apic_id);
struct irte irte;
struct IR_IO_APIC_route_entry *ir_entry =
(struct IR_IO_APIC_route_entry *) entry;
int index;
if (!iommu)
- panic("No mapping iommu for ioapic %d\n", apic);
+ panic("No mapping iommu for ioapic %d\n", apic_id);
index = alloc_irte(iommu, irq, 1);
if (index < 0)
- panic("Failed to allocate IRTE for ioapic %d\n", apic);
+ panic("Failed to allocate IRTE for ioapic %d\n", apic_id);
memset(&irte, 0, sizeof(irte));
@@ -1547,7 +1547,7 @@ static int setup_ioapic_entry(int apic, int irq,
return 0;
}
-static void setup_IO_APIC_irq(int apic, int pin, unsigned int irq, struct irq_desc *desc,
+static void setup_IO_APIC_irq(int apic_id, int pin, unsigned int irq, struct irq_desc *desc,
int trigger, int polarity)
{
struct irq_cfg *cfg;
@@ -1567,14 +1567,14 @@ static void setup_IO_APIC_irq(int apic, int pin, unsigned int irq, struct irq_de
apic_printk(APIC_VERBOSE,KERN_DEBUG
"IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> "
"IRQ %d Mode:%i Active:%i)\n",
- apic, mp_ioapics[apic].apicid, pin, cfg->vector,
+ apic_id, mp_ioapics[apic_id].apicid, pin, cfg->vector,
irq, trigger, polarity);
- if (setup_ioapic_entry(mp_ioapics[apic].apicid, irq, &entry,
+ if (setup_ioapic_entry(mp_ioapics[apic_id].apicid, irq, &entry,
dest, trigger, polarity, cfg->vector)) {
printk("Failed to setup ioapic entry for ioapic %d, pin %d\n",
- mp_ioapics[apic].apicid, pin);
+ mp_ioapics[apic_id].apicid, pin);
__clear_irq_vector(irq, cfg);
return;
}
@@ -1583,12 +1583,12 @@ static void setup_IO_APIC_irq(int apic, int pin, unsigned int irq, struct irq_de
if (irq < NR_IRQS_LEGACY)
disable_8259A_irq(irq);
- ioapic_write_entry(apic, pin, entry);
+ ioapic_write_entry(apic_id, pin, entry);
}
static void __init setup_IO_APIC_irqs(void)
{
- int apic, pin, idx, irq;
+ int apic_id, pin, idx, irq;
int notcon = 0;
struct irq_desc *desc;
struct irq_cfg *cfg;
@@ -1596,19 +1596,19 @@ static void __init setup_IO_APIC_irqs(void)
apic_printk(APIC_VERBOSE, KERN_DEBUG "init IO_APIC IRQs\n");
- for (apic = 0; apic < nr_ioapics; apic++) {
- for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) {
+ for (apic_id = 0; apic_id < nr_ioapics; apic_id++) {
+ for (pin = 0; pin < nr_ioapic_registers[apic_id]; pin++) {
- idx = find_irq_entry(apic, pin, mp_INT);
+ idx = find_irq_entry(apic_id, pin, mp_INT);
if (idx == -1) {
if (!notcon) {
notcon = 1;
apic_printk(APIC_VERBOSE,
KERN_DEBUG " %d-%d",
- mp_ioapics[apic].apicid, pin);
+ mp_ioapics[apic_id].apicid, pin);
} else
apic_printk(APIC_VERBOSE, " %d-%d",
- mp_ioapics[apic].apicid, pin);
+ mp_ioapics[apic_id].apicid, pin);
continue;
}
if (notcon) {
@@ -1617,9 +1617,9 @@ static void __init setup_IO_APIC_irqs(void)
notcon = 0;
}
- irq = pin_2_irq(idx, apic, pin);
+ irq = pin_2_irq(idx, apic_id, pin);
#ifdef CONFIG_X86_32
- if (multi_timer_check(apic, irq))
+ if (multi_timer_check(apic_id, irq))
continue;
#endif
desc = irq_to_desc_alloc_cpu(irq, cpu);
@@ -1628,9 +1628,9 @@ static void __init setup_IO_APIC_irqs(void)
continue;
}
cfg = desc->chip_data;
- add_pin_to_irq_cpu(cfg, cpu, apic, pin);
+ add_pin_to_irq_cpu(cfg, cpu, apic_id, pin);
- setup_IO_APIC_irq(apic, pin, irq, desc,
+ setup_IO_APIC_irq(apic_id, pin, irq, desc,
irq_trigger(idx), irq_polarity(idx));
}
}
@@ -1643,7 +1643,7 @@ static void __init setup_IO_APIC_irqs(void)
/*
* Set up the timer pin, possibly with the 8259A-master behind.
*/
-static void __init setup_timer_IRQ0_pin(unsigned int apic, unsigned int pin,
+static void __init setup_timer_IRQ0_pin(unsigned int apic_id, unsigned int pin,
int vector)
{
struct IO_APIC_route_entry entry;
@@ -1676,7 +1676,7 @@ static void __init setup_timer_IRQ0_pin(unsigned int apic, unsigned int pin,
/*
* Add it to the IO-APIC irq-routing table:
*/
- ioapic_write_entry(apic, pin, entry);
+ ioapic_write_entry(apic_id, pin, entry);
}
@@ -2089,7 +2089,7 @@ static void __init setup_ioapic_ids_from_mpc(void)
{
union IO_APIC_reg_00 reg_00;
physid_mask_t phys_id_present_map;
- int apic;
+ int apic_id;
int i;
unsigned char old_id;
unsigned long flags;
@@ -2113,21 +2113,21 @@ static void __init setup_ioapic_ids_from_mpc(void)
/*
* Set the IOAPIC ID to the value stored in the MPC table.
*/
- for (apic = 0; apic < nr_ioapics; apic++) {
+ for (apic_id = 0; apic_id < nr_ioapics; apic_id++) {
/* Read the register 0 value */
spin_lock_irqsave(&ioapic_lock, flags);
- reg_00.raw = io_apic_read(apic, 0);
+ reg_00.raw = io_apic_read(apic_id, 0);
spin_unlock_irqrestore(&ioapic_lock, flags);
- old_id = mp_ioapics[apic].apicid;
+ old_id = mp_ioapics[apic_id].apicid;
- if (mp_ioapics[apic].apicid >= get_physical_broadcast()) {
+ if (mp_ioapics[apic_id].apicid >= get_physical_broadcast()) {
printk(KERN_ERR "BIOS bug, IO-APIC#%d ID is %d in the MPC table!...\n",
- apic, mp_ioapics[apic].apicid);
+ apic_id, mp_ioapics[apic_id].apicid);
printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n",
reg_00.bits.ID);
- mp_ioapics[apic].apicid = reg_00.bits.ID;
+ mp_ioapics[apic_id].apicid = reg_00.bits.ID;
}
/*
@@ -2136,9 +2136,9 @@ static void __init setup_ioapic_ids_from_mpc(void)
* 'stuck on smp_invalidate_needed IPI wait' messages.
*/
if (check_apicid_used(phys_id_present_map,
- mp_ioapics[apic].apicid)) {
+ mp_ioapics[apic_id].apicid)) {
printk(KERN_ERR "BIOS bug, IO-APIC#%d ID %d is already used!...\n",
- apic, mp_ioapics[apic].apicid);
+ apic_id, mp_ioapics[apic_id].apicid);
for (i = 0; i < get_physical_broadcast(); i++)
if (!physid_isset(i, phys_id_present_map))
break;
@@ -2147,13 +2147,13 @@ static void __init setup_ioapic_ids_from_mpc(void)
printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n",
i);
physid_set(i, phys_id_present_map);
- mp_ioapics[apic].apicid = i;
+ mp_ioapics[apic_id].apicid = i;
} else {
physid_mask_t tmp;
- tmp = apicid_to_cpu_present(mp_ioapics[apic].apicid);
+ tmp = 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].apicid);
+ mp_ioapics[apic_id].apicid);
physids_or(phys_id_present_map, phys_id_present_map, tmp);
}
@@ -2162,11 +2162,11 @@ static void __init setup_ioapic_ids_from_mpc(void)
* We need to adjust the IRQ routing table
* if the ID changed.
*/
- if (old_id != mp_ioapics[apic].apicid)
+ if (old_id != mp_ioapics[apic_id].apicid)
for (i = 0; i < mp_irq_entries; i++)
if (mp_irqs[i].dstapic == old_id)
mp_irqs[i].dstapic
- = mp_ioapics[apic].apicid;
+ = mp_ioapics[apic_id].apicid;
/*
* Read the right value from the MPC table and
@@ -2174,20 +2174,20 @@ static void __init setup_ioapic_ids_from_mpc(void)
*/
apic_printk(APIC_VERBOSE, KERN_INFO
"...changing IO-APIC physical APIC ID to %d ...",
- mp_ioapics[apic].apicid);
+ mp_ioapics[apic_id].apicid);
- reg_00.bits.ID = mp_ioapics[apic].apicid;
+ reg_00.bits.ID = mp_ioapics[apic_id].apicid;
spin_lock_irqsave(&ioapic_lock, flags);
- io_apic_write(apic, 0, reg_00.raw);
+ io_apic_write(apic_id, 0, reg_00.raw);
spin_unlock_irqrestore(&ioapic_lock, flags);
/*
* Sanity check
*/
spin_lock_irqsave(&ioapic_lock, flags);
- reg_00.raw = io_apic_read(apic, 0);
+ reg_00.raw = io_apic_read(apic_id, 0);
spin_unlock_irqrestore(&ioapic_lock, flags);
- if (reg_00.bits.ID != mp_ioapics[apic].apicid)
+ if (reg_00.bits.ID != mp_ioapics[apic_id].apicid)
printk("could not set ID!\n");
else
apic_printk(APIC_VERBOSE, " ok.\n");
diff --git a/arch/x86/kernel/numaq_32.c b/arch/x86/kernel/numaq_32.c
index f2191d4..3928280 100644
--- a/arch/x86/kernel/numaq_32.c
+++ b/arch/x86/kernel/numaq_32.c
@@ -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;
}
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index f41c448..a58e9f5 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -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
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index c2ded14..2f4f4a6 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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)
diff --git a/arch/x86/mach-generic/probe.c b/arch/x86/mach-generic/probe.c
index 15a38da..82bf0f5 100644
--- a/arch/x86/mach-generic/probe.c
+++ b/arch/x86/mach-generic/probe.c
@@ -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));
}
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 008/114] x86: clean up genapic_flat
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (6 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 007/114] x86: rename 'genapic' to 'apic' Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 009/114] x86: clean up genapic_phys_flat Ingo Molnar
` (107 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, 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.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/kernel/genapic_flat_64.c | 73 +++++++++++++++++++++++++++----------
1 files changed, 54 insertions(+), 19 deletions(-)
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index 3418548..f1bfdd3 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -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,
};
/*
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 009/114] x86: clean up genapic_phys_flat
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (7 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 008/114] x86: clean up genapic_flat Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 010/114] x86: clean up apic_x2apic_uv_x Ingo Molnar
` (106 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, 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.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/kernel/genapic_flat_64.c | 75 +++++++++++++++++++++++++++---------
1 files changed, 56 insertions(+), 19 deletions(-)
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index f1bfdd3..e923337 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -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,
};
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 010/114] x86: clean up apic_x2apic_uv_x
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (8 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 009/114] x86: clean up genapic_phys_flat Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 011/114] x86: clean up apic_x2apic_phys Ingo Molnar
` (105 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, 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.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/kernel/genx2apic_uv_x.c | 74 ++++++++++++++++++++++++++++----------
1 files changed, 55 insertions(+), 19 deletions(-)
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c
index bfe3624..94f606f 100644
--- a/arch/x86/kernel/genx2apic_uv_x.c
+++ b/arch/x86/kernel/genx2apic_uv_x.c
@@ -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)
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 011/114] x86: clean up apic_x2apic_phys
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (9 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 010/114] x86: clean up apic_x2apic_uv_x Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 012/114] x86: clean up apic_x2apic_cluster Ingo Molnar
` (104 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, 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.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/kernel/genx2apic_phys.c | 74 ++++++++++++++++++++++++++++----------
1 files changed, 55 insertions(+), 19 deletions(-)
diff --git a/arch/x86/kernel/genx2apic_phys.c b/arch/x86/kernel/genx2apic_phys.c
index 21bcc0e..c98361f 100644
--- a/arch/x86/kernel/genx2apic_phys.c
+++ b/arch/x86/kernel/genx2apic_phys.c
@@ -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,
};
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 012/114] x86: clean up apic_x2apic_cluster
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (10 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 011/114] x86: clean up apic_x2apic_phys Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 013/114] x86, genapic: cleanup 32-bit apic_default template Ingo Molnar
` (103 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, 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.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/kernel/genx2apic_cluster.c | 74 ++++++++++++++++++++++++++---------
1 files changed, 55 insertions(+), 19 deletions(-)
diff --git a/arch/x86/kernel/genx2apic_cluster.c b/arch/x86/kernel/genx2apic_cluster.c
index 6ce497c..fc855e5 100644
--- a/arch/x86/kernel/genx2apic_cluster.c
+++ b/arch/x86/kernel/genx2apic_cluster.c
@@ -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,
};
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 013/114] x86, genapic: cleanup 32-bit apic_default template
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (11 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 012/114] x86: clean up apic_x2apic_cluster Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 014/114] x86, genapic: cleanup 32-bit apic_bigsmp template Ingo Molnar
` (102 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Clean 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
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/mach-generic/default.c | 58 ++++++++++++++++++++++++++++++++++++++-
1 files changed, 57 insertions(+), 1 deletions(-)
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index e63a4a7..d5fec76 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
+};
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 014/114] x86, genapic: cleanup 32-bit apic_bigsmp template
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (12 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 013/114] x86, genapic: cleanup 32-bit apic_default template Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 015/114] x86, genapic: cleanup 32-bit apic_numaq template Ingo Molnar
` (101 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Clean 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
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/mach-generic/bigsmp.c | 58 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 57 insertions(+), 1 deletions(-)
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index bc4c784..13e82bc 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
+};
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 015/114] x86, genapic: cleanup 32-bit apic_numaq template
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (13 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 014/114] x86, genapic: cleanup 32-bit apic_bigsmp template Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 016/114] x86, genapic: cleanup 32-bit apic_es7000 template Ingo Molnar
` (100 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Clean 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
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/mach-generic/numaq.c | 58 ++++++++++++++++++++++++++++++++++++++++-
1 files changed, 57 insertions(+), 1 deletions(-)
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 3679e22..fa486ca 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
+};
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 016/114] x86, genapic: cleanup 32-bit apic_es7000 template
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (14 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 015/114] x86, genapic: cleanup 32-bit apic_numaq template Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 017/114] x86, genapic: cleanup 32-bit apic_summit template Ingo Molnar
` (99 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Clean 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
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/mach-generic/es7000.c | 58 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 57 insertions(+), 1 deletions(-)
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 2f4f4a6..4a404ea 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
+};
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 017/114] x86, genapic: cleanup 32-bit apic_summit template
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (15 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 016/114] x86, genapic: cleanup 32-bit apic_es7000 template Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 018/114] x86: remove APIC_INIT / APICFUNC / IPIFUNC Ingo Molnar
` (98 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Clean 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
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/mach-generic/summit.c | 58 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 57 insertions(+), 1 deletions(-)
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 2821ffc..479c1d4 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
+};
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 018/114] x86: remove APIC_INIT / APICFUNC / IPIFUNC
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (16 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 017/114] x86, genapic: cleanup 32-bit apic_summit template Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 019/114] x86: clean up apic->acpi_madt_oem_check methods Ingo Molnar
` (97 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
The 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.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/genapic.h | 63 +--------------------------------------
1 files changed, 2 insertions(+), 61 deletions(-)
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h
index 3970da3..26c5e82 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -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 */
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 019/114] x86: clean up apic->acpi_madt_oem_check methods
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (17 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 018/114] x86: remove APIC_INIT / APICFUNC / IPIFUNC Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 020/114] x86: clean up apic->apic_id_registered() methods Ingo Molnar
` (96 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Impact: 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.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/es7000/mpparse.h b/arch/x86/include/asm/es7000/mpparse.h
index c1629b0..30692c4 100644
--- a/arch/x86/include/asm/es7000/mpparse.h
+++ b/arch/x86/include/asm/es7000/mpparse.h
@@ -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
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h
index 26c5e82..108abdf 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -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);
diff --git a/arch/x86/include/asm/mach-default/mach_mpparse.h b/arch/x86/include/asm/mach-default/mach_mpparse.h
index c70a263..8fa0177 100644
--- a/arch/x86/include/asm/mach-default/mach_mpparse.h
+++ b/arch/x86/include/asm/mach-default/mach_mpparse.h
@@ -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;
}
diff --git a/arch/x86/include/asm/mach-generic/mach_mpparse.h b/arch/x86/include/asm/mach-generic/mach_mpparse.h
index 9444ab8..f497d96 100644
--- a/arch/x86/include/asm/mach-generic/mach_mpparse.h
+++ b/arch/x86/include/asm/mach-generic/mach_mpparse.h
@@ -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 */
diff --git a/arch/x86/include/asm/summit/mpparse.h b/arch/x86/include/asm/summit/mpparse.h
index 380e86c..555ed82 100644
--- a/arch/x86/include/asm/summit/mpparse.h
+++ b/arch/x86/include/asm/summit/mpparse.h
@@ -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)
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 4cb5964..314fe0d 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -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;
}
diff --git a/arch/x86/kernel/genapic_64.c b/arch/x86/kernel/genapic_64.c
index 2b98638..060945b 100644
--- a/arch/x86/kernel/genapic_64.c
+++ b/arch/x86/kernel/genapic_64.c
@@ -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;
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 13e82bc..22c3608 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index d5fec76..cfec349 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 4a404ea..23fe6f1 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index fa486ca..9691b4e 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/probe.c b/arch/x86/mach-generic/probe.c
index 82bf0f5..a21e2b1 100644
--- a/arch/x86/mach-generic/probe.c
+++ b/arch/x86/mach-generic/probe.c
@@ -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;
}
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 479c1d4..0eea9fb 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 020/114] x86: clean up apic->apic_id_registered() methods
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (18 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 019/114] x86: clean up apic->acpi_madt_oem_check methods Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 021/114] x86, genapic: rename int_delivery_mode, et. al Ingo Molnar
` (95 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Impact: 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.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index d8dd9f5..42c56df 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -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)
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index c58b9cc..a1819b5 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -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)
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index 2448b92..6a454fa 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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);
}
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index 59972d9..cc6e9d7 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -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)
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index bf37bc4..59b62b1 100644
--- a/arch/x86/include/asm/numaq/apic.h
+++ b/arch/x86/include/asm/numaq/apic.h
@@ -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;
}
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index 93d2c86..a36ef6e 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -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;
}
diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic.c
index c6f1564..b6740de 100644
--- a/arch/x86/kernel/apic.c
+++ b/arch/x86/kernel/apic.c
@@ -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();
/*
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 22c3608..17abf5c 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index cfec349..1f30559 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 23fe6f1..d68ca0b 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 9691b4e..b22a79b 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 0eea9fb..744fa1b 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 021/114] x86, genapic: rename int_delivery_mode, et. al.
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (19 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 020/114] x86: clean up apic->apic_id_registered() methods Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 022/114] x86, apic: remove IRQ_DEST_MODE / IRQ_DELIVERY_MODE Ingo Molnar
` (94 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
int_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
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index 42c56df..8ff8bba 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -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)
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index a1819b5..830e873 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -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
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h
index 108abdf..e998e3d 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -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);
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index 6a454fa..b536479 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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
/*
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index cc6e9d7..03492f2 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -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())
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index 59b62b1..d885e35 100644
--- a/arch/x86/include/asm/numaq/apic.h
+++ b/arch/x86/include/asm/numaq/apic.h
@@ -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)
{
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index a36ef6e..0b7d0d1 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -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)
{
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index e923337..0a263d6 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_cluster.c b/arch/x86/kernel/genx2apic_cluster.c
index fc855e5..e9ff7dc 100644
--- a/arch/x86/kernel/genx2apic_cluster.c
+++ b/arch/x86/kernel/genx2apic_cluster.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_phys.c b/arch/x86/kernel/genx2apic_phys.c
index c98361f..8141b5a 100644
--- a/arch/x86/kernel/genx2apic_phys.c
+++ b/arch/x86/kernel/genx2apic_phys.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c
index 94f606f..6a73cad 100644
--- a/arch/x86/kernel/genx2apic_uv_x.c
+++ b/arch/x86/kernel/genx2apic_uv_x.c
@@ -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,
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index 7283234..5f967b9 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -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_ms
memset (&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;
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 17abf5c..c15c1aa 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index 1f30559..d32b175 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index d68ca0b..0665389 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index b22a79b..4019571 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 744fa1b..946da7a 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 022/114] x86, apic: remove IRQ_DEST_MODE / IRQ_DELIVERY_MODE
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (20 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 021/114] x86, genapic: rename int_delivery_mode, et. al Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 023/114] x86, apic: remove DEFAULT_IRQ_DELIVERY_MODE and DEFAULT_IRQ_DEST_MODE Ingo Molnar
` (93 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Remove 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.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index 8ff8bba..293551b 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -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)
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index 830e873..6900166 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -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
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index b536479..eafbf4f 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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
/*
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index 03492f2..387a5d0 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -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())
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index d885e35..7746035 100644
--- a/arch/x86/include/asm/numaq/apic.h
+++ b/arch/x86/include/asm/numaq/apic.h
@@ -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)
{
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index 0b7d0d1..ea2abe9 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -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)
{
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index 5f967b9..301b657 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -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_ms
memset (&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;
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index c15c1aa..e8c1cec 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index d32b175..0482106 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 0665389..5d97408 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 4019571..77ac669 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 946da7a..7b3f43c 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 023/114] x86, apic: remove DEFAULT_IRQ_DELIVERY_MODE and DEFAULT_IRQ_DEST_MODE
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (21 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 022/114] x86, apic: remove IRQ_DEST_MODE / IRQ_DELIVERY_MODE Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 024/114] x86, apic: remove SUMMIT_IRQ_DELIVERY_MODE and SUMMIT_IRQ_DEST_MODE Ingo Molnar
` (92 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Impact: cleanup
They were only used in a single place and obscured the apic_default template.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/mach-default/mach_apic.h | 2 --
arch/x86/mach-generic/default.c | 5 +++--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index eafbf4f..f3b2cd4 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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
/*
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index 0482106..fe97b01 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 024/114] x86, apic: remove SUMMIT_IRQ_DELIVERY_MODE and SUMMIT_IRQ_DEST_MODE
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (22 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 023/114] x86, apic: remove DEFAULT_IRQ_DELIVERY_MODE and DEFAULT_IRQ_DEST_MODE Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 025/114] x86, apic: remove NUMAQ_IRQ_DELIVERY_MODE and NUMAQ_IRQ_DEST_MODE Ingo Molnar
` (91 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Impact: cleanup
They were only used in a single place and obscured the apic_summit template.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/summit/apic.h | 3 ---
arch/x86/mach-generic/summit.c | 5 +++--
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index ea2abe9..427d088 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -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;
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 7b3f43c..1b9164b 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 025/114] x86, apic: remove NUMAQ_IRQ_DELIVERY_MODE and NUMAQ_IRQ_DEST_MODE
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (23 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 024/114] x86, apic: remove SUMMIT_IRQ_DELIVERY_MODE and SUMMIT_IRQ_DEST_MODE Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 026/114] x86, apic: remove BIGSMP_IRQ_DELIVERY_MODE and BIGSMP_IRQ_DEST_MODE Ingo Molnar
` (90 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Impact: cleanup
They were only used in a single place and obscured the apic_numaq template.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/numaq/apic.h | 3 ---
arch/x86/mach-generic/numaq.c | 5 +++--
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index 7746035..a9d8467 100644
--- a/arch/x86/include/asm/numaq/apic.h
+++ b/arch/x86/include/asm/numaq/apic.h
@@ -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);
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 77ac669..6daddb6 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 026/114] x86, apic: remove BIGSMP_IRQ_DELIVERY_MODE and BIGSMP_IRQ_DEST_MODE
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (24 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 025/114] x86, apic: remove NUMAQ_IRQ_DELIVERY_MODE and NUMAQ_IRQ_DEST_MODE Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 027/114] x86, apic: remove ES7000_IRQ_DELIVERY_MODE and ES7000_IRQ_DEST_MODE Ingo Molnar
` (89 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Impact: cleanup
They were only used in a single place and obscured the apic_bigsmp
driver template.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/bigsmp/apic.h | 2 --
arch/x86/mach-generic/bigsmp.c | 5 +++--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index 293551b..dca2d5b 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -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)
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index e8c1cec..06be776 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 027/114] x86, apic: remove ES7000_IRQ_DELIVERY_MODE and ES7000_IRQ_DEST_MODE
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (25 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 026/114] x86, apic: remove BIGSMP_IRQ_DELIVERY_MODE and BIGSMP_IRQ_DEST_MODE Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 028/114] x86, apic: remove IRQ_DEST_MODE Ingo Molnar
` (88 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Impact: cleanup
They were only used in a single place and obscured the apic_es7000
driver template.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/es7000/apic.h | 2 --
arch/x86/mach-generic/es7000.c | 5 +++--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index 6900166..342416b 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -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
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 5d97408..269a97a 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 028/114] x86, apic: remove IRQ_DEST_MODE
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (26 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 027/114] x86, apic: remove ES7000_IRQ_DELIVERY_MODE and ES7000_IRQ_DEST_MODE Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 029/114] x86, apic: clean up target_cpus methods Ingo Molnar
` (87 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Remove leftover definition.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/mach-default/mach_apic.h | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index f3b2cd4..ce3bc48 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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)
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 029/114] x86, apic: clean up target_cpus methods
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (27 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 028/114] x86, apic: remove IRQ_DEST_MODE Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 030/114] x86, apic: clean up / remove TARGET_CPUS Ingo Molnar
` (86 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Impact: 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.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index dca2d5b..d6aeca3 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -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;
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index 342416b..7e5c31a 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -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)
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index ce3bc48..af1607d 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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.
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index a9d8467..1111ff9 100644
--- a/arch/x86/include/asm/numaq/apic.h
+++ b/arch/x86/include/asm/numaq/apic.h
@@ -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;
}
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index 427d088..7c1f915 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -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
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 06be776..d3cead2 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index fe97b01..a483e22 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 269a97a..e31f0c3 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 6daddb6..4b84b59 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 1b9164b..e6b956a 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 030/114] x86, apic: clean up / remove TARGET_CPUS
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (28 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 029/114] x86, apic: clean up target_cpus methods Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 031/114] x86: clean up esr_disable() methods Ingo Molnar
` (85 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Impact: cleanup
use apic->target_cpus() directly instead of the TARGET_CPUS wrapper.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index 7e5c31a..53adda0 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -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);
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index af1607d..77a9724 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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.
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index 387a5d0..da2d778 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -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)
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index 7c1f915..cf5036f 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -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);
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index 301b657..7503285 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -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_ms
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)
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)
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 031/114] x86: clean up esr_disable() methods
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (29 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 030/114] x86, apic: clean up / remove TARGET_CPUS Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 032/114] x86: rename ->ESR_DISABLE to ->disable_esr Ingo Molnar
` (84 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Impact: 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.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index d6aeca3..b550cb1 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -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)
{
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index 53adda0..aa11c76 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -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)
{
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index 77a9724..5f8d17f 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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>
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index da2d778..63fe985 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -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)
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index 1111ff9..8ecb3b4 100644
--- a/arch/x86/include/asm/numaq/apic.h
+++ b/arch/x86/include/asm/numaq/apic.h
@@ -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)
{
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index cf5036f..84679e6 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -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.
diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic.c
index b6740de..69d8c30 100644
--- a/arch/x86/kernel/apic.c
+++ b/arch/x86/kernel/apic.c
@@ -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);
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index d3cead2..f0bb726 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index a483e22..c30141a 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index e31f0c3..e8aa8fd 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 4b84b59..860edc8 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index e6b956a..cd5ef11 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 032/114] x86: rename ->ESR_DISABLE to ->disable_esr
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (30 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 031/114] x86: clean up esr_disable() methods Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 033/114] x86: clean up the APIC_DEST_LOGICAL logic Ingo Molnar
` (83 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
the ->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
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h
index e998e3d..7aee4a4 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -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);
diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic.c
index 69d8c30..3853ed7 100644
--- a/arch/x86/kernel/apic.c
+++ b/arch/x86/kernel/apic.c
@@ -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);
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index 0a263d6..d437a60 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_cluster.c b/arch/x86/kernel/genx2apic_cluster.c
index e9ff7dc..c1cffae 100644
--- a/arch/x86/kernel/genx2apic_cluster.c
+++ b/arch/x86/kernel/genx2apic_cluster.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_phys.c b/arch/x86/kernel/genx2apic_phys.c
index 8141b5a..c59602b 100644
--- a/arch/x86/kernel/genx2apic_phys.c
+++ b/arch/x86/kernel/genx2apic_phys.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c
index 6a73cad..525b4e4 100644
--- a/arch/x86/kernel/genx2apic_uv_x.c
+++ b/arch/x86/kernel/genx2apic_uv_x.c
@@ -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,
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index f0bb726..fe9bf25 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index c30141a..d3fe801 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index e8aa8fd..b4f8abf 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 860edc8..f3b7840 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index cd5ef11..95e075b 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 033/114] x86: clean up the APIC_DEST_LOGICAL logic
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (31 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 032/114] x86: rename ->ESR_DISABLE to ->disable_esr Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 034/114] x86, apic: rename genapic::apic_destination_logical to genapic::dest_logical Ingo Molnar
` (82 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Impact: 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.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index b550cb1..7e6e33a 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -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)
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index aa11c76..0d770fc 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -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 0x0
static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
{
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index 63fe985..00d5fe6 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -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)
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index d437a60..fd242c6 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_cluster.c b/arch/x86/kernel/genx2apic_cluster.c
index c1cffae..a76e75e 100644
--- a/arch/x86/kernel/genx2apic_cluster.c
+++ b/arch/x86/kernel/genx2apic_cluster.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_phys.c b/arch/x86/kernel/genx2apic_phys.c
index c59602b..9b6d68d 100644
--- a/arch/x86/kernel/genx2apic_phys.c
+++ b/arch/x86/kernel/genx2apic_phys.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c
index 525b4e4..0a75680 100644
--- a/arch/x86/kernel/genx2apic_uv_x.c
+++ b/arch/x86/kernel/genx2apic_uv_x.c
@@ -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,
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index 7503285..17526d7 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -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.
*/
diff --git a/arch/x86/kernel/ipi.c b/arch/x86/kernel/ipi.c
index 285bbf8..400b7bd 100644
--- a/arch/x86/kernel/ipi.c
+++ b/arch/x86/kernel/ipi.c
@@ -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:
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index f9dbcff..f0a1737 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -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();
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index fe9bf25..13ee7dc 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index b4f8abf..61b5da2 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 034/114] x86, apic: rename genapic::apic_destination_logical to genapic::dest_logical
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (32 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 033/114] x86: clean up the APIC_DEST_LOGICAL logic Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 035/114] x86, apic: clean up check_apicid*() callbacks Ingo Molnar
` (81 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
This field name was unreasonably long - shorten it.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h
index 7aee4a4..f9d1ec0 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -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);
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index fd242c6..d22cbda 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_cluster.c b/arch/x86/kernel/genx2apic_cluster.c
index a76e75e..b91a48e 100644
--- a/arch/x86/kernel/genx2apic_cluster.c
+++ b/arch/x86/kernel/genx2apic_cluster.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_phys.c b/arch/x86/kernel/genx2apic_phys.c
index 9b6d68d..f070e86 100644
--- a/arch/x86/kernel/genx2apic_phys.c
+++ b/arch/x86/kernel/genx2apic_phys.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c
index 0a75680..c8a8915 100644
--- a/arch/x86/kernel/genx2apic_uv_x.c
+++ b/arch/x86/kernel/genx2apic_uv_x.c
@@ -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,
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index 17526d7..7f8b32b 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -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.
*/
diff --git a/arch/x86/kernel/ipi.c b/arch/x86/kernel/ipi.c
index 400b7bd..e2e4895 100644
--- a/arch/x86/kernel/ipi.c
+++ b/arch/x86/kernel/ipi.c
@@ -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:
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index f0a1737..45c096f 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -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();
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 13ee7dc..7c52840 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index d3fe801..53fa1ad 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 61b5da2..50fed02 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index f3b7840..1fb1b1a 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 95e075b..5c27d4d 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 035/114] x86, apic: clean up check_apicid*() callbacks
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (33 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 034/114] x86, apic: rename genapic::apic_destination_logical to genapic::dest_logical Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 036/114] x86, apic: remove no_balance_irq and no_ioapic_check flags Ingo Molnar
` (80 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Clean up these methods - to make it clearer which function is
used in which case.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index 7e6e33a..bd52d4d 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -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)
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index 0d770fc..cd888da 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -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);
}
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index 5f8d17f..064bc11 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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);
}
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index 00d5fe6..e035f88 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -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)
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index 8ecb3b4..571fdae 100644
--- a/arch/x86/include/asm/numaq/apic.h
+++ b/arch/x86/include/asm/numaq/apic.h
@@ -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);
}
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index 84679e6..482038b 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -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;
}
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index 7f8b32b..733ecf1 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -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;
}
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 7c52840..aa8443f 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index 53fa1ad..47f6b5b 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 50fed02..5633f32 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 1fb1b1a..d85206d 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 5c27d4d..f54cf73 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 036/114] x86, apic: remove no_balance_irq and no_ioapic_check flags
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (34 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 035/114] x86, apic: clean up check_apicid*() callbacks Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 037/114] x86, apic: clean up ->vector_allocation_domain() Ingo Molnar
` (79 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
These flags are completely unused. (the in-kernel IRQ balancer has
been removed from the upstream kernel.)
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index bd52d4d..9164512 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -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)
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index cd888da..847008a 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -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)
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h
index f9d1ec0..661898c 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -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);
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index 064bc11..8adccf8 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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)
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index e035f88..4cb9e2b 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -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)
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index 571fdae..defee34 100644
--- a/arch/x86/include/asm/numaq/apic.h
+++ b/arch/x86/include/asm/numaq/apic.h
@@ -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)
{
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index 482038b..51df002 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -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
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index d22cbda..9446f37 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_cluster.c b/arch/x86/kernel/genx2apic_cluster.c
index b91a48e..2eeca6e 100644
--- a/arch/x86/kernel/genx2apic_cluster.c
+++ b/arch/x86/kernel/genx2apic_cluster.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_phys.c b/arch/x86/kernel/genx2apic_phys.c
index f070e86..be0ee3e 100644
--- a/arch/x86/kernel/genx2apic_phys.c
+++ b/arch/x86/kernel/genx2apic_phys.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c
index c8a8915..68b423f 100644
--- a/arch/x86/kernel/genx2apic_uv_x.c
+++ b/arch/x86/kernel/genx2apic_uv_x.c
@@ -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,
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index aa8443f..6da251a 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index 47f6b5b..e89e8c9 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 5633f32..8e9eeec 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index d85206d..f909189 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index f54cf73..99a9bea 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 037/114] x86, apic: clean up ->vector_allocation_domain()
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (35 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 036/114] x86, apic: remove no_balance_irq and no_ioapic_check flags Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 038/114] x86, apic: clean up ->init_apic_ldr() Ingo Molnar
` (78 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
- separate the namespace
- remove macros
- move the default vector-allocation-domain to mach-generic
- fix whitespace damage
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index 8adccf8..9c56542 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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)
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index 4cb9e2b..e94881a 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -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)
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index 733ecf1..49899e0 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -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;
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 6da251a..391cc99 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index e89e8c9..6adc3c6 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 8e9eeec..bc1f21c 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index f909189..712882f 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 99a9bea..1834887 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 038/114] x86, apic: clean up ->init_apic_ldr()
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (36 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 037/114] x86, apic: clean up ->vector_allocation_domain() Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 039/114] x86, apic: clean up ->ioapic_phys_id_map() Ingo Molnar
` (77 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
- separate the namespace
- remove macros
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index 9164512..8194130 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -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();
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index 847008a..06f5757 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -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();
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index 9c56542..23e0a2d 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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;
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index e94881a..8e51f41 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -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)
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index defee34..8022974 100644
--- a/arch/x86/include/asm/numaq/apic.h
+++ b/arch/x86/include/asm/numaq/apic.h
@@ -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 */
}
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index 51df002..9108c89 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -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;
diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic.c
index 3853ed7..b707793 100644
--- a/arch/x86/kernel/apic.c
+++ b/arch/x86/kernel/apic.c
@@ -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
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 391cc99..7b7fc47 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index 6adc3c6..633e848 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index bc1f21c..b70833e 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 712882f..a06fda5 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 1834887..36c552f 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 039/114] x86, apic: clean up ->ioapic_phys_id_map()
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (37 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 038/114] x86, apic: clean up ->init_apic_ldr() Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 040/114] x86, apic: clean up ->setup_apic_routing() Ingo Molnar
` (76 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
- separate the namespace
- remove macros
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index 8194130..05116d5 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -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);
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index 06f5757..db3e652 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -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);
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index 23e0a2d..7abdaae 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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;
}
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index 8e51f41..c1c96e6 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -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)
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index 8022974..dc7499b 100644
--- a/arch/x86/include/asm/numaq/apic.h
+++ b/arch/x86/include/asm/numaq/apic.h
@@ -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);
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index 9108c89..4dafb58 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -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);
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index 49899e0..db79ad9 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -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);
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 7b7fc47..f2a3418 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index 633e848..c403f3d 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index b70833e..ce09baf 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index a06fda5..5d98f18 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 36c552f..6abdd53 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 040/114] x86, apic: clean up ->setup_apic_routing()
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (38 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 039/114] x86, apic: clean up ->ioapic_phys_id_map() Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 041/114] x86, apic: streamline the ->multi_timer_check() quirk Ingo Molnar
` (75 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
- separate the namespace
- remove macros
- remove namespace clash on 64-bit
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index 05116d5..321ea47 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -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);
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index db3e652..f118300 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -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",
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h
index 661898c..38b1202 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -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 */
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index 7abdaae..d446774 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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",
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index c1c96e6..ddf3692 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -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)
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index dc7499b..2feb7e7 100644
--- a/arch/x86/include/asm/numaq/apic.h
+++ b/arch/x86/include/asm/numaq/apic.h
@@ -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);
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index 4dafb58..7ec2696 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -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);
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 314fe0d..5391631 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -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) {
diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic.c
index b707793..fcbcc03 100644
--- a/arch/x86/kernel/apic.c
+++ b/arch/x86/kernel/apic.c
@@ -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();
diff --git a/arch/x86/kernel/genapic_64.c b/arch/x86/kernel/genapic_64.c
index 060945b..d57d213 100644
--- a/arch/x86/kernel/genapic_64.c
+++ b/arch/x86/kernel/genapic_64.c
@@ -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)
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
index fa6bb26..c8a534a 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -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;
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 45c096f..3791b4a 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -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) {
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index f2a3418..ad3837a 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index c403f3d..67f287f 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index ce09baf..f611729 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 5d98f18..8c137f4 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 6abdd53..0698566 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 041/114] x86, apic: streamline the ->multi_timer_check() quirk
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (39 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 040/114] x86, apic: clean up ->setup_apic_routing() Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 042/114] x86, apic: clean up ->apicid_to_node() Ingo Molnar
` (74 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
only 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.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index 321ea47..df59298 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -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()];
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index f118300..632e4cd 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -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;
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index d446774..f418d47 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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)
{
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index ddf3692..bdea0a7 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -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)
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index 2feb7e7..22bdf3d 100644
--- a/arch/x86/include/asm/numaq/apic.h
+++ b/arch/x86/include/asm/numaq/apic.h
@@ -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;
}
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index 7ec2696..acb7bd1 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -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;
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index db79ad9..282ea11 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -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);
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index ad3837a..d074956 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index 67f287f..6a21aa7 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index f611729..0be59a5 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 8c137f4..da4ed65 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 0698566..b618a18 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 042/114] x86, apic: clean up ->apicid_to_node()
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (40 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 041/114] x86, apic: streamline the ->multi_timer_check() quirk Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 043/114] x86, apic: clean up ->cpu_to_logical_apicid() Ingo Molnar
` (73 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
- separate the namespace
- remove macros
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index df59298..77f0b73 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -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()];
}
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index 632e4cd..bcdf314 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -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;
}
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index f418d47..2f78209 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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()];
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index bdea0a7..b585a8e 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -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)
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index 22bdf3d..a0e3b43 100644
--- a/arch/x86/include/asm/numaq/apic.h
+++ b/arch/x86/include/asm/numaq/apic.h
@@ -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);
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index acb7bd1..cfff276 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -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()];
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 3791b4a..1dd4cec 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -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;
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index d074956..2f41214 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index 6a21aa7..d391c2d 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 0be59a5..933f2a3 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index da4ed65..38344fb 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index b618a18..6150604 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 043/114] x86, apic: clean up ->cpu_to_logical_apicid()
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (41 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 042/114] x86, apic: clean up ->apicid_to_node() Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 044/114] x86, apic: clean up ->cpu_present_to_apicid() Ingo Molnar
` (72 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
- separate the namespace
- remove macros
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index 77f0b73..d0d894f 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -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;
}
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index bcdf314..e0cd07e 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -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))
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index 2f78209..eae3e4b 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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;
}
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index b585a8e..2ea913e 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -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)
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index a0e3b43..6989abd 100644
--- a/arch/x86/include/asm/numaq/apic.h
+++ b/arch/x86/include/asm/numaq/apic.h
@@ -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;
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index cfff276..d564d7e 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -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))
diff --git a/arch/x86/kernel/ipi.c b/arch/x86/kernel/ipi.c
index e2e4895..367c5e6 100644
--- a/arch/x86/kernel/ipi.c
+++ b/arch/x86/kernel/ipi.c
@@ -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);
}
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 2f41214..cd6f02b 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index d391c2d..ef9b936 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 933f2a3..74bf2b6 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 38344fb..461f5be 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 6150604..d99be2d 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 044/114] x86, apic: clean up ->cpu_present_to_apicid()
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (42 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 043/114] x86, apic: clean up ->cpu_to_logical_apicid() Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 045/114] x86, apic: clean up ->apicid_to_cpu_present() Ingo Molnar
` (71 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
- separate the namespace
- remove macros
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index d0d894f..eea5e97 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -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);
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index e0cd07e..7cdde3d 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -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;
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h
index 38b1202..2cb14d5 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -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 */
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index eae3e4b..15d5627 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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);
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index 2ea913e..332fe93 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -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)
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index 6989abd..f482b06 100644
--- a/arch/x86/include/asm/numaq/apic.h
+++ b/arch/x86/include/asm/numaq/apic.h
@@ -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));
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index d564d7e..fc12736 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -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);
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index 9446f37..f4a2c1c 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_cluster.c b/arch/x86/kernel/genx2apic_cluster.c
index 2eeca6e..710d612 100644
--- a/arch/x86/kernel/genx2apic_cluster.c
+++ b/arch/x86/kernel/genx2apic_cluster.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_phys.c b/arch/x86/kernel/genx2apic_phys.c
index be0ee3e..49a4491 100644
--- a/arch/x86/kernel/genx2apic_phys.c
+++ b/arch/x86/kernel/genx2apic_phys.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c
index 68b423f..a08a635 100644
--- a/arch/x86/kernel/genx2apic_uv_x.c
+++ b/arch/x86/kernel/genx2apic_uv_x.c
@@ -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,
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 1dd4cec..812bf39 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -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;
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index cd6f02b..1eaf18c 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index ef9b936..2903657 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 74bf2b6..5a3a8ab 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 461f5be..d928cae 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index d99be2d..e6bb34e 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 045/114] x86, apic: clean up ->apicid_to_cpu_present()
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (43 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 044/114] x86, apic: clean up ->cpu_present_to_apicid() Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 046/114] x86: refactor ->setup_portio_remap() subarch methods Ingo Molnar
` (70 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
- separate the namespace
- remove macros
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index eea5e97..0804574 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -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);
}
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index 7cdde3d..a09e113 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -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;
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index 15d5627..22683e5 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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);
}
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index 332fe93..997618f 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -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)
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index f482b06..8ac000f 100644
--- a/arch/x86/include/asm/numaq/apic.h
+++ b/arch/x86/include/asm/numaq/apic.h
@@ -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);
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index fc12736..79c1a45 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -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);
}
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index 282ea11..3d85d3d 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -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) {
diff --git a/arch/x86/kernel/visws_quirks.c b/arch/x86/kernel/visws_quirks.c
index d801d06..2ed5bdf 100644
--- a/arch/x86/kernel/visws_quirks.c
+++ b/arch/x86/kernel/visws_quirks.c
@@ -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
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 1eaf18c..6139652 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index 2903657..8fc704a 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 5a3a8ab..1e0e162 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index d928cae..839b86b 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index e6bb34e..b6e3760 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 046/114] x86: refactor ->setup_portio_remap() subarch methods
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (44 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 045/114] x86, apic: clean up ->apicid_to_cpu_present() Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 047/114] x86: refactor ->check_phys_apicid_present() " Ingo Molnar
` (69 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Only 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.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index 0804574..2fa7003 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -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)
{
}
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index a09e113..c5b0eb5 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -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)
{
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index 22683e5..54c20e1 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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);
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index 997618f..393a97c 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -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)
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index 8ac000f..6b62651 100644
--- a/arch/x86/include/asm/numaq/apic.h
+++ b/arch/x86/include/asm/numaq/apic.h
@@ -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);
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index 79c1a45..131343b 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -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)
{
}
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 812bf39..0e7d26c 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -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();
/*
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 6139652..4247405 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index 8fc704a..b48a58d 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 1e0e162..449eca5 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 839b86b..e60361b 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index b6e3760..ffcf7ca 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 047/114] x86: refactor ->check_phys_apicid_present() subarch methods
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (45 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 046/114] x86: refactor ->setup_portio_remap() subarch methods Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 048/114] x86: refactor ->enable_apic_mode() " Ingo Molnar
` (68 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, 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
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index 2fa7003..5ba4118 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -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 */
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index c5b0eb5..717c27f 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -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);
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h
index 2cb14d5..f292fd0 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -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 */
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index 54c20e1..0a824d3 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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)
{
}
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index 393a97c..efd762d 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -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)
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index 6b62651..3be735e 100644
--- a/arch/x86/include/asm/numaq/apic.h
+++ b/arch/x86/include/asm/numaq/apic.h
@@ -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)
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index 131343b..fe578f6 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -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;
}
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index f4a2c1c..78adf71 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_cluster.c b/arch/x86/kernel/genx2apic_cluster.c
index 710d612..7062e24 100644
--- a/arch/x86/kernel/genx2apic_cluster.c
+++ b/arch/x86/kernel/genx2apic_cluster.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_phys.c b/arch/x86/kernel/genx2apic_phys.c
index 49a4491..7177a11 100644
--- a/arch/x86/kernel/genx2apic_phys.c
+++ b/arch/x86/kernel/genx2apic_phys.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c
index a08a635..debd721 100644
--- a/arch/x86/kernel/genx2apic_uv_x.c
+++ b/arch/x86/kernel/genx2apic_uv_x.c
@@ -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,
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 0e7d26c..ab83be2 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -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);
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 4247405..82743d1 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index b48a58d..d0374c6 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 449eca5..52b3eb5 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index e60361b..7ec2ca4 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index ffcf7ca..acf12de 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 048/114] x86: refactor ->enable_apic_mode() subarch methods
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (46 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 047/114] x86: refactor ->check_phys_apicid_present() " Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 049/114] x86, es7000: clean up es7000_enable_apic_mode() Ingo Molnar
` (67 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Only 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.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index 5ba4118..f49d440 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -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)
{
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index 0a824d3..3647c92 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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 */
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index efd762d..6fed521 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -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)
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index 3be735e..dc93c30 100644
--- a/arch/x86/include/asm/numaq/apic.h
+++ b/arch/x86/include/asm/numaq/apic.h
@@ -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
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index fe578f6..526d19e 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -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;
diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic.c
index fcbcc03..9d6374d 100644
--- a/arch/x86/kernel/apic.c
+++ b/arch/x86/kernel/apic.c
@@ -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();
}
/**
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 82743d1..e151b47 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index d0374c6..ac6be19 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 52b3eb5..9acb711 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 7ec2ca4..8d3358d 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index acf12de..cb83bcb 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 049/114] x86, es7000: clean up es7000_enable_apic_mode()
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (47 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 048/114] x86: refactor ->enable_apic_mode() " Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 050/114] x86, apic: unify phys_pkg_id() Ingo Molnar
` (66 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, 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
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index 717c27f..038c4f0 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -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)
diff --git a/arch/x86/kernel/es7000_32.c b/arch/x86/kernel/es7000_32.c
index 20a2a43..e73fe18 100644
--- a/arch/x86/kernel/es7000_32.c
+++ b/arch/x86/kernel/es7000_32.c
@@ -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);
}
}
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 9acb711..1185964 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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)
{
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 050/114] x86, apic: unify phys_pkg_id()
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (48 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 049/114] x86, es7000: clean up es7000_enable_apic_mode() Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 051/114] x86, apic: refactor ->phys_pkg_id() Ingo Molnar
` (65 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
- unify the call signature of 64-bit to that of 32-bit
- clean up the types all around
- clean up namespace contamination
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index f49d440..b7cba5b 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -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;
}
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index 038c4f0..d2c6c20 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -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;
}
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h
index f292fd0..14b19de 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -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
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index 3647c92..55797a3 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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;
}
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index dc93c30..bc2c8a4 100644
--- a/arch/x86/include/asm/numaq/apic.h
+++ b/arch/x86/include/asm/numaq/apic.h
@@ -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;
}
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index 526d19e..64cd441 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -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;
}
diff --git a/arch/x86/kernel/cpu/addon_cpuid_features.c b/arch/x86/kernel/cpu/addon_cpuid_features.c
index 4e581fd..84f8e4a 100644
--- a/arch/x86/kernel/cpu/addon_cpuid_features.c
+++ b/arch/x86/kernel/cpu/addon_cpuid_features.c
@@ -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);
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 275e2cb..93c491c 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -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
/*
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index 78adf71..cc9e07b 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_cluster.c b/arch/x86/kernel/genx2apic_cluster.c
index 7062e24..18b6f14 100644
--- a/arch/x86/kernel/genx2apic_cluster.c
+++ b/arch/x86/kernel/genx2apic_cluster.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_phys.c b/arch/x86/kernel/genx2apic_phys.c
index 7177a11..2cb6f49 100644
--- a/arch/x86/kernel/genx2apic_phys.c
+++ b/arch/x86/kernel/genx2apic_phys.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c
index debd721..67e7658 100644
--- a/arch/x86/kernel/genx2apic_uv_x.c
+++ b/arch/x86/kernel/genx2apic_uv_x.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 051/114] x86, apic: refactor ->phys_pkg_id()
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (49 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 050/114] x86, apic: unify phys_pkg_id() Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 052/114] x86, smp: clean up mps_oem_check() Ingo Molnar
` (64 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Refactor the ->phys_pkg_id() methods:
- namespace separation
- macro wrapper removal
- open-coded calls to the methods in the generic code
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index b7cba5b..1230f5d 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -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;
}
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index d2c6c20..f183dfb 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -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;
}
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index 55797a3..d060528 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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;
}
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index 6fed521..1eeb5b6 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -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);
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index bc2c8a4..765c4d5 100644
--- a/arch/x86/include/asm/numaq/apic.h
+++ b/arch/x86/include/asm/numaq/apic.h
@@ -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;
}
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index 64cd441..fa6b3b4 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -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;
}
diff --git a/arch/x86/kernel/cpu/addon_cpuid_features.c b/arch/x86/kernel/cpu/addon_cpuid_features.c
index 84f8e4a..e8bb892 100644
--- a/arch/x86/kernel/cpu/addon_cpuid_features.c
+++ b/arch/x86/kernel/cpu/addon_cpuid_features.c
@@ -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);
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 93c491c..055b9c3 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -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
/*
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index e151b47..d04b389 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index ac6be19..5c9266f 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 1185964..52787e3 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 8d3358d..6a1134e 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index cb83bcb..2d6843a 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 052/114] x86, smp: clean up mps_oem_check()
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (50 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 051/114] x86, apic: refactor ->phys_pkg_id() Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:41 ` [PATCH 053/114] x86, mpparse: call the generic quirk handlers early Ingo Molnar
` (63 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Impact: cleanup
- allow NULL ->mps_oem_check() entries
- clean up the code flow
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/genapic.h | 3 +--
arch/x86/mach-generic/probe.c | 22 +++++++++++++---------
2 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h
index 14b19de..8bb1c73 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -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);
diff --git a/arch/x86/mach-generic/probe.c b/arch/x86/mach-generic/probe.c
index a21e2b1..799a70f 100644
--- a/arch/x86/mach-generic/probe.c
+++ b/arch/x86/mach-generic/probe.c
@@ -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;
}
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 053/114] x86, mpparse: call the generic quirk handlers early
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (51 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 052/114] x86, smp: clean up mps_oem_check() Ingo Molnar
@ 2009-01-28 23:41 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 054/114] x86: consolidate the ->mps_oem_check() code Ingo Molnar
` (62 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Call all the registered MPS quirk handlers early. These methods scan
low RAM typically for specific signatures so are safe to be called
early.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/kernel/mpparse.c | 11 +----------
1 files changed, 1 insertions(+), 10 deletions(-)
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
index c8a534a..f6fb192 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -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)
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 054/114] x86: consolidate the ->mps_oem_check() code
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (52 preceding siblings ...)
2009-01-28 23:41 ` [PATCH 053/114] x86, mpparse: call the generic quirk handlers early Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 055/114] x86, apic: refactor ->get_apic_id() & GET_APIC_ID() Ingo Molnar
` (61 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
- spread out the mps_oem_check() namespace on a per APIC driver basis
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/es7000/mpparse.h b/arch/x86/include/asm/es7000/mpparse.h
index 30692c4..662eb1e 100644
--- a/arch/x86/include/asm/es7000/mpparse.h
+++ b/arch/x86/include/asm/es7000/mpparse.h
@@ -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;
diff --git a/arch/x86/include/asm/mach-default/mach_mpparse.h b/arch/x86/include/asm/mach-default/mach_mpparse.h
index 8fa0177..af0da14 100644
--- a/arch/x86/include/asm/mach-default/mach_mpparse.h
+++ b/arch/x86/include/asm/mach-default/mach_mpparse.h
@@ -2,7 +2,7 @@
#define _ASM_X86_MACH_DEFAULT_MACH_MPPARSE_H
static 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;
}
diff --git a/arch/x86/include/asm/mach-generic/mach_mpparse.h b/arch/x86/include/asm/mach-generic/mach_mpparse.h
index f497d96..22bfb56 100644
--- a/arch/x86/include/asm/mach-generic/mach_mpparse.h
+++ b/arch/x86/include/asm/mach-generic/mach_mpparse.h
@@ -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 *);
diff --git a/arch/x86/include/asm/summit/mpparse.h b/arch/x86/include/asm/summit/mpparse.h
index 555ed82..4bbcce3 100644
--- a/arch/x86/include/asm/summit/mpparse.h
+++ b/arch/x86/include/asm/summit/mpparse.h
@@ -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)
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
index f6fb192..b12fa5c 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -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)
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index d04b389..6bf6aaf 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index 5c9266f..e5f85cd 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 52787e3..f861163 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 6a1134e..517882c 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/probe.c b/arch/x86/mach-generic/probe.c
index 799a70f..ab68c6e 100644
--- a/arch/x86/mach-generic/probe.c
+++ b/arch/x86/mach-generic/probe.c
@@ -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;
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 2d6843a..719e944 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 055/114] x86, apic: refactor ->get_apic_id() & GET_APIC_ID()
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (53 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 054/114] x86: consolidate the ->mps_oem_check() code Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 056/114] x86, apic: refactor ->apic_id_mask & APIC_ID_MASK Ingo Molnar
` (60 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
- spread out the namespace on a per driver basis
- get rid of macro wrappers
- small cleanups
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/bigsmp/apicdef.h b/arch/x86/include/asm/bigsmp/apicdef.h
index 392c3f5..ed25dd6 100644
--- a/arch/x86/include/asm/bigsmp/apicdef.h
+++ b/arch/x86/include/asm/bigsmp/apicdef.h
@@ -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
diff --git a/arch/x86/include/asm/es7000/apicdef.h b/arch/x86/include/asm/es7000/apicdef.h
index 8b234a3..e237917 100644
--- a/arch/x86/include/asm/es7000/apicdef.h
+++ b/arch/x86/include/asm/es7000/apicdef.h
@@ -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
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index d060528..8719208 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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);
diff --git a/arch/x86/include/asm/mach-default/mach_apicdef.h b/arch/x86/include/asm/mach-default/mach_apicdef.h
index b4dcc09..e84d437 100644
--- a/arch/x86/include/asm/mach-default/mach_apicdef.h
+++ b/arch/x86/include/asm/mach-default/mach_apicdef.h
@@ -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 */
diff --git a/arch/x86/include/asm/mach-generic/mach_apicdef.h b/arch/x86/include/asm/mach-generic/mach_apicdef.h
index acc9add..645520b 100644
--- a/arch/x86/include/asm/mach-generic/mach_apicdef.h
+++ b/arch/x86/include/asm/mach-generic/mach_apicdef.h
@@ -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
diff --git a/arch/x86/include/asm/numaq/apicdef.h b/arch/x86/include/asm/numaq/apicdef.h
index e012a46..29f5e3d 100644
--- a/arch/x86/include/asm/numaq/apicdef.h
+++ b/arch/x86/include/asm/numaq/apicdef.h
@@ -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
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
index 45ef8a1..c63d480 100644
--- a/arch/x86/include/asm/smp.h
+++ b/arch/x86/include/asm/smp.h
@@ -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
diff --git a/arch/x86/include/asm/summit/apicdef.h b/arch/x86/include/asm/summit/apicdef.h
index f3fbca1..4286528 100644
--- a/arch/x86/include/asm/summit/apicdef.h
+++ b/arch/x86/include/asm/summit/apicdef.h
@@ -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
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index cc9e07b..ab47091 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_cluster.c b/arch/x86/kernel/genx2apic_cluster.c
index 18b6f14..c7557e0 100644
--- a/arch/x86/kernel/genx2apic_cluster.c
+++ b/arch/x86/kernel/genx2apic_cluster.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_phys.c b/arch/x86/kernel/genx2apic_phys.c
index 2cb6f49..80cba49 100644
--- a/arch/x86/kernel/genx2apic_phys.c
+++ b/arch/x86/kernel/genx2apic_phys.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c
index 67e7658..50310b9 100644
--- a/arch/x86/kernel/genx2apic_uv_x.c
+++ b/arch/x86/kernel/genx2apic_uv_x.c
@@ -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,
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 6bf6aaf..9eca977 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index e5f85cd..d51a3f0 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index f861163..1944675 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 517882c..fcbba84 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 719e944..5650eaf 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 056/114] x86, apic: refactor ->apic_id_mask & APIC_ID_MASK
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (54 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 055/114] x86, apic: refactor ->get_apic_id() & GET_APIC_ID() Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 057/114] x86, apic: get rid of *_APIC_ID_MASK definitions Ingo Molnar
` (59 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
- spread out the namespace on a per driver basis
- get rid of wrapper macros
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/bigsmp/apicdef.h b/arch/x86/include/asm/bigsmp/apicdef.h
index ed25dd6..6e58781 100644
--- a/arch/x86/include/asm/bigsmp/apicdef.h
+++ b/arch/x86/include/asm/bigsmp/apicdef.h
@@ -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)
{
diff --git a/arch/x86/include/asm/es7000/apicdef.h b/arch/x86/include/asm/es7000/apicdef.h
index e237917..476da0c 100644
--- a/arch/x86/include/asm/es7000/apicdef.h
+++ b/arch/x86/include/asm/es7000/apicdef.h
@@ -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)
{
diff --git a/arch/x86/include/asm/mach-default/mach_apicdef.h b/arch/x86/include/asm/mach-default/mach_apicdef.h
index e84d437..8318d12 100644
--- a/arch/x86/include/asm/mach-default/mach_apicdef.h
+++ b/arch/x86/include/asm/mach-default/mach_apicdef.h
@@ -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)
{
diff --git a/arch/x86/include/asm/mach-generic/mach_apicdef.h b/arch/x86/include/asm/mach-generic/mach_apicdef.h
index 645520b..61caa65 100644
--- a/arch/x86/include/asm/mach-generic/mach_apicdef.h
+++ b/arch/x86/include/asm/mach-generic/mach_apicdef.h
@@ -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 */
diff --git a/arch/x86/include/asm/numaq/apicdef.h b/arch/x86/include/asm/numaq/apicdef.h
index 29f5e3d..6f2cc5d 100644
--- a/arch/x86/include/asm/numaq/apicdef.h
+++ b/arch/x86/include/asm/numaq/apicdef.h
@@ -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)
{
diff --git a/arch/x86/include/asm/summit/apicdef.h b/arch/x86/include/asm/summit/apicdef.h
index 4286528..0373f0c 100644
--- a/arch/x86/include/asm/summit/apicdef.h
+++ b/arch/x86/include/asm/summit/apicdef.h
@@ -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)
{
diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic.c
index 9d6374d..5f7f3a9 100644
--- a/arch/x86/kernel/apic.c
+++ b/arch/x86/kernel/apic.c
@@ -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;
/*
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index ab47091..78baa55 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -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,
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 9eca977..1f4ad4f 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index d51a3f0..239af25 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 1944675..21fb33e 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index fcbba84..27d2d1f 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 5650eaf..f24cba1 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 057/114] x86, apic: get rid of *_APIC_ID_MASK definitions
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (55 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 056/114] x86, apic: refactor ->apic_id_mask & APIC_ID_MASK Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 058/114] x86, apic: refactor ->cpu_mask_to_apicid*() Ingo Molnar
` (58 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Impact: cleanup
Remove the *_APIC_ID_MASK subarch definitions and move them straight
to the genapic driver initialization code.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/bigsmp/apicdef.h b/arch/x86/include/asm/bigsmp/apicdef.h
index 6e58781..e58dee8 100644
--- a/arch/x86/include/asm/bigsmp/apicdef.h
+++ b/arch/x86/include/asm/bigsmp/apicdef.h
@@ -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;
diff --git a/arch/x86/include/asm/es7000/apicdef.h b/arch/x86/include/asm/es7000/apicdef.h
index 476da0c..c74881a 100644
--- a/arch/x86/include/asm/es7000/apicdef.h
+++ b/arch/x86/include/asm/es7000/apicdef.h
@@ -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;
diff --git a/arch/x86/include/asm/mach-default/mach_apicdef.h b/arch/x86/include/asm/mach-default/mach_apicdef.h
index 8318d12..5141085 100644
--- a/arch/x86/include/asm/mach-default/mach_apicdef.h
+++ b/arch/x86/include/asm/mach-default/mach_apicdef.h
@@ -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)
{
diff --git a/arch/x86/include/asm/numaq/apicdef.h b/arch/x86/include/asm/numaq/apicdef.h
index 6f2cc5d..cd927d5 100644
--- a/arch/x86/include/asm/numaq/apicdef.h
+++ b/arch/x86/include/asm/numaq/apicdef.h
@@ -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;
diff --git a/arch/x86/include/asm/summit/apicdef.h b/arch/x86/include/asm/summit/apicdef.h
index 0373f0c..c24b0df 100644
--- a/arch/x86/include/asm/summit/apicdef.h
+++ b/arch/x86/include/asm/summit/apicdef.h
@@ -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;
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 1f4ad4f..ee52c59 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index 239af25..e4ed7e6 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 21fb33e..3d046de 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 27d2d1f..a7bf1aa 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index f24cba1..a0ae6b9 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 058/114] x86, apic: refactor ->cpu_mask_to_apicid*()
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (56 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 057/114] x86, apic: get rid of *_APIC_ID_MASK definitions Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 059/114] x86, apic: untangle the send_IPI_*() jungle Ingo Molnar
` (57 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
- spread out the namespace on a per driver basis
- clean up the functions
- get rid of macros
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index 1230f5d..ee29d66 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -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);
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index f183dfb..b89b45d 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -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;
}
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index 8719208..8972f84 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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];
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index 1eeb5b6..ca460e4 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -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);
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index 765c4d5..ce95e79 100644
--- a/arch/x86/include/asm/numaq/apic.h
+++ b/arch/x86/include/asm/numaq/apic.h
@@ -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. */
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index fa6b3b4..15b8dbd 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -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;
}
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index 78baa55..b941b11 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -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;
}
diff --git a/arch/x86/kernel/genx2apic_cluster.c b/arch/x86/kernel/genx2apic_cluster.c
index c7557e0..62f9fcc 100644
--- a/arch/x86/kernel/genx2apic_cluster.c
+++ b/arch/x86/kernel/genx2apic_cluster.c
@@ -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;
}
diff --git a/arch/x86/kernel/genx2apic_phys.c b/arch/x86/kernel/genx2apic_phys.c
index 80cba49..3da1675 100644
--- a/arch/x86/kernel/genx2apic_phys.c
+++ b/arch/x86/kernel/genx2apic_phys.c
@@ -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;
}
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c
index 50310b9..f957878 100644
--- a/arch/x86/kernel/genx2apic_uv_x.c
+++ b/arch/x86/kernel/genx2apic_uv_x.c
@@ -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;
}
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index 3d85d3d..01a2505 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -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 irq
if (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_ms
if (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);
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index ee52c59..22c2c7b 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index e4ed7e6..477ebec 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 3d046de..d758cf6 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index a7bf1aa..eb7d56a 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index a0ae6b9..8c29305 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 059/114] x86, apic: untangle the send_IPI_*() jungle
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (57 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 058/114] x86, apic: refactor ->cpu_mask_to_apicid*() Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 060/114] x86, smp: clean up ->trampoline_phys_low/high handling Ingo Molnar
` (56 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Our 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
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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%)
diff --git a/arch/x86/include/asm/bigsmp/ipi.h b/arch/x86/include/asm/bigsmp/ipi.h
dissimilarity index 81%
index 27fcd01..a91db69 100644
--- a/arch/x86/include/asm/bigsmp/ipi.h
+++ b/arch/x86/include/asm/bigsmp/ipi.h
@@ -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 */
diff --git a/arch/x86/include/asm/es7000/ipi.h b/arch/x86/include/asm/es7000/ipi.h
dissimilarity index 81%
index 7e8ed24..81e77c8 100644
--- a/arch/x86/include/asm/es7000/ipi.h
+++ b/arch/x86/include/asm/es7000/ipi.h
@@ -1,22 +1,22 @@
-#ifndef __ASM_ES7000_IPI_H
-#define __ASM_ES7000_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_ES7000_IPI_H */
+#ifndef __ASM_ES7000_IPI_H
+#define __ASM_ES7000_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 es7000_send_IPI_mask(const struct cpumask *mask, int vector)
+{
+ default_send_IPI_mask_sequence(mask, vector);
+}
+
+static inline void es7000_send_IPI_allbutself(int vector)
+{
+ default_send_IPI_mask_allbutself(cpu_online_mask, vector);
+}
+
+static inline void es7000_send_IPI_all(int vector)
+{
+ es7000_send_IPI_mask(cpu_online_mask, vector);
+}
+
+#endif /* __ASM_ES7000_IPI_H */
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
index 8de644b..bfa921f 100644
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
@@ -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;
diff --git a/arch/x86/include/asm/ipi.h b/arch/x86/include/asm/ipi.h
index c745a30..a8d717f 100644
--- a/arch/x86/include/asm/ipi.h
+++ b/arch/x86/include/asm/ipi.h
@@ -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);
}
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index 8972f84..2e4104c 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -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
diff --git a/arch/x86/include/asm/mach-default/mach_ipi.h b/arch/x86/include/asm/mach-default/mach_ipi.h
dissimilarity index 65%
index 0893996..85dec63 100644
--- a/arch/x86/include/asm/mach-default/mach_ipi.h
+++ b/arch/x86/include/asm/mach-default/mach_ipi.h
@@ -1,64 +1,58 @@
-#ifndef _ASM_X86_MACH_DEFAULT_MACH_IPI_H
-#define _ASM_X86_MACH_DEFAULT_MACH_IPI_H
-
-/* Avoid include hell */
-#define NMI_VECTOR 0x02
-
-void send_IPI_mask_bitmask(const struct cpumask *mask, int vector);
-void send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
-void __send_IPI_shortcut(unsigned int shortcut, int vector);
-
-extern int no_broadcast;
-
-#ifdef CONFIG_X86_64
-#include <asm/genapic.h>
-#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)
-{
- send_IPI_mask_bitmask(mask, vector);
-}
-void send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
-#endif
-
-static inline void __local_send_IPI_allbutself(int vector)
-{
- if (no_broadcast || vector == NMI_VECTOR)
- send_IPI_mask_allbutself(cpu_online_mask, vector);
- else
- __send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
-}
-
-static inline void __local_send_IPI_all(int vector)
-{
- if (no_broadcast || vector == NMI_VECTOR)
- send_IPI_mask(cpu_online_mask, vector);
- else
- __send_IPI_shortcut(APIC_DEST_ALLINC, vector);
-}
-
-#ifdef CONFIG_X86_64
-#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)
-{
- /*
- * if there are no other CPUs in the system then we get an APIC send
- * error if we try to broadcast, thus avoid sending IPIs in this case.
- */
- if (!(num_online_cpus() > 1))
- return;
-
- __local_send_IPI_allbutself(vector);
- return;
-}
-
-static inline void send_IPI_all(int vector)
-{
- __local_send_IPI_all(vector);
-}
-#endif
-
-#endif /* _ASM_X86_MACH_DEFAULT_MACH_IPI_H */
+#ifndef _ASM_X86_MACH_DEFAULT_MACH_IPI_H
+#define _ASM_X86_MACH_DEFAULT_MACH_IPI_H
+
+/* Avoid include hell */
+#define NMI_VECTOR 0x02
+
+void default_send_IPI_mask_bitmask(const struct cpumask *mask, int vector);
+void default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
+void __default_send_IPI_shortcut(unsigned int shortcut, int vector);
+
+extern int no_broadcast;
+
+#ifdef CONFIG_X86_64
+#include <asm/genapic.h>
+#else
+static inline void default_send_IPI_mask(const struct cpumask *mask, int vector)
+{
+ default_send_IPI_mask_bitmask(mask, vector);
+}
+void default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
+#endif
+
+static inline void __default_local_send_IPI_allbutself(int vector)
+{
+ if (no_broadcast || vector == NMI_VECTOR)
+ apic->send_IPI_mask_allbutself(cpu_online_mask, vector);
+ else
+ __default_send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
+}
+
+static inline void __default_local_send_IPI_all(int vector)
+{
+ if (no_broadcast || vector == NMI_VECTOR)
+ apic->send_IPI_mask(cpu_online_mask, vector);
+ else
+ __default_send_IPI_shortcut(APIC_DEST_ALLINC, vector);
+}
+
+#ifdef CONFIG_X86_32
+static inline void default_send_IPI_allbutself(int vector)
+{
+ /*
+ * if there are no other CPUs in the system then we get an APIC send
+ * error if we try to broadcast, thus avoid sending IPIs in this case.
+ */
+ if (!(num_online_cpus() > 1))
+ return;
+
+ __default_local_send_IPI_allbutself(vector);
+}
+
+static inline void default_send_IPI_all(int vector)
+{
+ __default_local_send_IPI_all(vector);
+}
+#endif
+
+#endif /* _ASM_X86_MACH_DEFAULT_MACH_IPI_H */
diff --git a/arch/x86/include/asm/mach-generic/mach_ipi.h b/arch/x86/include/asm/mach-generic/mach_ipi.h
index 75e54bd..5691c09 100644
--- a/arch/x86/include/asm/mach-generic/mach_ipi.h
+++ b/arch/x86/include/asm/mach-generic/mach_ipi.h
@@ -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 */
diff --git a/arch/x86/include/asm/numaq/ipi.h b/arch/x86/include/asm/numaq/ipi.h
dissimilarity index 81%
index a8374c6..5dbc4b4 100644
--- a/arch/x86/include/asm/numaq/ipi.h
+++ b/arch/x86/include/asm/numaq/ipi.h
@@ -1,22 +1,22 @@
-#ifndef __ASM_NUMAQ_IPI_H
-#define __ASM_NUMAQ_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_NUMAQ_IPI_H */
+#ifndef __ASM_NUMAQ_IPI_H
+#define __ASM_NUMAQ_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 numaq_send_IPI_mask(const struct cpumask *mask, int vector)
+{
+ default_send_IPI_mask_sequence(mask, vector);
+}
+
+static inline void numaq_send_IPI_allbutself(int vector)
+{
+ default_send_IPI_mask_allbutself(cpu_online_mask, vector);
+}
+
+static inline void numaq_send_IPI_all(int vector)
+{
+ numaq_send_IPI_mask(cpu_online_mask, vector);
+}
+
+#endif /* __ASM_NUMAQ_IPI_H */
diff --git a/arch/x86/include/asm/summit/ipi.h b/arch/x86/include/asm/summit/ipi.h
dissimilarity index 66%
index a8a2c24..f87a43f 100644
--- a/arch/x86/include/asm/summit/ipi.h
+++ b/arch/x86/include/asm/summit/ipi.h
@@ -1,26 +1,26 @@
-#ifndef __ASM_SUMMIT_IPI_H
-#define __ASM_SUMMIT_IPI_H
-
-void send_IPI_mask_sequence(const cpumask_t *mask, int vector);
-void send_IPI_mask_allbutself(const cpumask_t *mask, int vector);
-
-static inline void send_IPI_mask(const cpumask_t *mask, int vector)
-{
- send_IPI_mask_sequence(mask, vector);
-}
-
-static inline void send_IPI_allbutself(int vector)
-{
- cpumask_t mask = cpu_online_map;
- cpu_clear(smp_processor_id(), mask);
-
- if (!cpus_empty(mask))
- send_IPI_mask(&mask, vector);
-}
-
-static inline void send_IPI_all(int vector)
-{
- send_IPI_mask(&cpu_online_map, vector);
-}
-
-#endif /* __ASM_SUMMIT_IPI_H */
+#ifndef __ASM_SUMMIT_IPI_H
+#define __ASM_SUMMIT_IPI_H
+
+void default_send_IPI_mask_sequence(const cpumask_t *mask, int vector);
+void default_send_IPI_mask_allbutself(const cpumask_t *mask, int vector);
+
+static inline void summit_send_IPI_mask(const cpumask_t *mask, int vector)
+{
+ default_send_IPI_mask_sequence(mask, vector);
+}
+
+static inline void summit_send_IPI_allbutself(int vector)
+{
+ cpumask_t mask = cpu_online_map;
+ cpu_clear(smp_processor_id(), mask);
+
+ if (!cpus_empty(mask))
+ summit_send_IPI_mask(&mask, vector);
+}
+
+static inline void summit_send_IPI_all(int vector)
+{
+ summit_send_IPI_mask(&cpu_online_map, vector);
+}
+
+#endif /* __ASM_SUMMIT_IPI_H */
diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic.c
index 5f7f3a9..84b8e7c 100644
--- a/arch/x86/kernel/apic.c
+++ b/arch/x86/kernel/apic.c
@@ -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
}
diff --git a/arch/x86/kernel/genapic_64.c b/arch/x86/kernel/genapic_64.c
index d57d213..820dea5 100644
--- a/arch/x86/kernel/genapic_64.c
+++ b/arch/x86/kernel/genapic_64.c
@@ -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)
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index b941b11..7c648cc 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -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)
diff --git a/arch/x86/kernel/genx2apic_cluster.c b/arch/x86/kernel/genx2apic_cluster.c
index 62f9fcc..2d97726 100644
--- a/arch/x86/kernel/genx2apic_cluster.c
+++ b/arch/x86/kernel/genx2apic_cluster.c
@@ -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 = {
diff --git a/arch/x86/kernel/genx2apic_phys.c b/arch/x86/kernel/genx2apic_phys.c
index 3da1675..74777c2 100644
--- a/arch/x86/kernel/genx2apic_phys.c
+++ b/arch/x86/kernel/genx2apic_phys.c
@@ -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 = {
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c
index f957878..24b9f42 100644
--- a/arch/x86/kernel/genx2apic_uv_x.c
+++ b/arch/x86/kernel/genx2apic_uv_x.c
@@ -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)
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index 01a2505..e90970c 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -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;
}
diff --git a/arch/x86/kernel/ipi.c b/arch/x86/kernel/ipi.c
index 367c5e6..e16c41b 100644
--- a/arch/x86/kernel/ipi.c
+++ b/arch/x86/kernel/ipi.c
@@ -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);
}
diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c
index 10435a1..b62a381 100644
--- a/arch/x86/kernel/kgdb.c
+++ b/arch/x86/kernel/kgdb.c
@@ -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
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index f8536fe..38dace2 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -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 = {
diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
index e6faa33..c48ba6c 100644
--- a/arch/x86/kernel/smp.c
+++ b/arch/x86/kernel/smp.c
@@ -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);
}
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 22c2c7b..4782b55 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index 477ebec..bf4670d 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index d758cf6..d36642e 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index eb7d56a..135b183 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 8c29305..77196a4 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 72a6d4e..6348e11 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -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)))
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 060/114] x86, smp: clean up ->trampoline_phys_low/high handling
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (58 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 059/114] x86, apic: untangle the send_IPI_*() jungle Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 061/114] x86: set ->trampoline_phys_low/high on 64-bit too Ingo Molnar
` (55 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
- spread out the namespace on a per apic driver basis
- remove wrapper macros
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/es7000/wakecpu.h b/arch/x86/include/asm/es7000/wakecpu.h
index 78f0daa..4c01be6 100644
--- a/arch/x86/include/asm/es7000/wakecpu.h
+++ b/arch/x86/include/asm/es7000/wakecpu.h
@@ -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 0x469
static inline void wait_for_init_deassert(atomic_t *deassert)
{
diff --git a/arch/x86/include/asm/mach-default/mach_wakecpu.h b/arch/x86/include/asm/mach-default/mach_wakecpu.h
index 89897a6..0a8d786 100644
--- a/arch/x86/include/asm/mach-default/mach_wakecpu.h
+++ b/arch/x86/include/asm/mach-default/mach_wakecpu.h
@@ -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)
{
diff --git a/arch/x86/include/asm/mach-default/smpboot_hooks.h b/arch/x86/include/asm/mach-default/smpboot_hooks.h
index 23bf521..1def601 100644
--- a/arch/x86/include/asm/mach-default/smpboot_hooks.h
+++ b/arch/x86/include/asm/mach-default/smpboot_hooks.h
@@ -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)
diff --git a/arch/x86/include/asm/mach-generic/mach_wakecpu.h b/arch/x86/include/asm/mach-generic/mach_wakecpu.h
index 22006bb..2031377 100644
--- a/arch/x86/include/asm/mach-generic/mach_wakecpu.h
+++ b/arch/x86/include/asm/mach-generic/mach_wakecpu.h
@@ -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)
diff --git a/arch/x86/include/asm/numaq/wakecpu.h b/arch/x86/include/asm/numaq/wakecpu.h
index 6f499df..8b6c16d 100644
--- a/arch/x86/include/asm/numaq/wakecpu.h
+++ b/arch/x86/include/asm/numaq/wakecpu.h
@@ -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;
}
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 4782b55..a317fbe 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index bf4670d..17d8f9c 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index d36642e..871e854 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 135b183..0b496ab 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 77196a4..c4799cd 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 061/114] x86: set ->trampoline_phys_low/high on 64-bit too
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (59 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 060/114] x86, smp: clean up ->trampoline_phys_low/high handling Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 062/114] x86, smp: refactor ->wait_for_init_deassert() Ingo Molnar
` (54 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
64-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.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h
index 8bb1c73..90e83a7 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -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
diff --git a/arch/x86/include/asm/mach-default/mach_wakecpu.h b/arch/x86/include/asm/mach-default/mach_wakecpu.h
index 0a8d786..a327a67 100644
--- a/arch/x86/include/asm/mach-default/mach_wakecpu.h
+++ b/arch/x86/include/asm/mach-default/mach_wakecpu.h
@@ -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))
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index 7c648cc..3a28d6a 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_cluster.c b/arch/x86/kernel/genx2apic_cluster.c
index 2d97726..abc5ee3 100644
--- a/arch/x86/kernel/genx2apic_cluster.c
+++ b/arch/x86/kernel/genx2apic_cluster.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_phys.c b/arch/x86/kernel/genx2apic_phys.c
index 74777c2..dc815ef 100644
--- a/arch/x86/kernel/genx2apic_phys.c
+++ b/arch/x86/kernel/genx2apic_phys.c
@@ -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,
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c
index 24b9f42..b590873 100644
--- a/arch/x86/kernel/genx2apic_uv_x.c
+++ b/arch/x86/kernel/genx2apic_uv_x.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 062/114] x86, smp: refactor ->wait_for_init_deassert()
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (60 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 061/114] x86: set ->trampoline_phys_low/high on 64-bit too Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 063/114] x86, smp: refactor ->smp_callin_clear_local_apic() methods Ingo Molnar
` (53 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, 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
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/es7000/wakecpu.h b/arch/x86/include/asm/es7000/wakecpu.h
index 4c01be6..5c4d05f 100644
--- a/arch/x86/include/asm/es7000/wakecpu.h
+++ b/arch/x86/include/asm/es7000/wakecpu.h
@@ -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))
diff --git a/arch/x86/include/asm/mach-default/mach_wakecpu.h b/arch/x86/include/asm/mach-default/mach_wakecpu.h
index a327a67..1d34c69 100644
--- a/arch/x86/include/asm/mach-default/mach_wakecpu.h
+++ b/arch/x86/include/asm/mach-default/mach_wakecpu.h
@@ -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();
diff --git a/arch/x86/include/asm/mach-generic/mach_wakecpu.h b/arch/x86/include/asm/mach-generic/mach_wakecpu.h
index 2031377..58e5412 100644
--- a/arch/x86/include/asm/mach-generic/mach_wakecpu.h
+++ b/arch/x86/include/asm/mach-generic/mach_wakecpu.h
@@ -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)
diff --git a/arch/x86/include/asm/numaq/wakecpu.h b/arch/x86/include/asm/numaq/wakecpu.h
index 8b6c16d..884b95c 100644
--- a/arch/x86/include/asm/numaq/wakecpu.h
+++ b/arch/x86/include/asm/numaq/wakecpu.h
@@ -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.
diff --git a/arch/x86/kernel/es7000_32.c b/arch/x86/kernel/es7000_32.c
index e73fe18..d7f433e 100644
--- a/arch/x86/kernel/es7000_32.c
+++ b/arch/x86/kernel/es7000_32.c
@@ -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;
}
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index ab83be2..558af37 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -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.)
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index a317fbe..40910bf 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index 17d8f9c..c246484 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 871e854..4cb3984 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 0b496ab..fb03867 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index c4799cd..fdca78b 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 063/114] x86, smp: refactor ->smp_callin_clear_local_apic() methods
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (61 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 062/114] x86, smp: refactor ->wait_for_init_deassert() Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 064/114] x86, smp: refactor ->store/restore_NMI_vector() methods Ingo Molnar
` (52 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Only 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.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/es7000/wakecpu.h b/arch/x86/include/asm/es7000/wakecpu.h
index 5c4d05f..e8e0396 100644
--- a/arch/x86/include/asm/es7000/wakecpu.h
+++ b/arch/x86/include/asm/es7000/wakecpu.h
@@ -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)
{
}
diff --git a/arch/x86/include/asm/mach-default/mach_wakecpu.h b/arch/x86/include/asm/mach-default/mach_wakecpu.h
index 1d34c69..d059807 100644
--- a/arch/x86/include/asm/mach-default/mach_wakecpu.h
+++ b/arch/x86/include/asm/mach-default/mach_wakecpu.h
@@ -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)
{
}
diff --git a/arch/x86/include/asm/mach-generic/mach_wakecpu.h b/arch/x86/include/asm/mach-generic/mach_wakecpu.h
index 58e5412..30515a1 100644
--- a/arch/x86/include/asm/mach-generic/mach_wakecpu.h
+++ b/arch/x86/include/asm/mach-generic/mach_wakecpu.h
@@ -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)
diff --git a/arch/x86/include/asm/numaq/wakecpu.h b/arch/x86/include/asm/numaq/wakecpu.h
index 884b95c..61d0a7d 100644
--- a/arch/x86/include/asm/numaq/wakecpu.h
+++ b/arch/x86/include/asm/numaq/wakecpu.h
@@ -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();
}
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 558af37..10873a4 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -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();
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 40910bf..bd069e7 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index c246484..a25e6ef 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 4cb3984..ab41b54 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index fb03867..4d3924f 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index fdca78b..2595baa 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 064/114] x86, smp: refactor ->store/restore_NMI_vector() methods
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (62 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 063/114] x86, smp: refactor ->smp_callin_clear_local_apic() methods Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 065/114] x86, smp: remove ->restore_NMI_vector() Ingo Molnar
` (51 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Only NUMAQ does something substantial here, because it initializes
via NMIs (not via INIT as standard SMP startup) - so it needs to
store and restore the NMI vector.
- extend the generic code to handle NULL methods
- clear out dummy methods and replace them with NULL
- clean up: remove wrapper macros, etc.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/es7000/wakecpu.h b/arch/x86/include/asm/es7000/wakecpu.h
index e8e0396..71a3a41 100644
--- a/arch/x86/include/asm/es7000/wakecpu.h
+++ b/arch/x86/include/asm/es7000/wakecpu.h
@@ -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)
diff --git a/arch/x86/include/asm/mach-default/mach_wakecpu.h b/arch/x86/include/asm/mach-default/mach_wakecpu.h
index d059807..656bb5e 100644
--- a/arch/x86/include/asm/mach-default/mach_wakecpu.h
+++ b/arch/x86/include/asm/mach-default/mach_wakecpu.h
@@ -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 */
diff --git a/arch/x86/include/asm/mach-generic/mach_wakecpu.h b/arch/x86/include/asm/mach-generic/mach_wakecpu.h
index 30515a1..93207df 100644
--- a/arch/x86/include/asm/mach-generic/mach_wakecpu.h
+++ b/arch/x86/include/asm/mach-generic/mach_wakecpu.h
@@ -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 */
diff --git a/arch/x86/include/asm/numaq/wakecpu.h b/arch/x86/include/asm/numaq/wakecpu.h
index 61d0a7d..1232017 100644
--- a/arch/x86/include/asm/numaq/wakecpu.h
+++ b/arch/x86/include/asm/numaq/wakecpu.h
@@ -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)) =
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 10873a4..1492024 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -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);
/*
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index bd069e7..ecdb230 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
};
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index a25e6ef..9509256 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
};
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index ab41b54..1319070 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
};
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 4d3924f..d7f7fcf 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
};
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 2595baa..46fca79 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
};
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 065/114] x86, smp: remove ->restore_NMI_vector()
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (63 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 064/114] x86, smp: refactor ->store/restore_NMI_vector() methods Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 066/114] x86, smp: refactor ->inquire_remote_apic() methods Ingo Molnar
` (50 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Nothing actually restores the NMI vector - so remove this
logic altogether.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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(-)
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h
index 90e83a7..e5f9c56 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -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);
};
diff --git a/arch/x86/include/asm/numaq/wakecpu.h b/arch/x86/include/asm/numaq/wakecpu.h
index 1232017..920dcfe 100644
--- a/arch/x86/include/asm/numaq/wakecpu.h
+++ b/arch/x86/include/asm/numaq/wakecpu.h
@@ -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)
{
}
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index 3a28d6a..e9237f5 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -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,
};
diff --git a/arch/x86/kernel/genx2apic_cluster.c b/arch/x86/kernel/genx2apic_cluster.c
index abc5ee3..7c87156 100644
--- a/arch/x86/kernel/genx2apic_cluster.c
+++ b/arch/x86/kernel/genx2apic_cluster.c
@@ -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,
};
diff --git a/arch/x86/kernel/genx2apic_phys.c b/arch/x86/kernel/genx2apic_phys.c
index dc815ef..5cbae8a 100644
--- a/arch/x86/kernel/genx2apic_phys.c
+++ b/arch/x86/kernel/genx2apic_phys.c
@@ -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,
};
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c
index b590873..6adb5e6 100644
--- a/arch/x86/kernel/genx2apic_uv_x.c
+++ b/arch/x86/kernel/genx2apic_uv_x.c
@@ -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,
};
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index ecdb230..d9377af 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -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,
};
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index 9509256..b004257 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -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,
};
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 1319070..62673a8 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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,
};
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index d7f7fcf..2c33415 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -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,
};
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 46fca79..c2471a9 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -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,
};
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 066/114] x86, smp: refactor ->inquire_remote_apic() methods
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (64 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 065/114] x86, smp: remove ->restore_NMI_vector() Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 067/114] x86, ES7000: consolidate the APIC code Ingo Molnar
` (49 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Nothing exciting - a few subarches dont want APIC remote reads to
be performed - the others are content with the default method.
- extend the generic code to handle NULL methods
- clear out dummy methods and replace them with NULL
- clean up: remove wrapper macros, etc.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/es7000/wakecpu.h | 8 --------
arch/x86/include/asm/mach-default/mach_wakecpu.h | 2 +-
arch/x86/include/asm/mach-generic/mach_wakecpu.h | 2 --
arch/x86/include/asm/numaq/wakecpu.h | 4 ----
arch/x86/kernel/smpboot.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 +-
10 files changed, 8 insertions(+), 22 deletions(-)
diff --git a/arch/x86/include/asm/es7000/wakecpu.h b/arch/x86/include/asm/es7000/wakecpu.h
index 71a3a41..99c72be 100644
--- a/arch/x86/include/asm/es7000/wakecpu.h
+++ b/arch/x86/include/asm/es7000/wakecpu.h
@@ -13,12 +13,4 @@ static inline void es7000_wait_for_init_deassert(atomic_t *deassert)
return;
}
-extern void __inquire_remote_apic(int apicid);
-
-static inline void inquire_remote_apic(int apicid)
-{
- if (apic_verbosity >= APIC_DEBUG)
- __inquire_remote_apic(apicid);
-}
-
#endif /* __ASM_MACH_WAKECPU_H */
diff --git a/arch/x86/include/asm/mach-default/mach_wakecpu.h b/arch/x86/include/asm/mach-default/mach_wakecpu.h
index 656bb5e..b1cde56 100644
--- a/arch/x86/include/asm/mach-default/mach_wakecpu.h
+++ b/arch/x86/include/asm/mach-default/mach_wakecpu.h
@@ -16,7 +16,7 @@ static inline void __inquire_remote_apic(int apicid)
}
#endif /* CONFIG_SMP */
-static inline void inquire_remote_apic(int apicid)
+static inline void default_inquire_remote_apic(int apicid)
{
if (apic_verbosity >= APIC_DEBUG)
__inquire_remote_apic(apicid);
diff --git a/arch/x86/include/asm/mach-generic/mach_wakecpu.h b/arch/x86/include/asm/mach-generic/mach_wakecpu.h
index 93207df..0b884c0 100644
--- a/arch/x86/include/asm/mach-generic/mach_wakecpu.h
+++ b/arch/x86/include/asm/mach-generic/mach_wakecpu.h
@@ -1,6 +1,4 @@
#ifndef _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H
#define _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H
-#define inquire_remote_apic (apic->inquire_remote_apic)
-
#endif /* _ASM_X86_MACH_GENERIC_MACH_APIC_H */
diff --git a/arch/x86/include/asm/numaq/wakecpu.h b/arch/x86/include/asm/numaq/wakecpu.h
index 920dcfe..afe8143 100644
--- a/arch/x86/include/asm/numaq/wakecpu.h
+++ b/arch/x86/include/asm/numaq/wakecpu.h
@@ -25,8 +25,4 @@ numaq_store_NMI_vector(unsigned short *high, unsigned short *low)
*((volatile unsigned short *)phys_to_virt(NUMAQ_TRAMPOLINE_PHYS_LOW));
}
-static inline void inquire_remote_apic(int apicid)
-{
-}
-
#endif /* __ASM_NUMAQ_WAKECPU_H */
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 1492024..170adc5 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -876,8 +876,8 @@ do_rest:
else
/* trampoline code not run */
printk(KERN_ERR "Not responding.\n");
- if (get_uv_system_type() != UV_NON_UNIQUE_APIC)
- inquire_remote_apic(apicid);
+ if (apic->inquire_remote_apic)
+ apic->inquire_remote_apic(apicid);
}
}
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index d9377af..4d8b2d4 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -111,5 +111,5 @@ struct genapic apic_bigsmp = {
.smp_callin_clear_local_apic = NULL,
.store_NMI_vector = NULL,
- .inquire_remote_apic = inquire_remote_apic,
+ .inquire_remote_apic = default_inquire_remote_apic,
};
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index b004257..c12dd23 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -92,5 +92,5 @@ struct genapic apic_default = {
.smp_callin_clear_local_apic = NULL,
.store_NMI_vector = NULL,
- .inquire_remote_apic = inquire_remote_apic,
+ .inquire_remote_apic = default_inquire_remote_apic,
};
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 62673a8..be090b2 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -148,5 +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,
- .inquire_remote_apic = inquire_remote_apic,
+ .inquire_remote_apic = default_inquire_remote_apic,
};
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 2c33415..ddb50fb 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -112,5 +112,5 @@ struct genapic apic_numaq = {
.smp_callin_clear_local_apic = numaq_smp_callin_clear_local_apic,
.store_NMI_vector = numaq_store_NMI_vector,
- .inquire_remote_apic = inquire_remote_apic,
+ .inquire_remote_apic = NULL,
};
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index c2471a9..d5db304 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -91,5 +91,5 @@ struct genapic apic_summit = {
.smp_callin_clear_local_apic = NULL,
.store_NMI_vector = NULL,
- .inquire_remote_apic = inquire_remote_apic,
+ .inquire_remote_apic = default_inquire_remote_apic,
};
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 067/114] x86, ES7000: consolidate the APIC code
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (65 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 066/114] x86, smp: refactor ->inquire_remote_apic() methods Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 068/114] x86, smp: eliminate asm/mach-default/mach_wakecpu.h Ingo Molnar
` (48 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Consolidate all the ES7000 APIC code into arch/x86/mach-generic/es7000.c.
With this ES7000 ceases to rely on any subarchitecture include files.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/es7000/apic.h | 236 -------------------------
arch/x86/include/asm/es7000/apicdef.h | 9 -
arch/x86/include/asm/es7000/ipi.h | 22 ---
arch/x86/include/asm/es7000/mpparse.h | 23 ---
arch/x86/include/asm/es7000/wakecpu.h | 16 --
arch/x86/mach-generic/es7000.c | 314 +++++++++++++++++++++++++++++++--
6 files changed, 295 insertions(+), 325 deletions(-)
delete mode 100644 arch/x86/include/asm/es7000/apic.h
delete mode 100644 arch/x86/include/asm/es7000/apicdef.h
delete mode 100644 arch/x86/include/asm/es7000/ipi.h
delete mode 100644 arch/x86/include/asm/es7000/mpparse.h
delete mode 100644 arch/x86/include/asm/es7000/wakecpu.h
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
deleted file mode 100644
index b89b45d..0000000
--- a/arch/x86/include/asm/es7000/apic.h
+++ /dev/null
@@ -1,236 +0,0 @@
-#ifndef __ASM_ES7000_APIC_H
-#define __ASM_ES7000_APIC_H
-
-#include <linux/gfp.h>
-
-#define xapic_phys_to_log_apicid(cpu) per_cpu(x86_bios_cpu_apicid, cpu)
-
-static inline int es7000_apic_id_registered(void)
-{
- return 1;
-}
-
-static inline const cpumask_t *target_cpus_cluster(void)
-{
- return &CPU_MASK_ALL;
-}
-
-static inline const cpumask_t *es7000_target_cpus(void)
-{
- return &cpumask_of_cpu(smp_processor_id());
-}
-
-#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 APIC_DFR_VALUE (APIC_DFR_FLAT)
-
-static inline unsigned long
-es7000_check_apicid_used(physid_mask_t bitmap, int apicid)
-{
- return 0;
-}
-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)
-{
- unsigned long id;
- id = xapic_phys_to_log_apicid(cpu);
- return (SET_APIC_LOGICAL_ID(id));
-}
-
-/*
- * Set up the logical destination ID.
- *
- * Intel recommends to set DFR, LdR and TPR before enabling
- * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel
- * document number 292116). So here it goes...
- */
-static inline void es7000_init_apic_ldr_cluster(void)
-{
- unsigned long val;
- int cpu = smp_processor_id();
-
- apic_write(APIC_DFR, APIC_DFR_VALUE_CLUSTER);
- val = calculate_ldr(cpu);
- apic_write(APIC_LDR, val);
-}
-
-static inline void es7000_init_apic_ldr(void)
-{
- unsigned long val;
- int cpu = smp_processor_id();
-
- apic_write(APIC_DFR, APIC_DFR_VALUE);
- val = calculate_ldr(cpu);
- apic_write(APIC_LDR, val);
-}
-
-extern int apic_version [MAX_APICS];
-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",
- (apic_version[apic] == 0x14) ?
- "Physical Cluster" : "Logical Cluster",
- nr_ioapics, cpus_addr(*es7000_target_cpus())[0]);
-}
-
-static inline int es7000_apicid_to_node(int logical_apicid)
-{
- return 0;
-}
-
-
-static inline int es7000_cpu_present_to_apicid(int mps_cpu)
-{
- if (!mps_cpu)
- return boot_cpu_physical_apicid;
- else if (mps_cpu < nr_cpu_ids)
- return (int) per_cpu(x86_bios_cpu_apicid, mps_cpu);
- else
- return BAD_APICID;
-}
-
-static inline physid_mask_t es7000_apicid_to_cpu_present(int phys_apicid)
-{
- static int id = 0;
- physid_mask_t mask;
- mask = physid_mask_of_physid(id);
- ++id;
- return mask;
-}
-
-extern u8 cpu_2_logical_apicid[];
-/* Mapping from cpu number to logical apicid */
-static inline int es7000_cpu_to_logical_apicid(int cpu)
-{
-#ifdef CONFIG_SMP
- if (cpu >= nr_cpu_ids)
- return BAD_APICID;
- return (int)cpu_2_logical_apicid[cpu];
-#else
- return logical_smp_processor_id();
-#endif
-}
-
-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);
-}
-
-extern unsigned int boot_cpu_physical_apicid;
-
-static inline int es7000_check_phys_apicid_present(int cpu_physical_apicid)
-{
- boot_cpu_physical_apicid = read_apic_id();
- return (1);
-}
-
-static inline unsigned int
-es7000_cpu_mask_to_apicid_cluster(const struct cpumask *cpumask)
-{
- int cpus_found = 0;
- int num_bits_set;
- int apicid;
- int cpu;
-
- num_bits_set = cpumask_weight(cpumask);
- /* Return id to all */
- if (num_bits_set == nr_cpu_ids)
- 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 = 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)) {
- printk ("%s: Not a valid mask!\n", __func__);
-
- return 0xFF;
- }
- apicid = new_apicid;
- cpus_found++;
- }
- cpu++;
- }
- return apicid;
-}
-
-static inline unsigned int es7000_cpu_mask_to_apicid(const cpumask_t *cpumask)
-{
- int cpus_found = 0;
- 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 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 = es7000_cpu_to_logical_apicid(cpu);
- 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)) {
- printk ("%s: Not a valid mask!\n", __func__);
-
- return es7000_cpu_to_logical_apicid(0);
- }
- apicid = new_apicid;
- cpus_found++;
- }
- cpu++;
- }
- return apicid;
-}
-
-
-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;
-
- if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC))
- return apicid;
-
- cpumask_and(cpumask, inmask, andmask);
- cpumask_and(cpumask, cpumask, cpu_online_mask);
- apicid = es7000_cpu_mask_to_apicid(cpumask);
-
- free_cpumask_var(cpumask);
-
- return apicid;
-}
-
-static inline int es7000_phys_pkg_id(int cpuid_apic, int index_msb)
-{
- return cpuid_apic >> index_msb;
-}
-
-#endif /* __ASM_ES7000_APIC_H */
diff --git a/arch/x86/include/asm/es7000/apicdef.h b/arch/x86/include/asm/es7000/apicdef.h
deleted file mode 100644
index c74881a..0000000
--- a/arch/x86/include/asm/es7000/apicdef.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef __ASM_ES7000_APICDEF_H
-#define __ASM_ES7000_APICDEF_H
-
-static inline unsigned int es7000_get_apic_id(unsigned long x)
-{
- return (x >> 24) & 0xFF;
-}
-
-#endif
diff --git a/arch/x86/include/asm/es7000/ipi.h b/arch/x86/include/asm/es7000/ipi.h
deleted file mode 100644
index 81e77c8..0000000
--- a/arch/x86/include/asm/es7000/ipi.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef __ASM_ES7000_IPI_H
-#define __ASM_ES7000_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 es7000_send_IPI_mask(const struct cpumask *mask, int vector)
-{
- default_send_IPI_mask_sequence(mask, vector);
-}
-
-static inline void es7000_send_IPI_allbutself(int vector)
-{
- default_send_IPI_mask_allbutself(cpu_online_mask, vector);
-}
-
-static inline void es7000_send_IPI_all(int vector)
-{
- es7000_send_IPI_mask(cpu_online_mask, vector);
-}
-
-#endif /* __ASM_ES7000_IPI_H */
diff --git a/arch/x86/include/asm/es7000/mpparse.h b/arch/x86/include/asm/es7000/mpparse.h
deleted file mode 100644
index 662eb1e..0000000
--- a/arch/x86/include/asm/es7000/mpparse.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef __ASM_ES7000_MPPARSE_H
-#define __ASM_ES7000_MPPARSE_H
-
-#include <linux/acpi.h>
-
-extern int parse_unisys_oem (char *oemptr);
-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);
-
-#ifdef CONFIG_ACPI
-static inline int es7000_check_dsdt(void)
-{
- struct acpi_table_header header;
-
- if (ACPI_SUCCESS(acpi_get_table_header(ACPI_SIG_DSDT, 0, &header)) &&
- !strncmp(header.oem_id, "UNISYS", 6))
- return 1;
- return 0;
-}
-#endif
-
-#endif /* __ASM_MACH_MPPARSE_H */
diff --git a/arch/x86/include/asm/es7000/wakecpu.h b/arch/x86/include/asm/es7000/wakecpu.h
deleted file mode 100644
index 99c72be..0000000
--- a/arch/x86/include/asm/es7000/wakecpu.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef __ASM_ES7000_WAKECPU_H
-#define __ASM_ES7000_WAKECPU_H
-
-#define ES7000_TRAMPOLINE_PHYS_LOW 0x467
-#define ES7000_TRAMPOLINE_PHYS_HIGH 0x469
-
-static inline void es7000_wait_for_init_deassert(atomic_t *deassert)
-{
-#ifndef CONFIG_ES7000_CLUSTERED_APIC
- while (!atomic_read(deassert))
- cpu_relax();
-#endif
- return;
-}
-
-#endif /* __ASM_MACH_WAKECPU_H */
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index be090b2..8b6113e 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -11,13 +11,300 @@
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/init.h>
-#include <asm/es7000/apicdef.h>
+#include <linux/acpi.h>
#include <linux/smp.h>
-#include <asm/es7000/apic.h>
-#include <asm/es7000/ipi.h>
-#include <asm/es7000/mpparse.h>
+#include <asm/ipi.h>
#include <asm/mach-default/mach_wakecpu.h>
+#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 APIC_DFR_VALUE (APIC_DFR_FLAT)
+
+extern void es7000_enable_apic_mode(void);
+extern int apic_version [MAX_APICS];
+extern u8 cpu_2_logical_apicid[];
+extern unsigned int boot_cpu_physical_apicid;
+
+extern int parse_unisys_oem (char *oemptr);
+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);
+
+#define apicid_cluster(apicid) (apicid & 0xF0)
+#define xapic_phys_to_log_apicid(cpu) per_cpu(x86_bios_cpu_apicid, cpu)
+
+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
+ * 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, } };
+}
+
+
+static void es7000_wait_for_init_deassert(atomic_t *deassert)
+{
+#ifndef CONFIG_ES7000_CLUSTERED_APIC
+ while (!atomic_read(deassert))
+ cpu_relax();
+#endif
+ return;
+}
+
+static unsigned int es7000_get_apic_id(unsigned long x)
+{
+ return (x >> 24) & 0xFF;
+}
+
+#ifdef CONFIG_ACPI
+static int es7000_check_dsdt(void)
+{
+ struct acpi_table_header header;
+
+ if (ACPI_SUCCESS(acpi_get_table_header(ACPI_SIG_DSDT, 0, &header)) &&
+ !strncmp(header.oem_id, "UNISYS", 6))
+ return 1;
+ return 0;
+}
+#endif
+
+static void es7000_send_IPI_mask(const struct cpumask *mask, int vector)
+{
+ default_send_IPI_mask_sequence(mask, vector);
+}
+
+static void es7000_send_IPI_allbutself(int vector)
+{
+ default_send_IPI_mask_allbutself(cpu_online_mask, vector);
+}
+
+static void es7000_send_IPI_all(int vector)
+{
+ es7000_send_IPI_mask(cpu_online_mask, vector);
+}
+
+static int es7000_apic_id_registered(void)
+{
+ return 1;
+}
+
+static const cpumask_t *target_cpus_cluster(void)
+{
+ return &CPU_MASK_ALL;
+}
+
+static const cpumask_t *es7000_target_cpus(void)
+{
+ return &cpumask_of_cpu(smp_processor_id());
+}
+
+static unsigned long
+es7000_check_apicid_used(physid_mask_t bitmap, int apicid)
+{
+ return 0;
+}
+static unsigned long es7000_check_apicid_present(int bit)
+{
+ return physid_isset(bit, phys_cpu_present_map);
+}
+
+static unsigned long calculate_ldr(int cpu)
+{
+ unsigned long id = xapic_phys_to_log_apicid(cpu);
+
+ return (SET_APIC_LOGICAL_ID(id));
+}
+
+/*
+ * Set up the logical destination ID.
+ *
+ * Intel recommends to set DFR, LdR and TPR before enabling
+ * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel
+ * document number 292116). So here it goes...
+ */
+static void es7000_init_apic_ldr_cluster(void)
+{
+ unsigned long val;
+ int cpu = smp_processor_id();
+
+ apic_write(APIC_DFR, APIC_DFR_VALUE_CLUSTER);
+ val = calculate_ldr(cpu);
+ apic_write(APIC_LDR, val);
+}
+
+static void es7000_init_apic_ldr(void)
+{
+ unsigned long val;
+ int cpu = smp_processor_id();
+
+ apic_write(APIC_DFR, APIC_DFR_VALUE);
+ val = calculate_ldr(cpu);
+ apic_write(APIC_LDR, val);
+}
+
+static 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",
+ (apic_version[apic] == 0x14) ?
+ "Physical Cluster" : "Logical Cluster",
+ nr_ioapics, cpus_addr(*es7000_target_cpus())[0]);
+}
+
+static int es7000_apicid_to_node(int logical_apicid)
+{
+ return 0;
+}
+
+
+static int es7000_cpu_present_to_apicid(int mps_cpu)
+{
+ if (!mps_cpu)
+ return boot_cpu_physical_apicid;
+ else if (mps_cpu < nr_cpu_ids)
+ return (int) per_cpu(x86_bios_cpu_apicid, mps_cpu);
+ else
+ return BAD_APICID;
+}
+
+static physid_mask_t es7000_apicid_to_cpu_present(int phys_apicid)
+{
+ static int id = 0;
+ physid_mask_t mask;
+
+ mask = physid_mask_of_physid(id);
+ ++id;
+
+ return mask;
+}
+
+/* Mapping from cpu number to logical apicid */
+static int es7000_cpu_to_logical_apicid(int cpu)
+{
+#ifdef CONFIG_SMP
+ if (cpu >= nr_cpu_ids)
+ return BAD_APICID;
+ return (int)cpu_2_logical_apicid[cpu];
+#else
+ return logical_smp_processor_id();
+#endif
+}
+
+static 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);
+}
+
+static int es7000_check_phys_apicid_present(int cpu_physical_apicid)
+{
+ boot_cpu_physical_apicid = read_apic_id();
+ return (1);
+}
+
+static unsigned int
+es7000_cpu_mask_to_apicid_cluster(const struct cpumask *cpumask)
+{
+ int cpus_found = 0;
+ int num_bits_set;
+ int apicid;
+ int cpu;
+
+ num_bits_set = cpumask_weight(cpumask);
+ /* Return id to all */
+ if (num_bits_set == nr_cpu_ids)
+ 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 = 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)) {
+ printk ("%s: Not a valid mask!\n", __func__);
+
+ return 0xFF;
+ }
+ apicid = new_apicid;
+ cpus_found++;
+ }
+ cpu++;
+ }
+ return apicid;
+}
+
+static unsigned int es7000_cpu_mask_to_apicid(const cpumask_t *cpumask)
+{
+ int cpus_found = 0;
+ 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 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 = es7000_cpu_to_logical_apicid(cpu);
+ 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)) {
+ printk ("%s: Not a valid mask!\n", __func__);
+
+ return es7000_cpu_to_logical_apicid(0);
+ }
+ apicid = new_apicid;
+ cpus_found++;
+ }
+ cpu++;
+ }
+ return apicid;
+}
+
+static 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;
+
+ if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC))
+ return apicid;
+
+ cpumask_and(cpumask, inmask, andmask);
+ cpumask_and(cpumask, cpumask, cpu_online_mask);
+ apicid = es7000_cpu_mask_to_apicid(cpumask);
+
+ free_cpumask_var(cpumask);
+
+ return apicid;
+}
+
+static int es7000_phys_pkg_id(int cpuid_apic, int index_msb)
+{
+ return cpuid_apic >> index_msb;
+}
+
void __init es7000_update_genapic_to_cluster(void)
{
apic->target_cpus = target_cpus_cluster;
@@ -80,18 +367,6 @@ static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
}
#endif
-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
- * 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, } };
-}
struct genapic apic_es7000 = {
@@ -140,10 +415,11 @@ struct genapic apic_es7000 = {
.send_IPI_self = NULL,
.wakeup_cpu = NULL,
- .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW,
- .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH,
- .wait_for_init_deassert = default_wait_for_init_deassert,
+ .trampoline_phys_low = 0x467,
+ .trampoline_phys_high = 0x469,
+
+ .wait_for_init_deassert = es7000_wait_for_init_deassert,
/* Nothing to do for most platforms, since cleared by the INIT cycle: */
.smp_callin_clear_local_apic = NULL,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 068/114] x86, smp: eliminate asm/mach-default/mach_wakecpu.h
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (66 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 067/114] x86, ES7000: consolidate the APIC code Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 069/114] x86: eliminate asm/mach-*/mach_mpparse.h Ingo Molnar
` (47 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Spread mach_wakecpu.h's definitions into apic.h and genapic.h
and remove mach_wakecpu.h.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/apic.h | 15 +++++++++++++
arch/x86/include/asm/genapic.h | 7 ++++++
arch/x86/include/asm/mach-default/mach_wakecpu.h | 25 ----------------------
arch/x86/kernel/smpboot.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/summit.c | 1 -
8 files changed, 22 insertions(+), 30 deletions(-)
delete mode 100644 arch/x86/include/asm/mach-default/mach_wakecpu.h
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index ab1d51a..e8f0304 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -41,6 +41,21 @@ extern unsigned int apic_verbosity;
extern int local_apic_timer_c2_ok;
extern int disable_apic;
+
+#ifdef CONFIG_SMP
+extern void __inquire_remote_apic(int apicid);
+#else /* CONFIG_SMP */
+static inline void __inquire_remote_apic(int apicid)
+{
+}
+#endif /* CONFIG_SMP */
+
+static inline void default_inquire_remote_apic(int apicid)
+{
+ if (apic_verbosity >= APIC_DEBUG)
+ __inquire_remote_apic(apicid);
+}
+
/*
* Basic functions accessing APICs.
*/
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h
index e5f9c56..1772dad 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -113,4 +113,11 @@ 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 void default_wait_for_init_deassert(atomic_t *deassert)
+{
+ while (!atomic_read(deassert))
+ cpu_relax();
+ return;
+}
+
#endif /* _ASM_X86_GENAPIC_64_H */
diff --git a/arch/x86/include/asm/mach-default/mach_wakecpu.h b/arch/x86/include/asm/mach-default/mach_wakecpu.h
deleted file mode 100644
index b1cde56..0000000
--- a/arch/x86/include/asm/mach-default/mach_wakecpu.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef _ASM_X86_MACH_DEFAULT_MACH_WAKECPU_H
-#define _ASM_X86_MACH_DEFAULT_MACH_WAKECPU_H
-
-static inline void default_wait_for_init_deassert(atomic_t *deassert)
-{
- while (!atomic_read(deassert))
- cpu_relax();
- return;
-}
-
-#ifdef CONFIG_SMP
-extern void __inquire_remote_apic(int apicid);
-#else /* CONFIG_SMP */
-static inline void __inquire_remote_apic(int apicid)
-{
-}
-#endif /* CONFIG_SMP */
-
-static inline void default_inquire_remote_apic(int apicid)
-{
- if (apic_verbosity >= APIC_DEBUG)
- __inquire_remote_apic(apicid);
-}
-
-#endif /* _ASM_X86_MACH_DEFAULT_MACH_WAKECPU_H */
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 170adc5..1fdc1a7 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -66,7 +66,6 @@
#include <linux/mc146818rtc.h>
#include <mach_apic.h>
-#include <mach_wakecpu.h>
#include <smpboot_hooks.h>
#ifdef CONFIG_X86_32
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 4d8b2d4..6fcccfb 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -17,7 +17,6 @@
#include <asm/bigsmp/apic.h>
#include <asm/bigsmp/ipi.h>
#include <asm/mach-default/mach_mpparse.h>
-#include <asm/mach-default/mach_wakecpu.h>
static int dmi_bigsmp; /* can be set by dmi scanners */
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index c12dd23..e3c5114 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -16,7 +16,6 @@
#include <asm/mach-default/mach_apic.h>
#include <asm/mach-default/mach_ipi.h>
#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)
{
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 8b6113e..bb11166 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -14,7 +14,6 @@
#include <linux/acpi.h>
#include <linux/smp.h>
#include <asm/ipi.h>
-#include <asm/mach-default/mach_wakecpu.h>
#define APIC_DFR_VALUE_CLUSTER (APIC_DFR_CLUSTER)
#define INT_DELIVERY_MODE_CLUSTER (dest_LowestPrio)
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index d5db304..673a64f 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -16,7 +16,6 @@
#include <asm/summit/apic.h>
#include <asm/summit/ipi.h>
#include <asm/summit/mpparse.h>
-#include <asm/mach-default/mach_wakecpu.h>
static int probe_summit(void)
{
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 069/114] x86: eliminate asm/mach-*/mach_mpparse.h
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (67 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 068/114] x86, smp: eliminate asm/mach-default/mach_wakecpu.h Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 070/114] x86: remove mach_mpspec.h Ingo Molnar
` (46 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Move the definition to mpparse.h.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/mach-default/mach_mpparse.h | 17 -----------------
arch/x86/include/asm/mach-generic/mach_mpparse.h | 8 --------
arch/x86/include/asm/mpspec.h | 4 ++++
arch/x86/kernel/acpi/boot.c | 1 -
arch/x86/kernel/es7000_32.c | 1 -
arch/x86/kernel/mpparse.c | 1 -
arch/x86/mach-generic/bigsmp.c | 1 -
arch/x86/mach-generic/default.c | 1 -
8 files changed, 4 insertions(+), 30 deletions(-)
delete mode 100644 arch/x86/include/asm/mach-default/mach_mpparse.h
delete mode 100644 arch/x86/include/asm/mach-generic/mach_mpparse.h
diff --git a/arch/x86/include/asm/mach-default/mach_mpparse.h b/arch/x86/include/asm/mach-default/mach_mpparse.h
deleted file mode 100644
index af0da14..0000000
--- a/arch/x86/include/asm/mach-default/mach_mpparse.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef _ASM_X86_MACH_DEFAULT_MACH_MPPARSE_H
-#define _ASM_X86_MACH_DEFAULT_MACH_MPPARSE_H
-
-static inline int
-generic_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
-{
- return 0;
-}
-
-/* Hook from generic ACPI tables.c */
-static inline int default_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
-{
- return 0;
-}
-
-
-#endif /* _ASM_X86_MACH_DEFAULT_MACH_MPPARSE_H */
diff --git a/arch/x86/include/asm/mach-generic/mach_mpparse.h b/arch/x86/include/asm/mach-generic/mach_mpparse.h
deleted file mode 100644
index 22bfb56..0000000
--- a/arch/x86/include/asm/mach-generic/mach_mpparse.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef _ASM_X86_MACH_GENERIC_MACH_MPPARSE_H
-#define _ASM_X86_MACH_GENERIC_MACH_MPPARSE_H
-
-extern int generic_mps_oem_check(struct mpc_table *, char *, char *);
-
-extern int default_acpi_madt_oem_check(char *, char *);
-
-#endif /* _ASM_X86_MACH_GENERIC_MACH_MPPARSE_H */
diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h
index 62d14ce..432e9cb 100644
--- a/arch/x86/include/asm/mpspec.h
+++ b/arch/x86/include/asm/mpspec.h
@@ -142,4 +142,8 @@ static inline void physid_set_mask_of_physid(int physid, physid_mask_t *map)
extern physid_mask_t phys_cpu_present_map;
+extern int generic_mps_oem_check(struct mpc_table *, char *, char *);
+
+extern int default_acpi_madt_oem_check(char *, char *);
+
#endif /* _ASM_X86_MPSPEC_H */
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 5391631..7b02a1c 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -63,7 +63,6 @@ EXPORT_SYMBOL(acpi_disabled);
#ifdef CONFIG_X86_LOCAL_APIC
#include <mach_apic.h>
-#include <mach_mpparse.h>
#endif /* CONFIG_X86_LOCAL_APIC */
#endif /* X86 */
diff --git a/arch/x86/kernel/es7000_32.c b/arch/x86/kernel/es7000_32.c
index d7f433e..8faea13 100644
--- a/arch/x86/kernel/es7000_32.c
+++ b/arch/x86/kernel/es7000_32.c
@@ -40,7 +40,6 @@
#include <asm/smp.h>
#include <asm/atomic.h>
#include <asm/apicdef.h>
-#include <mach_mpparse.h>
#include <asm/genapic.h>
#include <asm/setup.h>
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
index b12fa5c..c693016 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -32,7 +32,6 @@
#include <mach_apic.h>
#ifdef CONFIG_X86_32
#include <mach_apicdef.h>
-#include <mach_mpparse.h>
#endif
/*
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 6fcccfb..626f45c 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -16,7 +16,6 @@
#include <linux/smp.h>
#include <asm/bigsmp/apic.h>
#include <asm/bigsmp/ipi.h>
-#include <asm/mach-default/mach_mpparse.h>
static int dmi_bigsmp; /* can be set by dmi scanners */
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index e3c5114..6485e57 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -15,7 +15,6 @@
#include <linux/init.h>
#include <asm/mach-default/mach_apic.h>
#include <asm/mach-default/mach_ipi.h>
-#include <asm/mach-default/mach_mpparse.h>
static void default_vector_allocation_domain(int cpu, struct cpumask *retmask)
{
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 070/114] x86: remove mach_mpspec.h
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (68 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 069/114] x86: eliminate asm/mach-*/mach_mpparse.h Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 071/114] x86: remove mach_apicdef.h Ingo Molnar
` (45 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Move its definitions into mpspec.h.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/mach-default/mach_mpspec.h | 12 -----------
arch/x86/include/asm/mach-generic/mach_mpspec.h | 12 -----------
arch/x86/include/asm/mpspec.h | 25 +++++++++++++++++-----
3 files changed, 19 insertions(+), 30 deletions(-)
delete mode 100644 arch/x86/include/asm/mach-default/mach_mpspec.h
delete mode 100644 arch/x86/include/asm/mach-generic/mach_mpspec.h
diff --git a/arch/x86/include/asm/mach-default/mach_mpspec.h b/arch/x86/include/asm/mach-default/mach_mpspec.h
deleted file mode 100644
index e85ede6..0000000
--- a/arch/x86/include/asm/mach-default/mach_mpspec.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef _ASM_X86_MACH_DEFAULT_MACH_MPSPEC_H
-#define _ASM_X86_MACH_DEFAULT_MACH_MPSPEC_H
-
-#define MAX_IRQ_SOURCES 256
-
-#if CONFIG_BASE_SMALL == 0
-#define MAX_MP_BUSSES 256
-#else
-#define MAX_MP_BUSSES 32
-#endif
-
-#endif /* _ASM_X86_MACH_DEFAULT_MACH_MPSPEC_H */
diff --git a/arch/x86/include/asm/mach-generic/mach_mpspec.h b/arch/x86/include/asm/mach-generic/mach_mpspec.h
deleted file mode 100644
index 3bc4072..0000000
--- a/arch/x86/include/asm/mach-generic/mach_mpspec.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef _ASM_X86_MACH_GENERIC_MACH_MPSPEC_H
-#define _ASM_X86_MACH_GENERIC_MACH_MPSPEC_H
-
-#define MAX_IRQ_SOURCES 256
-
-/* Summit or generic (i.e. installer) kernels need lots of bus entries. */
-/* Maximum 256 PCI busses, plus 1 ISA bus in each of 4 cabinets. */
-#define MAX_MP_BUSSES 260
-
-extern void numaq_mps_oem_check(struct mpc_table *, char *, char *);
-
-#endif /* _ASM_X86_MACH_GENERIC_MACH_MPSPEC_H */
diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h
index 432e9cb..03fb0d3 100644
--- a/arch/x86/include/asm/mpspec.h
+++ b/arch/x86/include/asm/mpspec.h
@@ -9,7 +9,18 @@ extern int apic_version[MAX_APICS];
extern int pic_mode;
#ifdef CONFIG_X86_32
-#include <mach_mpspec.h>
+
+/*
+ * Summit or generic (i.e. installer) kernels need lots of bus entries.
+ * Maximum 256 PCI busses, plus 1 ISA bus in each of 4 cabinets.
+ */
+#if CONFIG_BASE_SMALL == 0
+# define MAX_MP_BUSSES 260
+#else
+# define MAX_MP_BUSSES 32
+#endif
+
+#define MAX_IRQ_SOURCES 256
extern unsigned int def_to_bigsmp;
extern u8 apicid_2_node[];
@@ -20,15 +31,15 @@ extern int mp_bus_id_to_local[MAX_MP_BUSSES];
extern int quad_local_to_mp_bus_id [NR_CPUS/4][4];
#endif
-#define MAX_APICID 256
+#define MAX_APICID 256
-#else
+#else /* CONFIG_X86_64: */
-#define MAX_MP_BUSSES 256
+#define MAX_MP_BUSSES 256
/* Each PCI slot may be a combo card with its own bus. 4 IRQ pins per slot. */
-#define MAX_IRQ_SOURCES (MAX_MP_BUSSES * 4)
+#define MAX_IRQ_SOURCES (MAX_MP_BUSSES * 4)
-#endif
+#endif /* CONFIG_X86_64 */
extern void early_find_smp_config(void);
extern void early_get_smp_config(void);
@@ -146,4 +157,6 @@ extern int generic_mps_oem_check(struct mpc_table *, char *, char *);
extern int default_acpi_madt_oem_check(char *, char *);
+extern void numaq_mps_oem_check(struct mpc_table *, char *, char *);
+
#endif /* _ASM_X86_MPSPEC_H */
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 071/114] x86: remove mach_apicdef.h
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (69 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 070/114] x86: remove mach_mpspec.h Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 072/114] x86, smp: refactor ->wake_cpu Ingo Molnar
` (44 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Move its definitions into apic.h.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/apic.h | 16 ++++++++++++++++
arch/x86/include/asm/mach-default/mach_apic.h | 1 -
arch/x86/include/asm/mach-default/mach_apicdef.h | 22 ----------------------
arch/x86/include/asm/mach-generic/mach_apicdef.h | 8 --------
arch/x86/include/asm/smp.h | 4 ++--
arch/x86/kernel/apic.c | 1 -
arch/x86/kernel/genapic_flat_64.c | 1 -
arch/x86/kernel/io_apic.c | 1 -
arch/x86/kernel/mpparse.c | 3 ---
arch/x86/mach-generic/default.c | 1 -
10 files changed, 18 insertions(+), 40 deletions(-)
delete mode 100644 arch/x86/include/asm/mach-default/mach_apicdef.h
delete mode 100644 arch/x86/include/asm/mach-generic/mach_apicdef.h
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index e8f0304..3a32020 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -211,4 +211,20 @@ static inline void disable_local_APIC(void) { }
#endif /* !CONFIG_X86_LOCAL_APIC */
+#ifdef CONFIG_X86_64
+#define SET_APIC_ID(x) (apic->set_apic_id(x))
+#else
+
+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;
+ else
+ return (x >> 24) & 0x0F;
+}
+
+#endif
+
#endif /* _ASM_X86_APIC_H */
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index 2e4104c..b60b767 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -3,7 +3,6 @@
#ifdef CONFIG_X86_LOCAL_APIC
-#include <mach_apicdef.h>
#include <asm/smp.h>
#define APIC_DFR_VALUE (APIC_DFR_FLAT)
diff --git a/arch/x86/include/asm/mach-default/mach_apicdef.h b/arch/x86/include/asm/mach-default/mach_apicdef.h
deleted file mode 100644
index 5141085..0000000
--- a/arch/x86/include/asm/mach-default/mach_apicdef.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef _ASM_X86_MACH_DEFAULT_MACH_APICDEF_H
-#define _ASM_X86_MACH_DEFAULT_MACH_APICDEF_H
-
-#include <asm/apic.h>
-
-#ifdef CONFIG_X86_64
-#define SET_APIC_ID(x) (apic->set_apic_id(x))
-#else
-
-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;
- else
- return (x >> 24) & 0x0F;
-}
-
-#endif
-
-#endif /* _ASM_X86_MACH_DEFAULT_MACH_APICDEF_H */
diff --git a/arch/x86/include/asm/mach-generic/mach_apicdef.h b/arch/x86/include/asm/mach-generic/mach_apicdef.h
deleted file mode 100644
index 61caa65..0000000
--- a/arch/x86/include/asm/mach-generic/mach_apicdef.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef _ASM_X86_MACH_GENERIC_MACH_APICDEF_H
-#define _ASM_X86_MACH_GENERIC_MACH_APICDEF_H
-
-#ifndef APIC_DEFINITION
-#include <asm/genapic.h>
-#endif
-
-#endif /* _ASM_X86_MACH_GENERIC_MACH_APICDEF_H */
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
index c63d480..d4ac4de 100644
--- a/arch/x86/include/asm/smp.h
+++ b/arch/x86/include/asm/smp.h
@@ -173,6 +173,8 @@ extern int safe_smp_processor_id(void);
#endif
+#include <asm/genapic.h>
+
#ifdef CONFIG_X86_LOCAL_APIC
#ifndef CONFIG_X86_64
@@ -182,7 +184,6 @@ static inline int logical_smp_processor_id(void)
return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR));
}
-#include <mach_apicdef.h>
static inline unsigned int read_apic_id(void)
{
unsigned int reg;
@@ -197,7 +198,6 @@ static inline unsigned int read_apic_id(void)
# if defined(APIC_DEFINITION) || defined(CONFIG_X86_64)
extern int hard_smp_processor_id(void);
# else
-#include <mach_apicdef.h>
static inline int hard_smp_processor_id(void)
{
/* we don't want to mark this access volatile - bad code generation */
diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic.c
index 84b8e7c..e622080 100644
--- a/arch/x86/kernel/apic.c
+++ b/arch/x86/kernel/apic.c
@@ -50,7 +50,6 @@
#include <asm/smp.h>
#include <mach_apic.h>
-#include <mach_apicdef.h>
#include <mach_ipi.h>
/*
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index e9237f5..19bffb3 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -19,7 +19,6 @@
#include <asm/smp.h>
#include <asm/ipi.h>
#include <asm/genapic.h>
-#include <mach_apicdef.h>
#ifdef CONFIG_ACPI
#include <acpi/acpi_bus.h>
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index e90970c..abae819 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -64,7 +64,6 @@
#include <mach_ipi.h>
#include <mach_apic.h>
-#include <mach_apicdef.h>
#define __apicdebuginit(type) static type __init
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
index c693016..a1452a5 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -30,9 +30,6 @@
#include <asm/smp.h>
#include <mach_apic.h>
-#ifdef CONFIG_X86_32
-#include <mach_apicdef.h>
-#endif
/*
* Checksum an MP configuration block.
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index 6485e57..07817b2 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -5,7 +5,6 @@
#include <linux/threads.h>
#include <linux/cpumask.h>
#include <asm/mpspec.h>
-#include <asm/mach-default/mach_apicdef.h>
#include <asm/genapic.h>
#include <asm/fixmap.h>
#include <asm/apicdef.h>
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 072/114] x86, smp: refactor ->wake_cpu
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (70 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 071/114] x86: remove mach_apicdef.h Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 073/114] x86, numaq: consolidate code Ingo Molnar
` (43 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
- remove macro wrappers
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/mach-default/mach_apic.h | 2 --
arch/x86/include/asm/mach-generic/mach_apic.h | 2 --
arch/x86/kernel/setup.c | 5 ++---
arch/x86/kernel/smpboot.c | 4 ++--
4 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index b60b767..bae053c 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -19,10 +19,8 @@ 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 wakeup_secondary_cpu (apic->wakeup_cpu)
extern void default_setup_apic_routing(void);
#else
-#define wakeup_secondary_cpu wakeup_secondary_cpu_via_init
/*
* Set up the logical destination ID.
*
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index ca460e4..96f217f 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -3,8 +3,6 @@
#include <asm/genapic.h>
-#define wakeup_secondary_cpu (apic->wakeup_cpu)
-
extern void generic_bigsmp_probe(void);
#endif /* _ASM_X86_MACH_GENERIC_MACH_APIC_H */
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index a58e9f5..6b27f6d 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -589,9 +589,8 @@ early_param("elfcorehdr", setup_elfcorehdr);
static int __init default_update_genapic(void)
{
#ifdef CONFIG_X86_SMP
-# if defined(CONFIG_X86_GENERICARCH) || defined(CONFIG_X86_64)
- apic->wakeup_cpu = wakeup_secondary_cpu_via_init;
-# endif
+ if (!apic->wakeup_cpu)
+ apic->wakeup_cpu = wakeup_secondary_cpu_via_init;
#endif
return 0;
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 1fdc1a7..3fed177 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -750,7 +750,7 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu)
/*
* NOTE - on most systems this is a PHYSICAL apic ID, but on multiquad
* (ie clustered apic addressing mode), this is a LOGICAL apic ID.
- * Returns zero if CPU booted OK, else error code from wakeup_secondary_cpu.
+ * Returns zero if CPU booted OK, else error code from ->wakeup_cpu.
*/
{
unsigned long boot_error = 0;
@@ -841,7 +841,7 @@ do_rest:
/*
* Starting actual IPI sequence...
*/
- boot_error = wakeup_secondary_cpu(apicid, start_ip);
+ boot_error = apic->wakeup_cpu(apicid, start_ip);
if (!boot_error) {
/*
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 073/114] x86, numaq: consolidate code
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (71 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 072/114] x86, smp: refactor ->wake_cpu Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 074/114] x86, summit: " Ingo Molnar
` (42 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Move all the NUMAQ subarch definitions into numaq.c. With this it
ceases to depend on build-time subarch features.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/numaq/apic.h | 122 ------------------------
arch/x86/include/asm/numaq/apicdef.h | 9 --
arch/x86/include/asm/numaq/ipi.h | 22 -----
arch/x86/include/asm/numaq/mpparse.h | 6 -
arch/x86/include/asm/numaq/wakecpu.h | 28 ------
arch/x86/mach-generic/numaq.c | 171 +++++++++++++++++++++++++++++++++-
arch/x86/pci/numaq_32.c | 2 +-
7 files changed, 167 insertions(+), 193 deletions(-)
delete mode 100644 arch/x86/include/asm/numaq/apic.h
delete mode 100644 arch/x86/include/asm/numaq/apicdef.h
delete mode 100644 arch/x86/include/asm/numaq/ipi.h
delete mode 100644 arch/x86/include/asm/numaq/mpparse.h
delete mode 100644 arch/x86/include/asm/numaq/wakecpu.h
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
deleted file mode 100644
index ce95e79..0000000
--- a/arch/x86/include/asm/numaq/apic.h
+++ /dev/null
@@ -1,122 +0,0 @@
-#ifndef __ASM_NUMAQ_APIC_H
-#define __ASM_NUMAQ_APIC_H
-
-#include <asm/io.h>
-#include <linux/mmzone.h>
-#include <linux/nodemask.h>
-
-#define APIC_DFR_VALUE (APIC_DFR_CLUSTER)
-
-static inline const cpumask_t *numaq_target_cpus(void)
-{
- return &CPU_MASK_ALL;
-}
-
-static inline unsigned long
-numaq_check_apicid_used(physid_mask_t bitmap, int apicid)
-{
- return physid_isset(apicid, bitmap);
-}
-static inline unsigned long numaq_check_apicid_present(int bit)
-{
- return physid_isset(bit, phys_cpu_present_map);
-}
-#define apicid_cluster(apicid) (apicid & 0xF0)
-
-static inline int numaq_apic_id_registered(void)
-{
- return 1;
-}
-
-static inline void numaq_init_apic_ldr(void)
-{
- /* Already done in NUMA-Q firmware */
-}
-
-static inline void numaq_setup_apic_routing(void)
-{
- printk("Enabling APIC mode: %s. Using %d I/O APICs\n",
- "NUMA-Q", nr_ioapics);
-}
-
-/*
- * Skip adding the timer int on secondary nodes, which causes
- * a small but painful rift in the time-space continuum.
- */
-static inline int numaq_multi_timer_check(int apic, int irq)
-{
- return apic != 0 && irq == 0;
-}
-
-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);
-}
-
-/* Mapping from cpu number to logical apicid */
-extern u8 cpu_2_logical_apicid[];
-
-static inline int numaq_cpu_to_logical_apicid(int cpu)
-{
- if (cpu >= nr_cpu_ids)
- return BAD_APICID;
- return (int)cpu_2_logical_apicid[cpu];
-}
-
-/*
- * Supporting over 60 cpus on NUMA-Q requires a locality-dependent
- * cpu to APIC ID relation to properly interact with the intelligent
- * mode of the cluster controller.
- */
-static inline int numaq_cpu_present_to_apicid(int mps_cpu)
-{
- if (mps_cpu < 60)
- return ((mps_cpu >> 2) << 4) | (1 << (mps_cpu & 0x3));
- else
- return BAD_APICID;
-}
-
-static inline int numaq_apicid_to_node(int logical_apicid)
-{
- return logical_apicid >> 4;
-}
-
-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);
-
- return physid_mask_of_physid(cpu + 4*node);
-}
-
-extern void *xquad_portio;
-
-static inline int numaq_check_phys_apicid_present(int boot_cpu_physical_apicid)
-{
- return 1;
-}
-
-/*
- * We use physical apicids here, not logical, so just return the default
- * physical broadcast to stop people from breaking us
- */
-static inline unsigned int numaq_cpu_mask_to_apicid(const cpumask_t *cpumask)
-{
- return 0x0F;
-}
-
-static inline unsigned int
-numaq_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
- const struct cpumask *andmask)
-{
- return 0x0F;
-}
-
-/* No NUMA-Q box has a HT CPU, but it can't hurt to use the default code. */
-static inline int numaq_phys_pkg_id(int cpuid_apic, int index_msb)
-{
- return cpuid_apic >> index_msb;
-}
-
-#endif /* __ASM_NUMAQ_APIC_H */
diff --git a/arch/x86/include/asm/numaq/apicdef.h b/arch/x86/include/asm/numaq/apicdef.h
deleted file mode 100644
index cd927d5..0000000
--- a/arch/x86/include/asm/numaq/apicdef.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef __ASM_NUMAQ_APICDEF_H
-#define __ASM_NUMAQ_APICDEF_H
-
-static inline unsigned int numaq_get_apic_id(unsigned long x)
-{
- return (x >> 24) & 0x0F;
-}
-
-#endif
diff --git a/arch/x86/include/asm/numaq/ipi.h b/arch/x86/include/asm/numaq/ipi.h
deleted file mode 100644
index 5dbc4b4..0000000
--- a/arch/x86/include/asm/numaq/ipi.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef __ASM_NUMAQ_IPI_H
-#define __ASM_NUMAQ_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 numaq_send_IPI_mask(const struct cpumask *mask, int vector)
-{
- default_send_IPI_mask_sequence(mask, vector);
-}
-
-static inline void numaq_send_IPI_allbutself(int vector)
-{
- default_send_IPI_mask_allbutself(cpu_online_mask, vector);
-}
-
-static inline void numaq_send_IPI_all(int vector)
-{
- numaq_send_IPI_mask(cpu_online_mask, vector);
-}
-
-#endif /* __ASM_NUMAQ_IPI_H */
diff --git a/arch/x86/include/asm/numaq/mpparse.h b/arch/x86/include/asm/numaq/mpparse.h
deleted file mode 100644
index a2eeefc..0000000
--- a/arch/x86/include/asm/numaq/mpparse.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __ASM_NUMAQ_MPPARSE_H
-#define __ASM_NUMAQ_MPPARSE_H
-
-extern void numaq_mps_oem_check(struct mpc_table *, char *, char *);
-
-#endif /* __ASM_NUMAQ_MPPARSE_H */
diff --git a/arch/x86/include/asm/numaq/wakecpu.h b/arch/x86/include/asm/numaq/wakecpu.h
deleted file mode 100644
index afe8143..0000000
--- a/arch/x86/include/asm/numaq/wakecpu.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef __ASM_NUMAQ_WAKECPU_H
-#define __ASM_NUMAQ_WAKECPU_H
-
-/* This file copes with machines that wakeup secondary CPUs by NMIs */
-
-#define NUMAQ_TRAMPOLINE_PHYS_LOW (0x8)
-#define NUMAQ_TRAMPOLINE_PHYS_HIGH (0xa)
-
-/*
- * Because we use NMIs rather than the INIT-STARTUP sequence to
- * bootstrap the CPUs, the APIC may be in a weird state. Kick it:
- */
-static inline void numaq_smp_callin_clear_local_apic(void)
-{
- clear_local_APIC();
-}
-
-static inline void
-numaq_store_NMI_vector(unsigned short *high, unsigned short *low)
-{
- printk("Storing NMI vector\n");
- *high =
- *((volatile unsigned short *)phys_to_virt(NUMAQ_TRAMPOLINE_PHYS_HIGH));
- *low =
- *((volatile unsigned short *)phys_to_virt(NUMAQ_TRAMPOLINE_PHYS_LOW));
-}
-
-#endif /* __ASM_NUMAQ_WAKECPU_H */
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index ddb50fb..c221cfb 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -11,14 +11,175 @@
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/init.h>
-#include <asm/numaq/apicdef.h>
+#include <linux/numa.h>
#include <linux/smp.h>
-#include <asm/numaq/apic.h>
-#include <asm/numaq/ipi.h>
-#include <asm/numaq/mpparse.h>
-#include <asm/numaq/wakecpu.h>
#include <asm/numaq.h>
+#include <asm/io.h>
+#include <linux/mmzone.h>
+#include <linux/nodemask.h>
+#define NUMAQ_APIC_DFR_VALUE (APIC_DFR_CLUSTER)
+
+static inline unsigned int numaq_get_apic_id(unsigned long x)
+{
+ return (x >> 24) & 0x0F;
+}
+
+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 numaq_send_IPI_mask(const struct cpumask *mask, int vector)
+{
+ default_send_IPI_mask_sequence(mask, vector);
+}
+
+static inline void numaq_send_IPI_allbutself(int vector)
+{
+ default_send_IPI_mask_allbutself(cpu_online_mask, vector);
+}
+
+static inline void numaq_send_IPI_all(int vector)
+{
+ numaq_send_IPI_mask(cpu_online_mask, vector);
+}
+
+extern void numaq_mps_oem_check(struct mpc_table *, char *, char *);
+
+#define NUMAQ_TRAMPOLINE_PHYS_LOW (0x8)
+#define NUMAQ_TRAMPOLINE_PHYS_HIGH (0xa)
+
+/*
+ * Because we use NMIs rather than the INIT-STARTUP sequence to
+ * bootstrap the CPUs, the APIC may be in a weird state. Kick it:
+ */
+static inline void numaq_smp_callin_clear_local_apic(void)
+{
+ clear_local_APIC();
+}
+
+static inline void
+numaq_store_NMI_vector(unsigned short *high, unsigned short *low)
+{
+ printk("Storing NMI vector\n");
+ *high =
+ *((volatile unsigned short *)phys_to_virt(NUMAQ_TRAMPOLINE_PHYS_HIGH));
+ *low =
+ *((volatile unsigned short *)phys_to_virt(NUMAQ_TRAMPOLINE_PHYS_LOW));
+}
+
+static inline const cpumask_t *numaq_target_cpus(void)
+{
+ return &CPU_MASK_ALL;
+}
+
+static inline unsigned long
+numaq_check_apicid_used(physid_mask_t bitmap, int apicid)
+{
+ return physid_isset(apicid, bitmap);
+}
+
+static inline unsigned long numaq_check_apicid_present(int bit)
+{
+ return physid_isset(bit, phys_cpu_present_map);
+}
+
+#define apicid_cluster(apicid) (apicid & 0xF0)
+
+static inline int numaq_apic_id_registered(void)
+{
+ return 1;
+}
+
+static inline void numaq_init_apic_ldr(void)
+{
+ /* Already done in NUMA-Q firmware */
+}
+
+static inline void numaq_setup_apic_routing(void)
+{
+ printk("Enabling APIC mode: %s. Using %d I/O APICs\n",
+ "NUMA-Q", nr_ioapics);
+}
+
+/*
+ * Skip adding the timer int on secondary nodes, which causes
+ * a small but painful rift in the time-space continuum.
+ */
+static inline int numaq_multi_timer_check(int apic, int irq)
+{
+ return apic != 0 && irq == 0;
+}
+
+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);
+}
+
+/* Mapping from cpu number to logical apicid */
+extern u8 cpu_2_logical_apicid[];
+
+static inline int numaq_cpu_to_logical_apicid(int cpu)
+{
+ if (cpu >= nr_cpu_ids)
+ return BAD_APICID;
+ return (int)cpu_2_logical_apicid[cpu];
+}
+
+/*
+ * Supporting over 60 cpus on NUMA-Q requires a locality-dependent
+ * cpu to APIC ID relation to properly interact with the intelligent
+ * mode of the cluster controller.
+ */
+static inline int numaq_cpu_present_to_apicid(int mps_cpu)
+{
+ if (mps_cpu < 60)
+ return ((mps_cpu >> 2) << 4) | (1 << (mps_cpu & 0x3));
+ else
+ return BAD_APICID;
+}
+
+static inline int numaq_apicid_to_node(int logical_apicid)
+{
+ return logical_apicid >> 4;
+}
+
+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);
+
+ return physid_mask_of_physid(cpu + 4*node);
+}
+
+extern void *xquad_portio;
+
+static inline int numaq_check_phys_apicid_present(int boot_cpu_physical_apicid)
+{
+ return 1;
+}
+
+/*
+ * We use physical apicids here, not logical, so just return the default
+ * physical broadcast to stop people from breaking us
+ */
+static inline unsigned int numaq_cpu_mask_to_apicid(const cpumask_t *cpumask)
+{
+ return 0x0F;
+}
+
+static inline unsigned int
+numaq_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
+ const struct cpumask *andmask)
+{
+ return 0x0F;
+}
+
+/* No NUMA-Q box has a HT CPU, but it can't hurt to use the default code. */
+static inline int numaq_phys_pkg_id(int cpuid_apic, int index_msb)
+{
+ return cpuid_apic >> index_msb;
+}
static int __numaq_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
{
numaq_mps_oem_check(mpc, oem, productid);
diff --git a/arch/x86/pci/numaq_32.c b/arch/x86/pci/numaq_32.c
index 2089354..1b2d773 100644
--- a/arch/x86/pci/numaq_32.c
+++ b/arch/x86/pci/numaq_32.c
@@ -5,7 +5,7 @@
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/nodemask.h>
-#include <mach_apic.h>
+#include <asm/genapic.h>
#include <asm/mpspec.h>
#include <asm/pci_x86.h>
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 074/114] x86, summit: consolidate code
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (72 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 073/114] x86, numaq: consolidate code Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 075/114] x86: remove mach_apic.h Ingo Molnar
` (41 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Consolidate all the Summit code into a single file:
arch/x86/kernel/summit_32.c.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/summit/apic.h | 195 ---------------
arch/x86/include/asm/summit/apicdef.h | 9 -
arch/x86/include/asm/summit/ipi.h | 26 --
arch/x86/include/asm/summit/mpparse.h | 109 ---------
arch/x86/kernel/summit_32.c | 417 ++++++++++++++++++++++++++++++++-
arch/x86/mach-generic/Makefile | 1 -
arch/x86/mach-generic/summit.c | 94 --------
7 files changed, 416 insertions(+), 435 deletions(-)
delete mode 100644 arch/x86/include/asm/summit/apic.h
delete mode 100644 arch/x86/include/asm/summit/apicdef.h
delete mode 100644 arch/x86/include/asm/summit/ipi.h
delete mode 100644 arch/x86/include/asm/summit/mpparse.h
delete mode 100644 arch/x86/mach-generic/summit.c
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
deleted file mode 100644
index 15b8dbd..0000000
--- a/arch/x86/include/asm/summit/apic.h
+++ /dev/null
@@ -1,195 +0,0 @@
-#ifndef __ASM_SUMMIT_APIC_H
-#define __ASM_SUMMIT_APIC_H
-
-#include <asm/smp.h>
-#include <linux/gfp.h>
-
-/* 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
-#define XAPIC_DEST_CPUS_MASK ((1u << XAPIC_DEST_CPUS_SHIFT) - 1)
-#define XAPIC_DEST_CLUSTER_MASK (XAPIC_DEST_CPUS_MASK << XAPIC_DEST_CPUS_SHIFT)
-
-#define APIC_DFR_VALUE (APIC_DFR_CLUSTER)
-
-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
- * Just start on cpu 0. IRQ balancing will spread load
- */
- return &cpumask_of_cpu(0);
-}
-
-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 summit_check_apicid_present(int bit)
-{
- return 1;
-}
-
-#define apicid_cluster(apicid) ((apicid) & XAPIC_DEST_CLUSTER_MASK)
-
-extern u8 cpu_2_logical_apicid[];
-
-static inline void summit_init_apic_ldr(void)
-{
- unsigned long val, id;
- int count = 0;
- u8 my_id = (u8)hard_smp_processor_id();
- u8 my_cluster = (u8)apicid_cluster(my_id);
-#ifdef CONFIG_SMP
- u8 lid;
- int i;
-
- /* Create logical APIC IDs by counting CPUs already in cluster. */
- for (count = 0, i = nr_cpu_ids; --i >= 0; ) {
- lid = cpu_2_logical_apicid[i];
- if (lid != BAD_APICID && apicid_cluster(lid) == my_cluster)
- ++count;
- }
-#endif
- /* We only have a 4 wide bitmap in cluster mode. If a deranged
- * BIOS puts 5 CPUs in one APIC cluster, we're hosed. */
- BUG_ON(count >= XAPIC_DEST_CPUS_SHIFT);
- id = my_cluster | (1UL << count);
- apic_write(APIC_DFR, APIC_DFR_VALUE);
- val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
- val |= SET_APIC_LOGICAL_ID(id);
- apic_write(APIC_LDR, val);
-}
-
-static inline int summit_apic_id_registered(void)
-{
- return 1;
-}
-
-static inline void summit_setup_apic_routing(void)
-{
- printk("Enabling APIC mode: Summit. Using %d I/O APICs\n",
- nr_ioapics);
-}
-
-static inline int summit_apicid_to_node(int logical_apicid)
-{
-#ifdef CONFIG_SMP
- return apicid_2_node[hard_smp_processor_id()];
-#else
- return 0;
-#endif
-}
-
-/* Mapping from cpu number to logical apicid */
-static inline int summit_cpu_to_logical_apicid(int cpu)
-{
-#ifdef CONFIG_SMP
- if (cpu >= nr_cpu_ids)
- return BAD_APICID;
- return (int)cpu_2_logical_apicid[cpu];
-#else
- return logical_smp_processor_id();
-#endif
-}
-
-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);
- else
- return BAD_APICID;
-}
-
-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);
-}
-
-static inline physid_mask_t summit_apicid_to_cpu_present(int apicid)
-{
- return physid_mask_of_physid(0);
-}
-
-static inline void summit_setup_portio_remap(void)
-{
-}
-
-static inline int summit_check_phys_apicid_present(int boot_cpu_physical_apicid)
-{
- return 1;
-}
-
-static inline unsigned int summit_cpu_mask_to_apicid(const cpumask_t *cpumask)
-{
- int cpus_found = 0;
- 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 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)) {
- printk ("%s: Not a valid mask!\n", __func__);
-
- return 0xFF;
- }
- apicid = apicid | new_apicid;
- cpus_found++;
- }
- cpu++;
- }
- return apicid;
-}
-
-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;
-
- if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC))
- return apicid;
-
- cpumask_and(cpumask, inmask, andmask);
- cpumask_and(cpumask, cpumask, cpu_online_mask);
- apicid = summit_cpu_mask_to_apicid(cpumask);
-
- free_cpumask_var(cpumask);
-
- return apicid;
-}
-
-/*
- * 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 int summit_phys_pkg_id(int cpuid_apic, int index_msb)
-{
- return hard_smp_processor_id() >> index_msb;
-}
-
-#endif /* __ASM_SUMMIT_APIC_H */
diff --git a/arch/x86/include/asm/summit/apicdef.h b/arch/x86/include/asm/summit/apicdef.h
deleted file mode 100644
index c24b0df..0000000
--- a/arch/x86/include/asm/summit/apicdef.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef __ASM_SUMMIT_APICDEF_H
-#define __ASM_SUMMIT_APICDEF_H
-
-static inline unsigned summit_get_apic_id(unsigned long x)
-{
- return (x >> 24) & 0xFF;
-}
-
-#endif
diff --git a/arch/x86/include/asm/summit/ipi.h b/arch/x86/include/asm/summit/ipi.h
deleted file mode 100644
index f87a43f..0000000
--- a/arch/x86/include/asm/summit/ipi.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef __ASM_SUMMIT_IPI_H
-#define __ASM_SUMMIT_IPI_H
-
-void default_send_IPI_mask_sequence(const cpumask_t *mask, int vector);
-void default_send_IPI_mask_allbutself(const cpumask_t *mask, int vector);
-
-static inline void summit_send_IPI_mask(const cpumask_t *mask, int vector)
-{
- default_send_IPI_mask_sequence(mask, vector);
-}
-
-static inline void summit_send_IPI_allbutself(int vector)
-{
- cpumask_t mask = cpu_online_map;
- cpu_clear(smp_processor_id(), mask);
-
- if (!cpus_empty(mask))
- summit_send_IPI_mask(&mask, vector);
-}
-
-static inline void summit_send_IPI_all(int vector)
-{
- summit_send_IPI_mask(&cpu_online_map, vector);
-}
-
-#endif /* __ASM_SUMMIT_IPI_H */
diff --git a/arch/x86/include/asm/summit/mpparse.h b/arch/x86/include/asm/summit/mpparse.h
deleted file mode 100644
index 4bbcce3..0000000
--- a/arch/x86/include/asm/summit/mpparse.h
+++ /dev/null
@@ -1,109 +0,0 @@
-#ifndef __ASM_SUMMIT_MPPARSE_H
-#define __ASM_SUMMIT_MPPARSE_H
-
-#include <asm/tsc.h>
-
-extern int use_cyclone;
-
-#ifdef CONFIG_X86_SUMMIT_NUMA
-extern void setup_summit(void);
-#else
-#define setup_summit() {}
-#endif
-
-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)
- || !strncmp(productid, "EXA", 3)
- || !strncmp(productid, "RUTHLESS SMP", 12))){
- mark_tsc_unstable("Summit based system");
- use_cyclone = 1; /*enable cyclone-timer*/
- setup_summit();
- return 1;
- }
- return 0;
-}
-
-/* Hook from generic ACPI tables.c */
-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)
- || !strncmp(oem_table_id, "EXA", 3))){
- mark_tsc_unstable("Summit based system");
- use_cyclone = 1; /*enable cyclone-timer*/
- setup_summit();
- return 1;
- }
- return 0;
-}
-
-struct rio_table_hdr {
- unsigned char version; /* Version number of this data structure */
- /* Version 3 adds chassis_num & WP_index */
- unsigned char num_scal_dev; /* # of Scalability devices (Twisters for Vigil) */
- unsigned char num_rio_dev; /* # of RIO I/O devices (Cyclones and Winnipegs) */
-} __attribute__((packed));
-
-struct scal_detail {
- unsigned char node_id; /* Scalability Node ID */
- unsigned long CBAR; /* Address of 1MB register space */
- unsigned char port0node; /* Node ID port connected to: 0xFF=None */
- unsigned char port0port; /* Port num port connected to: 0,1,2, or 0xFF=None */
- unsigned char port1node; /* Node ID port connected to: 0xFF = None */
- unsigned char port1port; /* Port num port connected to: 0,1,2, or 0xFF=None */
- unsigned char port2node; /* Node ID port connected to: 0xFF = None */
- unsigned char port2port; /* Port num port connected to: 0,1,2, or 0xFF=None */
- unsigned char chassis_num; /* 1 based Chassis number (1 = boot node) */
-} __attribute__((packed));
-
-struct rio_detail {
- unsigned char node_id; /* RIO Node ID */
- unsigned long BBAR; /* Address of 1MB register space */
- unsigned char type; /* Type of device */
- unsigned char owner_id; /* For WPEG: Node ID of Cyclone that owns this WPEG*/
- /* For CYC: Node ID of Twister that owns this CYC */
- unsigned char port0node; /* Node ID port connected to: 0xFF=None */
- unsigned char port0port; /* Port num port connected to: 0,1,2, or 0xFF=None */
- unsigned char port1node; /* Node ID port connected to: 0xFF=None */
- unsigned char port1port; /* Port num port connected to: 0,1,2, or 0xFF=None */
- unsigned char first_slot; /* For WPEG: Lowest slot number below this WPEG */
- /* For CYC: 0 */
- unsigned char status; /* For WPEG: Bit 0 = 1 : the XAPIC is used */
- /* = 0 : the XAPIC is not used, ie:*/
- /* ints fwded to another XAPIC */
- /* Bits1:7 Reserved */
- /* For CYC: Bits0:7 Reserved */
- unsigned char WP_index; /* For WPEG: WPEG instance index - lower ones have */
- /* lower slot numbers/PCI bus numbers */
- /* For CYC: No meaning */
- unsigned char chassis_num; /* 1 based Chassis number */
- /* For LookOut WPEGs this field indicates the */
- /* Expansion Chassis #, enumerated from Boot */
- /* Node WPEG external port, then Boot Node CYC */
- /* external port, then Next Vigil chassis WPEG */
- /* external port, etc. */
- /* Shared Lookouts have only 1 chassis number (the */
- /* first one assigned) */
-} __attribute__((packed));
-
-
-typedef enum {
- CompatTwister = 0, /* Compatibility Twister */
- AltTwister = 1, /* Alternate Twister of internal 8-way */
- CompatCyclone = 2, /* Compatibility Cyclone */
- AltCyclone = 3, /* Alternate Cyclone of internal 8-way */
- CompatWPEG = 4, /* Compatibility WPEG */
- AltWPEG = 5, /* Second Planar WPEG */
- LookOutAWPEG = 6, /* LookOut WPEG */
- LookOutBWPEG = 7, /* LookOut WPEG */
-} node_type;
-
-static inline int is_WPEG(struct rio_detail *rio){
- return (rio->type == CompatWPEG || rio->type == AltWPEG ||
- rio->type == LookOutAWPEG || rio->type == LookOutBWPEG);
-}
-
-#endif /* __ASM_SUMMIT_MPPARSE_H */
diff --git a/arch/x86/kernel/summit_32.c b/arch/x86/kernel/summit_32.c
index 7b98785..3b60dd5 100644
--- a/arch/x86/kernel/summit_32.c
+++ b/arch/x86/kernel/summit_32.c
@@ -30,7 +30,364 @@
#include <linux/init.h>
#include <asm/io.h>
#include <asm/bios_ebda.h>
-#include <asm/summit/mpparse.h>
+
+/*
+ * APIC driver for the IBM "Summit" chipset.
+ */
+#define APIC_DEFINITION 1
+#include <linux/threads.h>
+#include <linux/cpumask.h>
+#include <asm/mpspec.h>
+#include <asm/apic.h>
+#include <asm/smp.h>
+#include <asm/genapic.h>
+#include <asm/fixmap.h>
+#include <asm/apicdef.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/init.h>
+#include <linux/gfp.h>
+#include <linux/smp.h>
+
+static inline unsigned summit_get_apic_id(unsigned long x)
+{
+ return (x >> 24) & 0xFF;
+}
+
+void default_send_IPI_mask_sequence(const cpumask_t *mask, int vector);
+void default_send_IPI_mask_allbutself(const cpumask_t *mask, int vector);
+
+static inline void summit_send_IPI_mask(const cpumask_t *mask, int vector)
+{
+ default_send_IPI_mask_sequence(mask, vector);
+}
+
+static inline void summit_send_IPI_allbutself(int vector)
+{
+ cpumask_t mask = cpu_online_map;
+ cpu_clear(smp_processor_id(), mask);
+
+ if (!cpus_empty(mask))
+ summit_send_IPI_mask(&mask, vector);
+}
+
+static inline void summit_send_IPI_all(int vector)
+{
+ summit_send_IPI_mask(&cpu_online_map, vector);
+}
+
+#include <asm/tsc.h>
+
+extern int use_cyclone;
+
+#ifdef CONFIG_X86_SUMMIT_NUMA
+extern void setup_summit(void);
+#else
+#define setup_summit() {}
+#endif
+
+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)
+ || !strncmp(productid, "EXA", 3)
+ || !strncmp(productid, "RUTHLESS SMP", 12))){
+ mark_tsc_unstable("Summit based system");
+ use_cyclone = 1; /*enable cyclone-timer*/
+ setup_summit();
+ return 1;
+ }
+ return 0;
+}
+
+/* Hook from generic ACPI tables.c */
+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)
+ || !strncmp(oem_table_id, "EXA", 3))){
+ mark_tsc_unstable("Summit based system");
+ use_cyclone = 1; /*enable cyclone-timer*/
+ setup_summit();
+ return 1;
+ }
+ return 0;
+}
+
+struct rio_table_hdr {
+ unsigned char version; /* Version number of this data structure */
+ /* Version 3 adds chassis_num & WP_index */
+ unsigned char num_scal_dev; /* # of Scalability devices (Twisters for Vigil) */
+ unsigned char num_rio_dev; /* # of RIO I/O devices (Cyclones and Winnipegs) */
+} __attribute__((packed));
+
+struct scal_detail {
+ unsigned char node_id; /* Scalability Node ID */
+ unsigned long CBAR; /* Address of 1MB register space */
+ unsigned char port0node; /* Node ID port connected to: 0xFF=None */
+ unsigned char port0port; /* Port num port connected to: 0,1,2, or 0xFF=None */
+ unsigned char port1node; /* Node ID port connected to: 0xFF = None */
+ unsigned char port1port; /* Port num port connected to: 0,1,2, or 0xFF=None */
+ unsigned char port2node; /* Node ID port connected to: 0xFF = None */
+ unsigned char port2port; /* Port num port connected to: 0,1,2, or 0xFF=None */
+ unsigned char chassis_num; /* 1 based Chassis number (1 = boot node) */
+} __attribute__((packed));
+
+struct rio_detail {
+ unsigned char node_id; /* RIO Node ID */
+ unsigned long BBAR; /* Address of 1MB register space */
+ unsigned char type; /* Type of device */
+ unsigned char owner_id; /* For WPEG: Node ID of Cyclone that owns this WPEG*/
+ /* For CYC: Node ID of Twister that owns this CYC */
+ unsigned char port0node; /* Node ID port connected to: 0xFF=None */
+ unsigned char port0port; /* Port num port connected to: 0,1,2, or 0xFF=None */
+ unsigned char port1node; /* Node ID port connected to: 0xFF=None */
+ unsigned char port1port; /* Port num port connected to: 0,1,2, or 0xFF=None */
+ unsigned char first_slot; /* For WPEG: Lowest slot number below this WPEG */
+ /* For CYC: 0 */
+ unsigned char status; /* For WPEG: Bit 0 = 1 : the XAPIC is used */
+ /* = 0 : the XAPIC is not used, ie:*/
+ /* ints fwded to another XAPIC */
+ /* Bits1:7 Reserved */
+ /* For CYC: Bits0:7 Reserved */
+ unsigned char WP_index; /* For WPEG: WPEG instance index - lower ones have */
+ /* lower slot numbers/PCI bus numbers */
+ /* For CYC: No meaning */
+ unsigned char chassis_num; /* 1 based Chassis number */
+ /* For LookOut WPEGs this field indicates the */
+ /* Expansion Chassis #, enumerated from Boot */
+ /* Node WPEG external port, then Boot Node CYC */
+ /* external port, then Next Vigil chassis WPEG */
+ /* external port, etc. */
+ /* Shared Lookouts have only 1 chassis number (the */
+ /* first one assigned) */
+} __attribute__((packed));
+
+
+typedef enum {
+ CompatTwister = 0, /* Compatibility Twister */
+ AltTwister = 1, /* Alternate Twister of internal 8-way */
+ CompatCyclone = 2, /* Compatibility Cyclone */
+ AltCyclone = 3, /* Alternate Cyclone of internal 8-way */
+ CompatWPEG = 4, /* Compatibility WPEG */
+ AltWPEG = 5, /* Second Planar WPEG */
+ LookOutAWPEG = 6, /* LookOut WPEG */
+ LookOutBWPEG = 7, /* LookOut WPEG */
+} node_type;
+
+static inline int is_WPEG(struct rio_detail *rio){
+ return (rio->type == CompatWPEG || rio->type == AltWPEG ||
+ rio->type == LookOutAWPEG || rio->type == LookOutBWPEG);
+}
+
+
+/* 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
+#define XAPIC_DEST_CPUS_MASK ((1u << XAPIC_DEST_CPUS_SHIFT) - 1)
+#define XAPIC_DEST_CLUSTER_MASK (XAPIC_DEST_CPUS_MASK << XAPIC_DEST_CPUS_SHIFT)
+
+#define SUMMIT_APIC_DFR_VALUE (APIC_DFR_CLUSTER)
+
+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
+ * Just start on cpu 0. IRQ balancing will spread load
+ */
+ return &cpumask_of_cpu(0);
+}
+
+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 summit_check_apicid_present(int bit)
+{
+ return 1;
+}
+
+#define apicid_cluster(apicid) ((apicid) & XAPIC_DEST_CLUSTER_MASK)
+
+extern u8 cpu_2_logical_apicid[];
+
+static inline void summit_init_apic_ldr(void)
+{
+ unsigned long val, id;
+ int count = 0;
+ u8 my_id = (u8)hard_smp_processor_id();
+ u8 my_cluster = (u8)apicid_cluster(my_id);
+#ifdef CONFIG_SMP
+ u8 lid;
+ int i;
+
+ /* Create logical APIC IDs by counting CPUs already in cluster. */
+ for (count = 0, i = nr_cpu_ids; --i >= 0; ) {
+ lid = cpu_2_logical_apicid[i];
+ if (lid != BAD_APICID && apicid_cluster(lid) == my_cluster)
+ ++count;
+ }
+#endif
+ /* We only have a 4 wide bitmap in cluster mode. If a deranged
+ * BIOS puts 5 CPUs in one APIC cluster, we're hosed. */
+ BUG_ON(count >= XAPIC_DEST_CPUS_SHIFT);
+ id = my_cluster | (1UL << count);
+ apic_write(APIC_DFR, SUMMIT_APIC_DFR_VALUE);
+ val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
+ val |= SET_APIC_LOGICAL_ID(id);
+ apic_write(APIC_LDR, val);
+}
+
+static inline int summit_apic_id_registered(void)
+{
+ return 1;
+}
+
+static inline void summit_setup_apic_routing(void)
+{
+ printk("Enabling APIC mode: Summit. Using %d I/O APICs\n",
+ nr_ioapics);
+}
+
+static inline int summit_apicid_to_node(int logical_apicid)
+{
+#ifdef CONFIG_SMP
+ return apicid_2_node[hard_smp_processor_id()];
+#else
+ return 0;
+#endif
+}
+
+/* Mapping from cpu number to logical apicid */
+static inline int summit_cpu_to_logical_apicid(int cpu)
+{
+#ifdef CONFIG_SMP
+ if (cpu >= nr_cpu_ids)
+ return BAD_APICID;
+ return (int)cpu_2_logical_apicid[cpu];
+#else
+ return logical_smp_processor_id();
+#endif
+}
+
+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);
+ else
+ return BAD_APICID;
+}
+
+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);
+}
+
+static inline physid_mask_t summit_apicid_to_cpu_present(int apicid)
+{
+ return physid_mask_of_physid(0);
+}
+
+static inline void summit_setup_portio_remap(void)
+{
+}
+
+static inline int summit_check_phys_apicid_present(int boot_cpu_physical_apicid)
+{
+ return 1;
+}
+
+static inline unsigned int summit_cpu_mask_to_apicid(const cpumask_t *cpumask)
+{
+ int cpus_found = 0;
+ 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 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)) {
+ printk ("%s: Not a valid mask!\n", __func__);
+
+ return 0xFF;
+ }
+ apicid = apicid | new_apicid;
+ cpus_found++;
+ }
+ cpu++;
+ }
+ return apicid;
+}
+
+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;
+
+ if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC))
+ return apicid;
+
+ cpumask_and(cpumask, inmask, andmask);
+ cpumask_and(cpumask, cpumask, cpu_online_mask);
+ apicid = summit_cpu_mask_to_apicid(cpumask);
+
+ free_cpumask_var(cpumask);
+
+ return apicid;
+}
+
+/*
+ * 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 int summit_phys_pkg_id(int cpuid_apic, int index_msb)
+{
+ return hard_smp_processor_id() >> index_msb;
+}
+
+static int probe_summit(void)
+{
+ /* probed later in mptable/ACPI hooks */
+ return 0;
+}
+
+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
+ * 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, } };
+}
static struct rio_table_hdr *rio_table_hdr __initdata;
static struct scal_detail *scal_devs[MAX_NUMNODES] __initdata;
@@ -186,3 +543,61 @@ void __init setup_summit(void)
next_wpeg = 0;
} while (next_wpeg != 0);
}
+
+
+struct genapic apic_summit = {
+
+ .name = "summit",
+ .probe = probe_summit,
+ .acpi_madt_oem_check = summit_acpi_madt_oem_check,
+ .apic_id_registered = summit_apic_id_registered,
+
+ .irq_delivery_mode = dest_LowestPrio,
+ /* logical delivery broadcast to all CPUs: */
+ .irq_dest_mode = 1,
+
+ .target_cpus = summit_target_cpus,
+ .disable_esr = 1,
+ .dest_logical = APIC_DEST_LOGICAL,
+ .check_apicid_used = summit_check_apicid_used,
+ .check_apicid_present = summit_check_apicid_present,
+
+ .vector_allocation_domain = summit_vector_allocation_domain,
+ .init_apic_ldr = summit_init_apic_ldr,
+
+ .ioapic_phys_id_map = summit_ioapic_phys_id_map,
+ .setup_apic_routing = summit_setup_apic_routing,
+ .multi_timer_check = NULL,
+ .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 = summit_apicid_to_cpu_present,
+ .setup_portio_remap = NULL,
+ .check_phys_apicid_present = summit_check_phys_apicid_present,
+ .enable_apic_mode = NULL,
+ .phys_pkg_id = summit_phys_pkg_id,
+ .mps_oem_check = summit_mps_oem_check,
+
+ .get_apic_id = summit_get_apic_id,
+ .set_apic_id = NULL,
+ .apic_id_mask = 0xFF << 24,
+
+ .cpu_mask_to_apicid = summit_cpu_mask_to_apicid,
+ .cpu_mask_to_apicid_and = summit_cpu_mask_to_apicid_and,
+
+ .send_IPI_mask = summit_send_IPI_mask,
+ .send_IPI_mask_allbutself = NULL,
+ .send_IPI_allbutself = summit_send_IPI_allbutself,
+ .send_IPI_all = summit_send_IPI_all,
+ .send_IPI_self = NULL,
+
+ .wakeup_cpu = NULL,
+ .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW,
+ .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH,
+
+ .wait_for_init_deassert = default_wait_for_init_deassert,
+
+ .smp_callin_clear_local_apic = NULL,
+ .store_NMI_vector = NULL,
+ .inquire_remote_apic = default_inquire_remote_apic,
+};
diff --git a/arch/x86/mach-generic/Makefile b/arch/x86/mach-generic/Makefile
index 6730f4e..78ab573 100644
--- a/arch/x86/mach-generic/Makefile
+++ b/arch/x86/mach-generic/Makefile
@@ -6,6 +6,5 @@ EXTRA_CFLAGS := -Iarch/x86/kernel
obj-y := probe.o default.o
obj-$(CONFIG_X86_NUMAQ) += numaq.o
-obj-$(CONFIG_X86_SUMMIT) += summit.o
obj-$(CONFIG_X86_BIGSMP) += bigsmp.o
obj-$(CONFIG_X86_ES7000) += es7000.o
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
deleted file mode 100644
index 673a64f..0000000
--- a/arch/x86/mach-generic/summit.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * APIC driver for the IBM "Summit" chipset.
- */
-#define APIC_DEFINITION 1
-#include <linux/threads.h>
-#include <linux/cpumask.h>
-#include <asm/mpspec.h>
-#include <asm/genapic.h>
-#include <asm/fixmap.h>
-#include <asm/apicdef.h>
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/init.h>
-#include <asm/summit/apicdef.h>
-#include <linux/smp.h>
-#include <asm/summit/apic.h>
-#include <asm/summit/ipi.h>
-#include <asm/summit/mpparse.h>
-
-static int probe_summit(void)
-{
- /* probed later in mptable/ACPI hooks */
- return 0;
-}
-
-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
- * 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, } };
-}
-
-struct genapic apic_summit = {
-
- .name = "summit",
- .probe = probe_summit,
- .acpi_madt_oem_check = summit_acpi_madt_oem_check,
- .apic_id_registered = summit_apic_id_registered,
-
- .irq_delivery_mode = dest_LowestPrio,
- /* logical delivery broadcast to all CPUs: */
- .irq_dest_mode = 1,
-
- .target_cpus = summit_target_cpus,
- .disable_esr = 1,
- .dest_logical = APIC_DEST_LOGICAL,
- .check_apicid_used = summit_check_apicid_used,
- .check_apicid_present = summit_check_apicid_present,
-
- .vector_allocation_domain = summit_vector_allocation_domain,
- .init_apic_ldr = summit_init_apic_ldr,
-
- .ioapic_phys_id_map = summit_ioapic_phys_id_map,
- .setup_apic_routing = summit_setup_apic_routing,
- .multi_timer_check = NULL,
- .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 = summit_apicid_to_cpu_present,
- .setup_portio_remap = NULL,
- .check_phys_apicid_present = summit_check_phys_apicid_present,
- .enable_apic_mode = NULL,
- .phys_pkg_id = summit_phys_pkg_id,
- .mps_oem_check = summit_mps_oem_check,
-
- .get_apic_id = summit_get_apic_id,
- .set_apic_id = NULL,
- .apic_id_mask = 0xFF << 24,
-
- .cpu_mask_to_apicid = summit_cpu_mask_to_apicid,
- .cpu_mask_to_apicid_and = summit_cpu_mask_to_apicid_and,
-
- .send_IPI_mask = summit_send_IPI_mask,
- .send_IPI_mask_allbutself = NULL,
- .send_IPI_allbutself = summit_send_IPI_allbutself,
- .send_IPI_all = summit_send_IPI_all,
- .send_IPI_self = NULL,
-
- .wakeup_cpu = NULL,
- .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW,
- .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH,
-
- .wait_for_init_deassert = default_wait_for_init_deassert,
-
- .smp_callin_clear_local_apic = NULL,
- .store_NMI_vector = NULL,
- .inquire_remote_apic = default_inquire_remote_apic,
-};
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 075/114] x86: remove mach_apic.h
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (73 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 074/114] x86, summit: " Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 076/114] x86, ES7000: Consolidate code Ingo Molnar
` (40 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Spread mach_apic.h definitions into genapic.h. (with some knock-on effects
on smp.h and apic.h.)
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/apic.h | 2 +-
arch/x86/include/asm/genapic.h | 139 ++++++++++++++++++++++++
arch/x86/include/asm/mach-default/mach_apic.h | 144 -------------------------
arch/x86/include/asm/mach-generic/mach_apic.h | 8 --
arch/x86/include/asm/smp.h | 19 ----
arch/x86/kernel/acpi/boot.c | 14 +---
arch/x86/kernel/apic.c | 22 ++++-
arch/x86/kernel/cpu/addon_cpuid_features.c | 2 +-
arch/x86/kernel/cpu/amd.c | 2 +-
arch/x86/kernel/cpu/common.c | 2 +-
arch/x86/kernel/cpu/intel.c | 2 +-
arch/x86/kernel/io_apic.c | 2 +-
arch/x86/kernel/ipi.c | 2 +-
arch/x86/kernel/irq_32.c | 2 +-
arch/x86/kernel/mpparse.c | 3 +-
arch/x86/kernel/setup.c | 2 +-
arch/x86/kernel/smp.c | 2 +-
arch/x86/kernel/smpboot.c | 2 +-
arch/x86/kernel/tlb_uv.c | 2 +-
arch/x86/kernel/visws_quirks.c | 2 +-
arch/x86/mach-generic/default.c | 2 +-
arch/x86/mach-generic/probe.c | 5 -
22 files changed, 175 insertions(+), 207 deletions(-)
delete mode 100644 arch/x86/include/asm/mach-default/mach_apic.h
delete mode 100644 arch/x86/include/asm/mach-generic/mach_apic.h
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index 3a32020..6a77068 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -215,7 +215,7 @@ static inline void disable_local_APIC(void) { }
#define SET_APIC_ID(x) (apic->set_apic_id(x))
#else
-static inline unsigned default_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));
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h
index 1772dad..ce3655a 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -120,4 +120,143 @@ static inline void default_wait_for_init_deassert(atomic_t *deassert)
return;
}
+extern void generic_bigsmp_probe(void);
+
+
+#ifdef CONFIG_X86_LOCAL_APIC
+
+#include <asm/smp.h>
+
+#define APIC_DFR_VALUE (APIC_DFR_FLAT)
+
+static inline const struct cpumask *default_target_cpus(void)
+{
+#ifdef CONFIG_SMP
+ return cpu_online_mask;
+#else
+ return cpumask_of(0);
+#endif
+}
+
+DECLARE_EARLY_PER_CPU(u16, x86_bios_cpu_apicid);
+
+
+static inline unsigned int read_apic_id(void)
+{
+ unsigned int reg;
+
+ reg = *(u32 *)(APIC_BASE + APIC_ID);
+
+ return apic->get_apic_id(reg);
+}
+
+#ifdef CONFIG_X86_64
+extern void default_setup_apic_routing(void);
+#else
+
+/*
+ * Set up the logical destination ID.
+ *
+ * Intel recommends to set DFR, LDR and TPR before enabling
+ * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel
+ * document number 292116). So here it goes...
+ */
+extern void default_init_apic_ldr(void);
+
+static inline int default_apic_id_registered(void)
+{
+ return physid_isset(read_apic_id(), phys_cpu_present_map);
+}
+
+static inline unsigned int
+default_cpu_mask_to_apicid(const struct cpumask *cpumask)
+{
+ return cpumask_bits(cpumask)[0];
+}
+
+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];
+ unsigned long mask3 = cpumask_bits(cpu_online_mask)[0];
+
+ return (unsigned int)(mask1 & mask2 & mask3);
+}
+
+static inline int default_phys_pkg_id(int cpuid_apic, int index_msb)
+{
+ return cpuid_apic >> index_msb;
+}
+
+static inline void default_setup_apic_routing(void)
+{
+#ifdef CONFIG_X86_IO_APIC
+ printk("Enabling APIC mode: %s. Using %d I/O APICs\n",
+ "Flat", nr_ioapics);
+#endif
+}
+
+extern int default_apicid_to_node(int logical_apicid);
+
+#endif
+
+static inline unsigned long default_check_apicid_used(physid_mask_t bitmap, int apicid)
+{
+ return physid_isset(apicid, bitmap);
+}
+
+static inline unsigned long default_check_apicid_present(int bit)
+{
+ return physid_isset(bit, phys_cpu_present_map);
+}
+
+static inline physid_mask_t default_ioapic_phys_id_map(physid_mask_t phys_map)
+{
+ return phys_map;
+}
+
+/* Mapping from cpu number to logical apicid */
+static inline int default_cpu_to_logical_apicid(int cpu)
+{
+ return 1 << 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);
+ else
+ 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)
+{
+ return physid_mask_of_physid(phys_apicid);
+}
+
+#endif /* CONFIG_X86_LOCAL_APIC */
#endif /* _ASM_X86_GENAPIC_64_H */
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
deleted file mode 100644
index bae053c..0000000
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ /dev/null
@@ -1,144 +0,0 @@
-#ifndef _ASM_X86_MACH_DEFAULT_MACH_APIC_H
-#define _ASM_X86_MACH_DEFAULT_MACH_APIC_H
-
-#ifdef CONFIG_X86_LOCAL_APIC
-
-#include <asm/smp.h>
-
-#define APIC_DFR_VALUE (APIC_DFR_FLAT)
-
-static inline const struct cpumask *default_target_cpus(void)
-{
-#ifdef CONFIG_SMP
- return cpu_online_mask;
-#else
- return cpumask_of(0);
-#endif
-}
-
-#ifdef CONFIG_X86_64
-#include <asm/genapic.h>
-#define read_apic_id() (apic->get_apic_id(apic_read(APIC_ID)))
-extern void default_setup_apic_routing(void);
-#else
-/*
- * Set up the logical destination ID.
- *
- * Intel recommends to set DFR, LDR and TPR before enabling
- * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel
- * document number 292116). So here it goes...
- */
-static inline void default_init_apic_ldr(void)
-{
- unsigned long val;
-
- apic_write(APIC_DFR, APIC_DFR_VALUE);
- val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
- val |= SET_APIC_LOGICAL_ID(1UL << smp_processor_id());
- apic_write(APIC_LDR, val);
-}
-
-static inline int default_apic_id_registered(void)
-{
- return physid_isset(read_apic_id(), phys_cpu_present_map);
-}
-
-static inline unsigned int
-default_cpu_mask_to_apicid(const struct cpumask *cpumask)
-{
- return cpumask_bits(cpumask)[0];
-}
-
-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];
- unsigned long mask3 = cpumask_bits(cpu_online_mask)[0];
-
- return (unsigned int)(mask1 & mask2 & mask3);
-}
-
-static inline int default_phys_pkg_id(int cpuid_apic, int index_msb)
-{
- return cpuid_apic >> index_msb;
-}
-
-static inline void default_setup_apic_routing(void)
-{
-#ifdef CONFIG_X86_IO_APIC
- printk("Enabling APIC mode: %s. Using %d I/O APICs\n",
- "Flat", nr_ioapics);
-#endif
-}
-
-static inline int default_apicid_to_node(int logical_apicid)
-{
-#ifdef CONFIG_SMP
- return apicid_2_node[hard_smp_processor_id()];
-#else
- return 0;
-#endif
-}
-
-#endif
-
-static inline unsigned long default_check_apicid_used(physid_mask_t bitmap, int apicid)
-{
- return physid_isset(apicid, bitmap);
-}
-
-static inline unsigned long default_check_apicid_present(int bit)
-{
- return physid_isset(bit, phys_cpu_present_map);
-}
-
-static inline physid_mask_t default_ioapic_phys_id_map(physid_mask_t phys_map)
-{
- return phys_map;
-}
-
-/* Mapping from cpu number to logical apicid */
-static inline int default_cpu_to_logical_apicid(int cpu)
-{
- return 1 << 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);
- else
- 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)
-{
- return physid_mask_of_physid(phys_apicid);
-}
-
-#endif /* CONFIG_X86_LOCAL_APIC */
-#endif /* _ASM_X86_MACH_DEFAULT_MACH_APIC_H */
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
deleted file mode 100644
index 96f217f..0000000
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef _ASM_X86_MACH_GENERIC_MACH_APIC_H
-#define _ASM_X86_MACH_GENERIC_MACH_APIC_H
-
-#include <asm/genapic.h>
-
-extern void generic_bigsmp_probe(void);
-
-#endif /* _ASM_X86_MACH_GENERIC_MACH_APIC_H */
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
index d4ac4de..47d0e21 100644
--- a/arch/x86/include/asm/smp.h
+++ b/arch/x86/include/asm/smp.h
@@ -173,8 +173,6 @@ extern int safe_smp_processor_id(void);
#endif
-#include <asm/genapic.h>
-
#ifdef CONFIG_X86_LOCAL_APIC
#ifndef CONFIG_X86_64
@@ -184,26 +182,9 @@ static inline int logical_smp_processor_id(void)
return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR));
}
-static inline unsigned int read_apic_id(void)
-{
- unsigned int reg;
-
- reg = *(u32 *)(APIC_BASE + APIC_ID);
-
- return apic->get_apic_id(reg);
-}
#endif
-
-# if defined(APIC_DEFINITION) || defined(CONFIG_X86_64)
extern int hard_smp_processor_id(void);
-# else
-static inline int hard_smp_processor_id(void)
-{
- /* we don't want to mark this access volatile - bad code generation */
- return read_apic_id();
-}
-# endif /* APIC_DEFINITION */
#else /* CONFIG_X86_LOCAL_APIC */
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 7b02a1c..cb8b527 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -42,10 +42,6 @@
#include <asm/mpspec.h>
#include <asm/smp.h>
-#ifdef CONFIG_X86_LOCAL_APIC
-# include <mach_apic.h>
-#endif
-
static int __initdata acpi_force = 0;
u32 acpi_rsdt_forced;
#ifdef CONFIG_ACPI
@@ -56,15 +52,7 @@ int acpi_disabled = 1;
EXPORT_SYMBOL(acpi_disabled);
#ifdef CONFIG_X86_64
-
-#include <asm/proto.h>
-
-#else /* X86 */
-
-#ifdef CONFIG_X86_LOCAL_APIC
-#include <mach_apic.h>
-#endif /* CONFIG_X86_LOCAL_APIC */
-
+# include <asm/proto.h>
#endif /* X86 */
#define BAD_MADT_ENTRY(entry, end) ( \
diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic.c
index e622080..41a0ba3 100644
--- a/arch/x86/kernel/apic.c
+++ b/arch/x86/kernel/apic.c
@@ -49,7 +49,6 @@
#include <asm/i8259.h>
#include <asm/smp.h>
-#include <mach_apic.h>
#include <mach_ipi.h>
/*
@@ -1910,11 +1909,30 @@ void __cpuinit generic_processor_info(int apicid, int version)
set_cpu_present(cpu, true);
}
-#ifdef CONFIG_X86_64
int hard_smp_processor_id(void)
{
return read_apic_id();
}
+
+void default_init_apic_ldr(void)
+{
+ unsigned long val;
+
+ apic_write(APIC_DFR, APIC_DFR_VALUE);
+ val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
+ val |= SET_APIC_LOGICAL_ID(1UL << smp_processor_id());
+ apic_write(APIC_LDR, val);
+}
+
+#ifdef CONFIG_X86_32
+int default_apicid_to_node(int logical_apicid)
+{
+#ifdef CONFIG_SMP
+ return apicid_2_node[hard_smp_processor_id()];
+#else
+ return 0;
+#endif
+}
#endif
/*
diff --git a/arch/x86/kernel/cpu/addon_cpuid_features.c b/arch/x86/kernel/cpu/addon_cpuid_features.c
index e8bb892..4a48bb4 100644
--- a/arch/x86/kernel/cpu/addon_cpuid_features.c
+++ b/arch/x86/kernel/cpu/addon_cpuid_features.c
@@ -7,7 +7,7 @@
#include <asm/pat.h>
#include <asm/processor.h>
-#include <mach_apic.h>
+#include <asm/genapic.h>
struct cpuid_bit {
u16 feature;
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 7c878f6..ff4d7b9 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -12,7 +12,7 @@
# include <asm/cacheflush.h>
#endif
-#include <mach_apic.h>
+#include <asm/genapic.h>
#include "cpu.h"
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 055b9c3..c4bdc7f 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -26,7 +26,7 @@
#ifdef CONFIG_X86_LOCAL_APIC
#include <asm/mpspec.h>
#include <asm/apic.h>
-#include <mach_apic.h>
+#include <asm/genapic.h>
#include <asm/genapic.h>
#include <asm/uv/uv.h>
#endif
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index 5deefae..1cef0aa 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -24,7 +24,7 @@
#ifdef CONFIG_X86_LOCAL_APIC
#include <asm/mpspec.h>
#include <asm/apic.h>
-#include <mach_apic.h>
+#include <asm/genapic.h>
#endif
static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index abae819..e0744ea 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -63,7 +63,7 @@
#include <asm/uv/uv_irq.h>
#include <mach_ipi.h>
-#include <mach_apic.h>
+#include <asm/genapic.h>
#define __apicdebuginit(type) static type __init
diff --git a/arch/x86/kernel/ipi.c b/arch/x86/kernel/ipi.c
index e16c41b..50076d9 100644
--- a/arch/x86/kernel/ipi.c
+++ b/arch/x86/kernel/ipi.c
@@ -19,7 +19,7 @@
#include <asm/proto.h>
#ifdef CONFIG_X86_32
-#include <mach_apic.h>
+#include <asm/genapic.h>
#include <mach_ipi.h>
/*
diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c
index e0f29be..d802c84 100644
--- a/arch/x86/kernel/irq_32.c
+++ b/arch/x86/kernel/irq_32.c
@@ -231,7 +231,7 @@ unsigned int do_IRQ(struct pt_regs *regs)
}
#ifdef CONFIG_HOTPLUG_CPU
-#include <mach_apic.h>
+#include <asm/genapic.h>
/* A cpu has been removed from cpu_online_mask. Reset irq affinities. */
void fixup_irqs(void)
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
index a1452a5..94fe710 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -29,8 +29,7 @@
#include <asm/setup.h>
#include <asm/smp.h>
-#include <mach_apic.h>
-
+#include <asm/genapic.h>
/*
* Checksum an MP configuration block.
*/
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 6b27f6d..92e4293 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -97,7 +97,7 @@
#include <asm/mmu_context.h>
#include <asm/proto.h>
-#include <mach_apic.h>
+#include <asm/genapic.h>
#include <asm/paravirt.h>
#include <asm/hypervisor.h>
diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
index c48ba6c..892e7c3 100644
--- a/arch/x86/kernel/smp.c
+++ b/arch/x86/kernel/smp.c
@@ -27,7 +27,7 @@
#include <asm/mmu_context.h>
#include <asm/proto.h>
#include <mach_ipi.h>
-#include <mach_apic.h>
+#include <asm/genapic.h>
/*
* Some notes on x86 processor bugs affecting SMP operation:
*
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 3fed177..489fde9 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -65,7 +65,7 @@
#include <asm/uv/uv.h>
#include <linux/mc146818rtc.h>
-#include <mach_apic.h>
+#include <asm/genapic.h>
#include <smpboot_hooks.h>
#ifdef CONFIG_X86_32
diff --git a/arch/x86/kernel/tlb_uv.c b/arch/x86/kernel/tlb_uv.c
index 89fce1b..755ede0 100644
--- a/arch/x86/kernel/tlb_uv.c
+++ b/arch/x86/kernel/tlb_uv.c
@@ -20,7 +20,7 @@
#include <asm/tsc.h>
#include <asm/irq_vectors.h>
-#include <mach_apic.h>
+#include <asm/genapic.h>
static struct bau_control **uv_bau_table_bases __read_mostly;
static int uv_bau_retry_limit __read_mostly;
diff --git a/arch/x86/kernel/visws_quirks.c b/arch/x86/kernel/visws_quirks.c
index 2ed5bdf..3bd7f47 100644
--- a/arch/x86/kernel/visws_quirks.c
+++ b/arch/x86/kernel/visws_quirks.c
@@ -34,7 +34,7 @@
#include <mach_ipi.h>
-#include "mach_apic.h"
+#include <asm/genapic.h>
#include <linux/kernel_stat.h>
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index 07817b2..7d5123e 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -12,7 +12,7 @@
#include <linux/string.h>
#include <linux/smp.h>
#include <linux/init.h>
-#include <asm/mach-default/mach_apic.h>
+#include <asm/genapic.h>
#include <asm/mach-default/mach_ipi.h>
static void default_vector_allocation_domain(int cpu, struct cpumask *retmask)
diff --git a/arch/x86/mach-generic/probe.c b/arch/x86/mach-generic/probe.c
index ab68c6e..c03c722 100644
--- a/arch/x86/mach-generic/probe.c
+++ b/arch/x86/mach-generic/probe.c
@@ -154,8 +154,3 @@ int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
}
return 0;
}
-
-int hard_smp_processor_id(void)
-{
- return apic->get_apic_id(*(unsigned long *)(APIC_BASE+APIC_ID));
-}
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 076/114] x86, ES7000: Consolidate code
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (74 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 075/114] x86: remove mach_apic.h Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 077/114] x86, NUMAQ: " Ingo Molnar
` (39 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Move all ES7000 code into arch/x86/kernel/es7000_32.c.
With this it ceases to rely on any build-time subarch features.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/kernel/es7000_32.c | 428 ++++++++++++++++++++++++++++++++++++++++
arch/x86/mach-generic/Makefile | 1 -
arch/x86/mach-generic/es7000.c | 427 ---------------------------------------
3 files changed, 428 insertions(+), 428 deletions(-)
delete mode 100644 arch/x86/mach-generic/es7000.c
diff --git a/arch/x86/kernel/es7000_32.c b/arch/x86/kernel/es7000_32.c
index 8faea13..078364c 100644
--- a/arch/x86/kernel/es7000_32.c
+++ b/arch/x86/kernel/es7000_32.c
@@ -372,3 +372,431 @@ void __init es7000_enable_apic_mode(void)
mip_status);
}
}
+
+/*
+ * APIC driver for the Unisys ES7000 chipset.
+ */
+#define APIC_DEFINITION 1
+#include <linux/threads.h>
+#include <linux/cpumask.h>
+#include <asm/mpspec.h>
+#include <asm/genapic.h>
+#include <asm/fixmap.h>
+#include <asm/apicdef.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/init.h>
+#include <linux/acpi.h>
+#include <linux/smp.h>
+#include <asm/ipi.h>
+
+#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 APIC_DFR_VALUE (APIC_DFR_FLAT)
+
+extern void es7000_enable_apic_mode(void);
+extern int apic_version [MAX_APICS];
+extern u8 cpu_2_logical_apicid[];
+extern unsigned int boot_cpu_physical_apicid;
+
+extern int parse_unisys_oem (char *oemptr);
+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);
+
+#define apicid_cluster(apicid) (apicid & 0xF0)
+#define xapic_phys_to_log_apicid(cpu) per_cpu(x86_bios_cpu_apicid, cpu)
+
+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
+ * 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, } };
+}
+
+
+static void es7000_wait_for_init_deassert(atomic_t *deassert)
+{
+#ifndef CONFIG_ES7000_CLUSTERED_APIC
+ while (!atomic_read(deassert))
+ cpu_relax();
+#endif
+ return;
+}
+
+static unsigned int es7000_get_apic_id(unsigned long x)
+{
+ return (x >> 24) & 0xFF;
+}
+
+#ifdef CONFIG_ACPI
+static int es7000_check_dsdt(void)
+{
+ struct acpi_table_header header;
+
+ if (ACPI_SUCCESS(acpi_get_table_header(ACPI_SIG_DSDT, 0, &header)) &&
+ !strncmp(header.oem_id, "UNISYS", 6))
+ return 1;
+ return 0;
+}
+#endif
+
+static void es7000_send_IPI_mask(const struct cpumask *mask, int vector)
+{
+ default_send_IPI_mask_sequence(mask, vector);
+}
+
+static void es7000_send_IPI_allbutself(int vector)
+{
+ default_send_IPI_mask_allbutself(cpu_online_mask, vector);
+}
+
+static void es7000_send_IPI_all(int vector)
+{
+ es7000_send_IPI_mask(cpu_online_mask, vector);
+}
+
+static int es7000_apic_id_registered(void)
+{
+ return 1;
+}
+
+static const cpumask_t *target_cpus_cluster(void)
+{
+ return &CPU_MASK_ALL;
+}
+
+static const cpumask_t *es7000_target_cpus(void)
+{
+ return &cpumask_of_cpu(smp_processor_id());
+}
+
+static unsigned long
+es7000_check_apicid_used(physid_mask_t bitmap, int apicid)
+{
+ return 0;
+}
+static unsigned long es7000_check_apicid_present(int bit)
+{
+ return physid_isset(bit, phys_cpu_present_map);
+}
+
+static unsigned long calculate_ldr(int cpu)
+{
+ unsigned long id = xapic_phys_to_log_apicid(cpu);
+
+ return (SET_APIC_LOGICAL_ID(id));
+}
+
+/*
+ * Set up the logical destination ID.
+ *
+ * Intel recommends to set DFR, LdR and TPR before enabling
+ * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel
+ * document number 292116). So here it goes...
+ */
+static void es7000_init_apic_ldr_cluster(void)
+{
+ unsigned long val;
+ int cpu = smp_processor_id();
+
+ apic_write(APIC_DFR, APIC_DFR_VALUE_CLUSTER);
+ val = calculate_ldr(cpu);
+ apic_write(APIC_LDR, val);
+}
+
+static void es7000_init_apic_ldr(void)
+{
+ unsigned long val;
+ int cpu = smp_processor_id();
+
+ apic_write(APIC_DFR, APIC_DFR_VALUE);
+ val = calculate_ldr(cpu);
+ apic_write(APIC_LDR, val);
+}
+
+static 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",
+ (apic_version[apic] == 0x14) ?
+ "Physical Cluster" : "Logical Cluster",
+ nr_ioapics, cpus_addr(*es7000_target_cpus())[0]);
+}
+
+static int es7000_apicid_to_node(int logical_apicid)
+{
+ return 0;
+}
+
+
+static int es7000_cpu_present_to_apicid(int mps_cpu)
+{
+ if (!mps_cpu)
+ return boot_cpu_physical_apicid;
+ else if (mps_cpu < nr_cpu_ids)
+ return (int) per_cpu(x86_bios_cpu_apicid, mps_cpu);
+ else
+ return BAD_APICID;
+}
+
+static physid_mask_t es7000_apicid_to_cpu_present(int phys_apicid)
+{
+ static int id = 0;
+ physid_mask_t mask;
+
+ mask = physid_mask_of_physid(id);
+ ++id;
+
+ return mask;
+}
+
+/* Mapping from cpu number to logical apicid */
+static int es7000_cpu_to_logical_apicid(int cpu)
+{
+#ifdef CONFIG_SMP
+ if (cpu >= nr_cpu_ids)
+ return BAD_APICID;
+ return (int)cpu_2_logical_apicid[cpu];
+#else
+ return logical_smp_processor_id();
+#endif
+}
+
+static 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);
+}
+
+static int es7000_check_phys_apicid_present(int cpu_physical_apicid)
+{
+ boot_cpu_physical_apicid = read_apic_id();
+ return (1);
+}
+
+static unsigned int
+es7000_cpu_mask_to_apicid_cluster(const struct cpumask *cpumask)
+{
+ int cpus_found = 0;
+ int num_bits_set;
+ int apicid;
+ int cpu;
+
+ num_bits_set = cpumask_weight(cpumask);
+ /* Return id to all */
+ if (num_bits_set == nr_cpu_ids)
+ 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 = 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)) {
+ printk ("%s: Not a valid mask!\n", __func__);
+
+ return 0xFF;
+ }
+ apicid = new_apicid;
+ cpus_found++;
+ }
+ cpu++;
+ }
+ return apicid;
+}
+
+static unsigned int es7000_cpu_mask_to_apicid(const cpumask_t *cpumask)
+{
+ int cpus_found = 0;
+ 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 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 = es7000_cpu_to_logical_apicid(cpu);
+ 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)) {
+ printk ("%s: Not a valid mask!\n", __func__);
+
+ return es7000_cpu_to_logical_apicid(0);
+ }
+ apicid = new_apicid;
+ cpus_found++;
+ }
+ cpu++;
+ }
+ return apicid;
+}
+
+static 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;
+
+ if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC))
+ return apicid;
+
+ cpumask_and(cpumask, inmask, andmask);
+ cpumask_and(cpumask, cpumask, cpu_online_mask);
+ apicid = es7000_cpu_mask_to_apicid(cpumask);
+
+ free_cpumask_var(cpumask);
+
+ return apicid;
+}
+
+static int es7000_phys_pkg_id(int cpuid_apic, int index_msb)
+{
+ return cpuid_apic >> index_msb;
+}
+
+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->init_apic_ldr = es7000_init_apic_ldr_cluster;
+
+ apic->cpu_mask_to_apicid = es7000_cpu_mask_to_apicid_cluster;
+}
+
+static int probe_es7000(void)
+{
+ /* probed later in mptable/ACPI hooks */
+ return 0;
+}
+
+static __init int
+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);
+ }
+ return 0;
+}
+
+#ifdef CONFIG_ACPI
+/* Hook from generic ACPI tables.c */
+static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
+{
+ unsigned long oem_addr = 0;
+ int check_dsdt;
+ int ret = 0;
+
+ /* check dsdt at first to avoid clear fix_map for oem_addr */
+ check_dsdt = es7000_check_dsdt();
+
+ if (!find_unisys_acpi_oem_table(&oem_addr)) {
+ if (check_dsdt)
+ ret = parse_unisys_oem((char *)oem_addr);
+ else {
+ setup_unisys();
+ ret = 1;
+ }
+ /*
+ * we need to unmap it
+ */
+ unmap_unisys_acpi_oem_table(oem_addr);
+ }
+ return ret;
+}
+#else
+static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
+{
+ return 0;
+}
+#endif
+
+
+struct genapic apic_es7000 = {
+
+ .name = "es7000",
+ .probe = probe_es7000,
+ .acpi_madt_oem_check = es7000_acpi_madt_oem_check,
+ .apic_id_registered = es7000_apic_id_registered,
+
+ .irq_delivery_mode = dest_Fixed,
+ /* phys delivery to target CPUs: */
+ .irq_dest_mode = 0,
+
+ .target_cpus = es7000_target_cpus,
+ .disable_esr = 1,
+ .dest_logical = 0,
+ .check_apicid_used = es7000_check_apicid_used,
+ .check_apicid_present = es7000_check_apicid_present,
+
+ .vector_allocation_domain = es7000_vector_allocation_domain,
+ .init_apic_ldr = es7000_init_apic_ldr,
+
+ .ioapic_phys_id_map = es7000_ioapic_phys_id_map,
+ .setup_apic_routing = es7000_setup_apic_routing,
+ .multi_timer_check = NULL,
+ .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 = es7000_apicid_to_cpu_present,
+ .setup_portio_remap = NULL,
+ .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 = es7000_mps_oem_check,
+
+ .get_apic_id = es7000_get_apic_id,
+ .set_apic_id = NULL,
+ .apic_id_mask = 0xFF << 24,
+
+ .cpu_mask_to_apicid = es7000_cpu_mask_to_apicid,
+ .cpu_mask_to_apicid_and = es7000_cpu_mask_to_apicid_and,
+
+ .send_IPI_mask = es7000_send_IPI_mask,
+ .send_IPI_mask_allbutself = NULL,
+ .send_IPI_allbutself = es7000_send_IPI_allbutself,
+ .send_IPI_all = es7000_send_IPI_all,
+ .send_IPI_self = NULL,
+
+ .wakeup_cpu = NULL,
+
+ .trampoline_phys_low = 0x467,
+ .trampoline_phys_high = 0x469,
+
+ .wait_for_init_deassert = es7000_wait_for_init_deassert,
+
+ /* Nothing to do for most platforms, since cleared by the INIT cycle: */
+ .smp_callin_clear_local_apic = NULL,
+ .store_NMI_vector = NULL,
+ .inquire_remote_apic = default_inquire_remote_apic,
+};
diff --git a/arch/x86/mach-generic/Makefile b/arch/x86/mach-generic/Makefile
index 78ab573..05e47ac 100644
--- a/arch/x86/mach-generic/Makefile
+++ b/arch/x86/mach-generic/Makefile
@@ -7,4 +7,3 @@ EXTRA_CFLAGS := -Iarch/x86/kernel
obj-y := probe.o default.o
obj-$(CONFIG_X86_NUMAQ) += numaq.o
obj-$(CONFIG_X86_BIGSMP) += bigsmp.o
-obj-$(CONFIG_X86_ES7000) += es7000.o
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
deleted file mode 100644
index bb11166..0000000
--- a/arch/x86/mach-generic/es7000.c
+++ /dev/null
@@ -1,427 +0,0 @@
-/*
- * APIC driver for the Unisys ES7000 chipset.
- */
-#define APIC_DEFINITION 1
-#include <linux/threads.h>
-#include <linux/cpumask.h>
-#include <asm/mpspec.h>
-#include <asm/genapic.h>
-#include <asm/fixmap.h>
-#include <asm/apicdef.h>
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/init.h>
-#include <linux/acpi.h>
-#include <linux/smp.h>
-#include <asm/ipi.h>
-
-#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 APIC_DFR_VALUE (APIC_DFR_FLAT)
-
-extern void es7000_enable_apic_mode(void);
-extern int apic_version [MAX_APICS];
-extern u8 cpu_2_logical_apicid[];
-extern unsigned int boot_cpu_physical_apicid;
-
-extern int parse_unisys_oem (char *oemptr);
-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);
-
-#define apicid_cluster(apicid) (apicid & 0xF0)
-#define xapic_phys_to_log_apicid(cpu) per_cpu(x86_bios_cpu_apicid, cpu)
-
-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
- * 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, } };
-}
-
-
-static void es7000_wait_for_init_deassert(atomic_t *deassert)
-{
-#ifndef CONFIG_ES7000_CLUSTERED_APIC
- while (!atomic_read(deassert))
- cpu_relax();
-#endif
- return;
-}
-
-static unsigned int es7000_get_apic_id(unsigned long x)
-{
- return (x >> 24) & 0xFF;
-}
-
-#ifdef CONFIG_ACPI
-static int es7000_check_dsdt(void)
-{
- struct acpi_table_header header;
-
- if (ACPI_SUCCESS(acpi_get_table_header(ACPI_SIG_DSDT, 0, &header)) &&
- !strncmp(header.oem_id, "UNISYS", 6))
- return 1;
- return 0;
-}
-#endif
-
-static void es7000_send_IPI_mask(const struct cpumask *mask, int vector)
-{
- default_send_IPI_mask_sequence(mask, vector);
-}
-
-static void es7000_send_IPI_allbutself(int vector)
-{
- default_send_IPI_mask_allbutself(cpu_online_mask, vector);
-}
-
-static void es7000_send_IPI_all(int vector)
-{
- es7000_send_IPI_mask(cpu_online_mask, vector);
-}
-
-static int es7000_apic_id_registered(void)
-{
- return 1;
-}
-
-static const cpumask_t *target_cpus_cluster(void)
-{
- return &CPU_MASK_ALL;
-}
-
-static const cpumask_t *es7000_target_cpus(void)
-{
- return &cpumask_of_cpu(smp_processor_id());
-}
-
-static unsigned long
-es7000_check_apicid_used(physid_mask_t bitmap, int apicid)
-{
- return 0;
-}
-static unsigned long es7000_check_apicid_present(int bit)
-{
- return physid_isset(bit, phys_cpu_present_map);
-}
-
-static unsigned long calculate_ldr(int cpu)
-{
- unsigned long id = xapic_phys_to_log_apicid(cpu);
-
- return (SET_APIC_LOGICAL_ID(id));
-}
-
-/*
- * Set up the logical destination ID.
- *
- * Intel recommends to set DFR, LdR and TPR before enabling
- * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel
- * document number 292116). So here it goes...
- */
-static void es7000_init_apic_ldr_cluster(void)
-{
- unsigned long val;
- int cpu = smp_processor_id();
-
- apic_write(APIC_DFR, APIC_DFR_VALUE_CLUSTER);
- val = calculate_ldr(cpu);
- apic_write(APIC_LDR, val);
-}
-
-static void es7000_init_apic_ldr(void)
-{
- unsigned long val;
- int cpu = smp_processor_id();
-
- apic_write(APIC_DFR, APIC_DFR_VALUE);
- val = calculate_ldr(cpu);
- apic_write(APIC_LDR, val);
-}
-
-static 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",
- (apic_version[apic] == 0x14) ?
- "Physical Cluster" : "Logical Cluster",
- nr_ioapics, cpus_addr(*es7000_target_cpus())[0]);
-}
-
-static int es7000_apicid_to_node(int logical_apicid)
-{
- return 0;
-}
-
-
-static int es7000_cpu_present_to_apicid(int mps_cpu)
-{
- if (!mps_cpu)
- return boot_cpu_physical_apicid;
- else if (mps_cpu < nr_cpu_ids)
- return (int) per_cpu(x86_bios_cpu_apicid, mps_cpu);
- else
- return BAD_APICID;
-}
-
-static physid_mask_t es7000_apicid_to_cpu_present(int phys_apicid)
-{
- static int id = 0;
- physid_mask_t mask;
-
- mask = physid_mask_of_physid(id);
- ++id;
-
- return mask;
-}
-
-/* Mapping from cpu number to logical apicid */
-static int es7000_cpu_to_logical_apicid(int cpu)
-{
-#ifdef CONFIG_SMP
- if (cpu >= nr_cpu_ids)
- return BAD_APICID;
- return (int)cpu_2_logical_apicid[cpu];
-#else
- return logical_smp_processor_id();
-#endif
-}
-
-static 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);
-}
-
-static int es7000_check_phys_apicid_present(int cpu_physical_apicid)
-{
- boot_cpu_physical_apicid = read_apic_id();
- return (1);
-}
-
-static unsigned int
-es7000_cpu_mask_to_apicid_cluster(const struct cpumask *cpumask)
-{
- int cpus_found = 0;
- int num_bits_set;
- int apicid;
- int cpu;
-
- num_bits_set = cpumask_weight(cpumask);
- /* Return id to all */
- if (num_bits_set == nr_cpu_ids)
- 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 = 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)) {
- printk ("%s: Not a valid mask!\n", __func__);
-
- return 0xFF;
- }
- apicid = new_apicid;
- cpus_found++;
- }
- cpu++;
- }
- return apicid;
-}
-
-static unsigned int es7000_cpu_mask_to_apicid(const cpumask_t *cpumask)
-{
- int cpus_found = 0;
- 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 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 = es7000_cpu_to_logical_apicid(cpu);
- 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)) {
- printk ("%s: Not a valid mask!\n", __func__);
-
- return es7000_cpu_to_logical_apicid(0);
- }
- apicid = new_apicid;
- cpus_found++;
- }
- cpu++;
- }
- return apicid;
-}
-
-static 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;
-
- if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC))
- return apicid;
-
- cpumask_and(cpumask, inmask, andmask);
- cpumask_and(cpumask, cpumask, cpu_online_mask);
- apicid = es7000_cpu_mask_to_apicid(cpumask);
-
- free_cpumask_var(cpumask);
-
- return apicid;
-}
-
-static int es7000_phys_pkg_id(int cpuid_apic, int index_msb)
-{
- return cpuid_apic >> index_msb;
-}
-
-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->init_apic_ldr = es7000_init_apic_ldr_cluster;
-
- apic->cpu_mask_to_apicid = es7000_cpu_mask_to_apicid_cluster;
-}
-
-static int probe_es7000(void)
-{
- /* probed later in mptable/ACPI hooks */
- return 0;
-}
-
-static __init int
-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);
- }
- return 0;
-}
-
-#ifdef CONFIG_ACPI
-/* Hook from generic ACPI tables.c */
-static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
-{
- unsigned long oem_addr = 0;
- int check_dsdt;
- int ret = 0;
-
- /* check dsdt at first to avoid clear fix_map for oem_addr */
- check_dsdt = es7000_check_dsdt();
-
- if (!find_unisys_acpi_oem_table(&oem_addr)) {
- if (check_dsdt)
- ret = parse_unisys_oem((char *)oem_addr);
- else {
- setup_unisys();
- ret = 1;
- }
- /*
- * we need to unmap it
- */
- unmap_unisys_acpi_oem_table(oem_addr);
- }
- return ret;
-}
-#else
-static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
-{
- return 0;
-}
-#endif
-
-
-struct genapic apic_es7000 = {
-
- .name = "es7000",
- .probe = probe_es7000,
- .acpi_madt_oem_check = es7000_acpi_madt_oem_check,
- .apic_id_registered = es7000_apic_id_registered,
-
- .irq_delivery_mode = dest_Fixed,
- /* phys delivery to target CPUs: */
- .irq_dest_mode = 0,
-
- .target_cpus = es7000_target_cpus,
- .disable_esr = 1,
- .dest_logical = 0,
- .check_apicid_used = es7000_check_apicid_used,
- .check_apicid_present = es7000_check_apicid_present,
-
- .vector_allocation_domain = es7000_vector_allocation_domain,
- .init_apic_ldr = es7000_init_apic_ldr,
-
- .ioapic_phys_id_map = es7000_ioapic_phys_id_map,
- .setup_apic_routing = es7000_setup_apic_routing,
- .multi_timer_check = NULL,
- .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 = es7000_apicid_to_cpu_present,
- .setup_portio_remap = NULL,
- .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 = es7000_mps_oem_check,
-
- .get_apic_id = es7000_get_apic_id,
- .set_apic_id = NULL,
- .apic_id_mask = 0xFF << 24,
-
- .cpu_mask_to_apicid = es7000_cpu_mask_to_apicid,
- .cpu_mask_to_apicid_and = es7000_cpu_mask_to_apicid_and,
-
- .send_IPI_mask = es7000_send_IPI_mask,
- .send_IPI_mask_allbutself = NULL,
- .send_IPI_allbutself = es7000_send_IPI_allbutself,
- .send_IPI_all = es7000_send_IPI_all,
- .send_IPI_self = NULL,
-
- .wakeup_cpu = NULL,
-
- .trampoline_phys_low = 0x467,
- .trampoline_phys_high = 0x469,
-
- .wait_for_init_deassert = es7000_wait_for_init_deassert,
-
- /* Nothing to do for most platforms, since cleared by the INIT cycle: */
- .smp_callin_clear_local_apic = NULL,
- .store_NMI_vector = NULL,
- .inquire_remote_apic = default_inquire_remote_apic,
-};
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 077/114] x86, NUMAQ: Consolidate code
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (75 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 076/114] x86, ES7000: Consolidate code Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 078/114] x86, bigsmp: consolidate code Ingo Molnar
` (38 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Move all NUMAQ code into arch/x86/kernel/numaq.c.
With this it ceases to rely on any build-time subarch features.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/kernel/numaq_32.c | 278 ++++++++++++++++++++++++++++++++++++++++
arch/x86/mach-generic/Makefile | 1 -
arch/x86/mach-generic/numaq.c | 277 ---------------------------------------
3 files changed, 278 insertions(+), 278 deletions(-)
delete mode 100644 arch/x86/mach-generic/numaq.c
diff --git a/arch/x86/kernel/numaq_32.c b/arch/x86/kernel/numaq_32.c
index 3928280..83bb055 100644
--- a/arch/x86/kernel/numaq_32.c
+++ b/arch/x86/kernel/numaq_32.c
@@ -291,3 +291,281 @@ int __init get_memcfg_numaq(void)
smp_dump_qct();
return 1;
}
+
+/*
+ * APIC driver for the IBM NUMAQ chipset.
+ */
+#define APIC_DEFINITION 1
+#include <linux/threads.h>
+#include <linux/cpumask.h>
+#include <asm/mpspec.h>
+#include <asm/genapic.h>
+#include <asm/fixmap.h>
+#include <asm/apicdef.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/init.h>
+#include <linux/numa.h>
+#include <linux/smp.h>
+#include <asm/numaq.h>
+#include <asm/io.h>
+#include <linux/mmzone.h>
+#include <linux/nodemask.h>
+
+#define NUMAQ_APIC_DFR_VALUE (APIC_DFR_CLUSTER)
+
+static inline unsigned int numaq_get_apic_id(unsigned long x)
+{
+ return (x >> 24) & 0x0F;
+}
+
+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 numaq_send_IPI_mask(const struct cpumask *mask, int vector)
+{
+ default_send_IPI_mask_sequence(mask, vector);
+}
+
+static inline void numaq_send_IPI_allbutself(int vector)
+{
+ default_send_IPI_mask_allbutself(cpu_online_mask, vector);
+}
+
+static inline void numaq_send_IPI_all(int vector)
+{
+ numaq_send_IPI_mask(cpu_online_mask, vector);
+}
+
+extern void numaq_mps_oem_check(struct mpc_table *, char *, char *);
+
+#define NUMAQ_TRAMPOLINE_PHYS_LOW (0x8)
+#define NUMAQ_TRAMPOLINE_PHYS_HIGH (0xa)
+
+/*
+ * Because we use NMIs rather than the INIT-STARTUP sequence to
+ * bootstrap the CPUs, the APIC may be in a weird state. Kick it:
+ */
+static inline void numaq_smp_callin_clear_local_apic(void)
+{
+ clear_local_APIC();
+}
+
+static inline void
+numaq_store_NMI_vector(unsigned short *high, unsigned short *low)
+{
+ printk("Storing NMI vector\n");
+ *high =
+ *((volatile unsigned short *)phys_to_virt(NUMAQ_TRAMPOLINE_PHYS_HIGH));
+ *low =
+ *((volatile unsigned short *)phys_to_virt(NUMAQ_TRAMPOLINE_PHYS_LOW));
+}
+
+static inline const cpumask_t *numaq_target_cpus(void)
+{
+ return &CPU_MASK_ALL;
+}
+
+static inline unsigned long
+numaq_check_apicid_used(physid_mask_t bitmap, int apicid)
+{
+ return physid_isset(apicid, bitmap);
+}
+
+static inline unsigned long numaq_check_apicid_present(int bit)
+{
+ return physid_isset(bit, phys_cpu_present_map);
+}
+
+#define apicid_cluster(apicid) (apicid & 0xF0)
+
+static inline int numaq_apic_id_registered(void)
+{
+ return 1;
+}
+
+static inline void numaq_init_apic_ldr(void)
+{
+ /* Already done in NUMA-Q firmware */
+}
+
+static inline void numaq_setup_apic_routing(void)
+{
+ printk("Enabling APIC mode: %s. Using %d I/O APICs\n",
+ "NUMA-Q", nr_ioapics);
+}
+
+/*
+ * Skip adding the timer int on secondary nodes, which causes
+ * a small but painful rift in the time-space continuum.
+ */
+static inline int numaq_multi_timer_check(int apic, int irq)
+{
+ return apic != 0 && irq == 0;
+}
+
+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);
+}
+
+/* Mapping from cpu number to logical apicid */
+extern u8 cpu_2_logical_apicid[];
+
+static inline int numaq_cpu_to_logical_apicid(int cpu)
+{
+ if (cpu >= nr_cpu_ids)
+ return BAD_APICID;
+ return (int)cpu_2_logical_apicid[cpu];
+}
+
+/*
+ * Supporting over 60 cpus on NUMA-Q requires a locality-dependent
+ * cpu to APIC ID relation to properly interact with the intelligent
+ * mode of the cluster controller.
+ */
+static inline int numaq_cpu_present_to_apicid(int mps_cpu)
+{
+ if (mps_cpu < 60)
+ return ((mps_cpu >> 2) << 4) | (1 << (mps_cpu & 0x3));
+ else
+ return BAD_APICID;
+}
+
+static inline int numaq_apicid_to_node(int logical_apicid)
+{
+ return logical_apicid >> 4;
+}
+
+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);
+
+ return physid_mask_of_physid(cpu + 4*node);
+}
+
+extern void *xquad_portio;
+
+static inline int numaq_check_phys_apicid_present(int boot_cpu_physical_apicid)
+{
+ return 1;
+}
+
+/*
+ * We use physical apicids here, not logical, so just return the default
+ * physical broadcast to stop people from breaking us
+ */
+static inline unsigned int numaq_cpu_mask_to_apicid(const cpumask_t *cpumask)
+{
+ return 0x0F;
+}
+
+static inline unsigned int
+numaq_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
+ const struct cpumask *andmask)
+{
+ return 0x0F;
+}
+
+/* No NUMA-Q box has a HT CPU, but it can't hurt to use the default code. */
+static inline int numaq_phys_pkg_id(int cpuid_apic, int index_msb)
+{
+ return cpuid_apic >> index_msb;
+}
+static int __numaq_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
+{
+ numaq_mps_oem_check(mpc, oem, productid);
+ return found_numaq;
+}
+
+static int probe_numaq(void)
+{
+ /* already know from get_memcfg_numaq() */
+ return found_numaq;
+}
+
+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
+ * 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, } };
+}
+
+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",
+ .probe = probe_numaq,
+ .acpi_madt_oem_check = NULL,
+ .apic_id_registered = numaq_apic_id_registered,
+
+ .irq_delivery_mode = dest_LowestPrio,
+ /* physical delivery on LOCAL quad: */
+ .irq_dest_mode = 0,
+
+ .target_cpus = numaq_target_cpus,
+ .disable_esr = 1,
+ .dest_logical = APIC_DEST_LOGICAL,
+ .check_apicid_used = numaq_check_apicid_used,
+ .check_apicid_present = numaq_check_apicid_present,
+
+ .vector_allocation_domain = numaq_vector_allocation_domain,
+ .init_apic_ldr = numaq_init_apic_ldr,
+
+ .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 = 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 = numaq_apicid_to_cpu_present,
+ .setup_portio_remap = numaq_setup_portio_remap,
+ .check_phys_apicid_present = numaq_check_phys_apicid_present,
+ .enable_apic_mode = NULL,
+ .phys_pkg_id = numaq_phys_pkg_id,
+ .mps_oem_check = __numaq_mps_oem_check,
+
+ .get_apic_id = numaq_get_apic_id,
+ .set_apic_id = NULL,
+ .apic_id_mask = 0x0F << 24,
+
+ .cpu_mask_to_apicid = numaq_cpu_mask_to_apicid,
+ .cpu_mask_to_apicid_and = numaq_cpu_mask_to_apicid_and,
+
+ .send_IPI_mask = numaq_send_IPI_mask,
+ .send_IPI_mask_allbutself = NULL,
+ .send_IPI_allbutself = numaq_send_IPI_allbutself,
+ .send_IPI_all = numaq_send_IPI_all,
+ .send_IPI_self = NULL,
+
+ .wakeup_cpu = NULL,
+ .trampoline_phys_low = NUMAQ_TRAMPOLINE_PHYS_LOW,
+ .trampoline_phys_high = NUMAQ_TRAMPOLINE_PHYS_HIGH,
+
+ /* We don't do anything here because we use NMI's to boot instead */
+ .wait_for_init_deassert = NULL,
+
+ .smp_callin_clear_local_apic = numaq_smp_callin_clear_local_apic,
+ .store_NMI_vector = numaq_store_NMI_vector,
+ .inquire_remote_apic = NULL,
+};
diff --git a/arch/x86/mach-generic/Makefile b/arch/x86/mach-generic/Makefile
index 05e47ac..4ede08d 100644
--- a/arch/x86/mach-generic/Makefile
+++ b/arch/x86/mach-generic/Makefile
@@ -5,5 +5,4 @@
EXTRA_CFLAGS := -Iarch/x86/kernel
obj-y := probe.o default.o
-obj-$(CONFIG_X86_NUMAQ) += numaq.o
obj-$(CONFIG_X86_BIGSMP) += bigsmp.o
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
deleted file mode 100644
index c221cfb..0000000
--- a/arch/x86/mach-generic/numaq.c
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * APIC driver for the IBM NUMAQ chipset.
- */
-#define APIC_DEFINITION 1
-#include <linux/threads.h>
-#include <linux/cpumask.h>
-#include <asm/mpspec.h>
-#include <asm/genapic.h>
-#include <asm/fixmap.h>
-#include <asm/apicdef.h>
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/init.h>
-#include <linux/numa.h>
-#include <linux/smp.h>
-#include <asm/numaq.h>
-#include <asm/io.h>
-#include <linux/mmzone.h>
-#include <linux/nodemask.h>
-
-#define NUMAQ_APIC_DFR_VALUE (APIC_DFR_CLUSTER)
-
-static inline unsigned int numaq_get_apic_id(unsigned long x)
-{
- return (x >> 24) & 0x0F;
-}
-
-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 numaq_send_IPI_mask(const struct cpumask *mask, int vector)
-{
- default_send_IPI_mask_sequence(mask, vector);
-}
-
-static inline void numaq_send_IPI_allbutself(int vector)
-{
- default_send_IPI_mask_allbutself(cpu_online_mask, vector);
-}
-
-static inline void numaq_send_IPI_all(int vector)
-{
- numaq_send_IPI_mask(cpu_online_mask, vector);
-}
-
-extern void numaq_mps_oem_check(struct mpc_table *, char *, char *);
-
-#define NUMAQ_TRAMPOLINE_PHYS_LOW (0x8)
-#define NUMAQ_TRAMPOLINE_PHYS_HIGH (0xa)
-
-/*
- * Because we use NMIs rather than the INIT-STARTUP sequence to
- * bootstrap the CPUs, the APIC may be in a weird state. Kick it:
- */
-static inline void numaq_smp_callin_clear_local_apic(void)
-{
- clear_local_APIC();
-}
-
-static inline void
-numaq_store_NMI_vector(unsigned short *high, unsigned short *low)
-{
- printk("Storing NMI vector\n");
- *high =
- *((volatile unsigned short *)phys_to_virt(NUMAQ_TRAMPOLINE_PHYS_HIGH));
- *low =
- *((volatile unsigned short *)phys_to_virt(NUMAQ_TRAMPOLINE_PHYS_LOW));
-}
-
-static inline const cpumask_t *numaq_target_cpus(void)
-{
- return &CPU_MASK_ALL;
-}
-
-static inline unsigned long
-numaq_check_apicid_used(physid_mask_t bitmap, int apicid)
-{
- return physid_isset(apicid, bitmap);
-}
-
-static inline unsigned long numaq_check_apicid_present(int bit)
-{
- return physid_isset(bit, phys_cpu_present_map);
-}
-
-#define apicid_cluster(apicid) (apicid & 0xF0)
-
-static inline int numaq_apic_id_registered(void)
-{
- return 1;
-}
-
-static inline void numaq_init_apic_ldr(void)
-{
- /* Already done in NUMA-Q firmware */
-}
-
-static inline void numaq_setup_apic_routing(void)
-{
- printk("Enabling APIC mode: %s. Using %d I/O APICs\n",
- "NUMA-Q", nr_ioapics);
-}
-
-/*
- * Skip adding the timer int on secondary nodes, which causes
- * a small but painful rift in the time-space continuum.
- */
-static inline int numaq_multi_timer_check(int apic, int irq)
-{
- return apic != 0 && irq == 0;
-}
-
-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);
-}
-
-/* Mapping from cpu number to logical apicid */
-extern u8 cpu_2_logical_apicid[];
-
-static inline int numaq_cpu_to_logical_apicid(int cpu)
-{
- if (cpu >= nr_cpu_ids)
- return BAD_APICID;
- return (int)cpu_2_logical_apicid[cpu];
-}
-
-/*
- * Supporting over 60 cpus on NUMA-Q requires a locality-dependent
- * cpu to APIC ID relation to properly interact with the intelligent
- * mode of the cluster controller.
- */
-static inline int numaq_cpu_present_to_apicid(int mps_cpu)
-{
- if (mps_cpu < 60)
- return ((mps_cpu >> 2) << 4) | (1 << (mps_cpu & 0x3));
- else
- return BAD_APICID;
-}
-
-static inline int numaq_apicid_to_node(int logical_apicid)
-{
- return logical_apicid >> 4;
-}
-
-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);
-
- return physid_mask_of_physid(cpu + 4*node);
-}
-
-extern void *xquad_portio;
-
-static inline int numaq_check_phys_apicid_present(int boot_cpu_physical_apicid)
-{
- return 1;
-}
-
-/*
- * We use physical apicids here, not logical, so just return the default
- * physical broadcast to stop people from breaking us
- */
-static inline unsigned int numaq_cpu_mask_to_apicid(const cpumask_t *cpumask)
-{
- return 0x0F;
-}
-
-static inline unsigned int
-numaq_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
- const struct cpumask *andmask)
-{
- return 0x0F;
-}
-
-/* No NUMA-Q box has a HT CPU, but it can't hurt to use the default code. */
-static inline int numaq_phys_pkg_id(int cpuid_apic, int index_msb)
-{
- return cpuid_apic >> index_msb;
-}
-static int __numaq_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
-{
- numaq_mps_oem_check(mpc, oem, productid);
- return found_numaq;
-}
-
-static int probe_numaq(void)
-{
- /* already know from get_memcfg_numaq() */
- return found_numaq;
-}
-
-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
- * 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, } };
-}
-
-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",
- .probe = probe_numaq,
- .acpi_madt_oem_check = NULL,
- .apic_id_registered = numaq_apic_id_registered,
-
- .irq_delivery_mode = dest_LowestPrio,
- /* physical delivery on LOCAL quad: */
- .irq_dest_mode = 0,
-
- .target_cpus = numaq_target_cpus,
- .disable_esr = 1,
- .dest_logical = APIC_DEST_LOGICAL,
- .check_apicid_used = numaq_check_apicid_used,
- .check_apicid_present = numaq_check_apicid_present,
-
- .vector_allocation_domain = numaq_vector_allocation_domain,
- .init_apic_ldr = numaq_init_apic_ldr,
-
- .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 = 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 = numaq_apicid_to_cpu_present,
- .setup_portio_remap = numaq_setup_portio_remap,
- .check_phys_apicid_present = numaq_check_phys_apicid_present,
- .enable_apic_mode = NULL,
- .phys_pkg_id = numaq_phys_pkg_id,
- .mps_oem_check = __numaq_mps_oem_check,
-
- .get_apic_id = numaq_get_apic_id,
- .set_apic_id = NULL,
- .apic_id_mask = 0x0F << 24,
-
- .cpu_mask_to_apicid = numaq_cpu_mask_to_apicid,
- .cpu_mask_to_apicid_and = numaq_cpu_mask_to_apicid_and,
-
- .send_IPI_mask = numaq_send_IPI_mask,
- .send_IPI_mask_allbutself = NULL,
- .send_IPI_allbutself = numaq_send_IPI_allbutself,
- .send_IPI_all = numaq_send_IPI_all,
- .send_IPI_self = NULL,
-
- .wakeup_cpu = NULL,
- .trampoline_phys_low = NUMAQ_TRAMPOLINE_PHYS_LOW,
- .trampoline_phys_high = NUMAQ_TRAMPOLINE_PHYS_HIGH,
-
- /* We don't do anything here because we use NMI's to boot instead */
- .wait_for_init_deassert = NULL,
-
- .smp_callin_clear_local_apic = numaq_smp_callin_clear_local_apic,
- .store_NMI_vector = numaq_store_NMI_vector,
- .inquire_remote_apic = NULL,
-};
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 078/114] x86, bigsmp: consolidate code
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (76 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 077/114] x86, NUMAQ: " Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 079/114] x86, bigsmp: consolidate header code Ingo Molnar
` (37 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Move all code to arch/x86/kernel/bigsmp_32.c.
With this it ceases to rely on any build-time subarch features.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/kernel/Makefile | 1 +
.../{mach-generic/bigsmp.c => kernel/bigsmp_32.c} | 0
arch/x86/mach-generic/Makefile | 1 -
3 files changed, 1 insertions(+), 1 deletions(-)
rename arch/x86/{mach-generic/bigsmp.c => kernel/bigsmp_32.c} (100%)
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index 37fa30b..ad6df80 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -71,6 +71,7 @@ obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
obj-$(CONFIG_KEXEC) += machine_kexec_$(BITS).o
obj-$(CONFIG_KEXEC) += relocate_kernel_$(BITS).o crash.o
obj-$(CONFIG_CRASH_DUMP) += crash_dump_$(BITS).o
+obj-$(CONFIG_X86_BIGSMP) += bigsmp_32.o
obj-$(CONFIG_X86_NUMAQ) += numaq_32.o
obj-$(CONFIG_X86_ES7000) += es7000_32.o
obj-$(CONFIG_X86_SUMMIT_NUMA) += summit_32.o
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/kernel/bigsmp_32.c
similarity index 100%
rename from arch/x86/mach-generic/bigsmp.c
rename to arch/x86/kernel/bigsmp_32.c
diff --git a/arch/x86/mach-generic/Makefile b/arch/x86/mach-generic/Makefile
index 4ede08d..05e4a7c 100644
--- a/arch/x86/mach-generic/Makefile
+++ b/arch/x86/mach-generic/Makefile
@@ -5,4 +5,3 @@
EXTRA_CFLAGS := -Iarch/x86/kernel
obj-y := probe.o default.o
-obj-$(CONFIG_X86_BIGSMP) += bigsmp.o
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 079/114] x86, bigsmp: consolidate header code
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (77 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 078/114] x86, bigsmp: consolidate code Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 080/114] x86, smp: remove mach_ipi.h Ingo Molnar
` (36 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Move all the asm/bigsmp/*.h definitions into bigsmp_32.c.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/kernel/bigsmp_32.c | 163 +++++++++++++++++++++++++++++++++++++++++-
1 files changed, 159 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kernel/bigsmp_32.c b/arch/x86/kernel/bigsmp_32.c
index 626f45c..b1f9193 100644
--- a/arch/x86/kernel/bigsmp_32.c
+++ b/arch/x86/kernel/bigsmp_32.c
@@ -12,10 +12,165 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/dmi.h>
-#include <asm/bigsmp/apicdef.h>
#include <linux/smp.h>
-#include <asm/bigsmp/apic.h>
-#include <asm/bigsmp/ipi.h>
+
+
+static inline unsigned bigsmp_get_apic_id(unsigned long x)
+{
+ return (x >> 24) & 0xFF;
+}
+
+#define xapic_phys_to_log_apicid(cpu) (per_cpu(x86_bios_cpu_apicid, cpu))
+
+static inline int bigsmp_apic_id_registered(void)
+{
+ return 1;
+}
+
+static inline const cpumask_t *bigsmp_target_cpus(void)
+{
+#ifdef CONFIG_SMP
+ return &cpu_online_map;
+#else
+ return &cpumask_of_cpu(0);
+#endif
+}
+
+#define APIC_DFR_VALUE (APIC_DFR_FLAT)
+
+static inline unsigned long
+bigsmp_check_apicid_used(physid_mask_t bitmap, int apicid)
+{
+ return 0;
+}
+
+static inline unsigned long bigsmp_check_apicid_present(int bit)
+{
+ return 1;
+}
+
+static inline unsigned long calculate_ldr(int cpu)
+{
+ unsigned long val, id;
+ val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
+ id = xapic_phys_to_log_apicid(cpu);
+ val |= SET_APIC_LOGICAL_ID(id);
+ return val;
+}
+
+/*
+ * Set up the logical destination ID.
+ *
+ * Intel recommends to set DFR, LDR and TPR before enabling
+ * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel
+ * document number 292116). So here it goes...
+ */
+static inline void bigsmp_init_apic_ldr(void)
+{
+ unsigned long val;
+ int cpu = smp_processor_id();
+
+ apic_write(APIC_DFR, APIC_DFR_VALUE);
+ val = calculate_ldr(cpu);
+ apic_write(APIC_LDR, val);
+}
+
+static inline void bigsmp_setup_apic_routing(void)
+{
+ printk("Enabling APIC mode: %s. Using %d I/O APICs\n",
+ "Physflat", nr_ioapics);
+}
+
+static inline int bigsmp_apicid_to_node(int logical_apicid)
+{
+ return apicid_2_node[hard_smp_processor_id()];
+}
+
+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);
+
+ return BAD_APICID;
+}
+
+static inline physid_mask_t bigsmp_apicid_to_cpu_present(int phys_apicid)
+{
+ return physid_mask_of_physid(phys_apicid);
+}
+
+extern u8 cpu_2_logical_apicid[];
+/* Mapping from cpu number to logical apicid */
+static inline int bigsmp_cpu_to_logical_apicid(int cpu)
+{
+ if (cpu >= nr_cpu_ids)
+ return BAD_APICID;
+ return cpu_physical_id(cpu);
+}
+
+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);
+}
+
+static inline void bigsmp_setup_portio_remap(void)
+{
+}
+
+static inline int bigsmp_check_phys_apicid_present(int boot_cpu_physical_apicid)
+{
+ return 1;
+}
+
+/* As we are using single CPU as destination, pick only one CPU here */
+static inline unsigned int bigsmp_cpu_mask_to_apicid(const cpumask_t *cpumask)
+{
+ return bigsmp_cpu_to_logical_apicid(first_cpu(*cpumask));
+}
+
+static inline unsigned int
+bigsmp_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
+ const struct cpumask *andmask)
+{
+ int cpu;
+
+ /*
+ * 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) {
+ if (cpumask_test_cpu(cpu, cpu_online_mask))
+ break;
+ }
+ if (cpu < nr_cpu_ids)
+ return bigsmp_cpu_to_logical_apicid(cpu);
+
+ return BAD_APICID;
+}
+
+static inline int bigsmp_phys_pkg_id(int cpuid_apic, int index_msb)
+{
+ return cpuid_apic >> index_msb;
+}
+
+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 bigsmp_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)
+{
+ bigsmp_send_IPI_mask(cpu_online_mask, vector);
+}
static int dmi_bigsmp; /* can be set by dmi scanners */
@@ -95,7 +250,7 @@ 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 = default_send_IPI_mask,
+ .send_IPI_mask = bigsmp_send_IPI_mask,
.send_IPI_mask_allbutself = NULL,
.send_IPI_allbutself = bigsmp_send_IPI_allbutself,
.send_IPI_all = bigsmp_send_IPI_all,
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 080/114] x86, smp: remove mach_ipi.h
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (78 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 079/114] x86, bigsmp: consolidate header code Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 081/114] x86: remove subarchitecture support code Ingo Molnar
` (35 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Move mach_ipi.h definitions into genapic.h.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/genapic.h | 1 +
arch/x86/include/asm/ipi.h | 61 +++++++++++++++++++++-
arch/x86/include/asm/mach-default/mach_ipi.h | 58 --------------------
arch/x86/include/asm/mach-generic/gpio.h | 15 -----
arch/x86/include/asm/mach-generic/mach_ipi.h | 6 --
arch/x86/include/asm/mach-generic/mach_wakecpu.h | 4 --
arch/x86/kernel/apic.c | 2 +-
arch/x86/kernel/crash.c | 2 +-
arch/x86/kernel/io_apic.c | 1 -
arch/x86/kernel/ipi.c | 1 -
arch/x86/kernel/kgdb.c | 2 +-
arch/x86/kernel/reboot.c | 2 +-
arch/x86/kernel/smp.c | 1 -
arch/x86/kernel/visws_quirks.c | 2 +-
arch/x86/mach-default/setup.c | 2 +-
arch/x86/mach-generic/default.c | 2 +-
arch/x86/mm/tlb.c | 2 +-
17 files changed, 68 insertions(+), 96 deletions(-)
delete mode 100644 arch/x86/include/asm/mach-default/mach_ipi.h
delete mode 100644 arch/x86/include/asm/mach-generic/gpio.h
delete mode 100644 arch/x86/include/asm/mach-generic/mach_ipi.h
delete mode 100644 arch/x86/include/asm/mach-generic/mach_wakecpu.h
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h
index ce3655a..4bbcf26 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -259,4 +259,5 @@ static inline physid_mask_t default_apicid_to_cpu_present(int phys_apicid)
}
#endif /* CONFIG_X86_LOCAL_APIC */
+
#endif /* _ASM_X86_GENAPIC_64_H */
diff --git a/arch/x86/include/asm/ipi.h b/arch/x86/include/asm/ipi.h
index a8d717f..e2e8e4e 100644
--- a/arch/x86/include/asm/ipi.h
+++ b/arch/x86/include/asm/ipi.h
@@ -1,6 +1,8 @@
#ifndef _ASM_X86_IPI_H
#define _ASM_X86_IPI_H
+#ifdef CONFIG_X86_LOCAL_APIC
+
/*
* Copyright 2004 James Cleverdon, IBM.
* Subject to the GNU Public License, v.2
@@ -56,8 +58,7 @@ static inline void __xapic_wait_icr_idle(void)
}
static inline void
-__default_send_IPI_shortcut(unsigned int shortcut,
- int vector, unsigned int dest)
+__default_send_IPI_shortcut(unsigned int shortcut, int vector, unsigned int dest)
{
/*
* Subtle. In the case of the 'never do double writes' workaround
@@ -156,4 +157,60 @@ default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector)
local_irq_restore(flags);
}
+
+/* Avoid include hell */
+#define NMI_VECTOR 0x02
+
+void default_send_IPI_mask_bitmask(const struct cpumask *mask, int vector);
+void default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
+
+extern int no_broadcast;
+
+#ifdef CONFIG_X86_64
+#include <asm/genapic.h>
+#else
+static inline void default_send_IPI_mask(const struct cpumask *mask, int vector)
+{
+ default_send_IPI_mask_bitmask(mask, vector);
+}
+void default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
+#endif
+
+static inline void __default_local_send_IPI_allbutself(int vector)
+{
+ if (no_broadcast || vector == NMI_VECTOR)
+ apic->send_IPI_mask_allbutself(cpu_online_mask, vector);
+ else
+ __default_send_IPI_shortcut(APIC_DEST_ALLBUT, vector, apic->dest_logical);
+}
+
+static inline void __default_local_send_IPI_all(int vector)
+{
+ if (no_broadcast || vector == NMI_VECTOR)
+ apic->send_IPI_mask(cpu_online_mask, vector);
+ else
+ __default_send_IPI_shortcut(APIC_DEST_ALLINC, vector, apic->dest_logical);
+}
+
+#ifdef CONFIG_X86_32
+static inline void default_send_IPI_allbutself(int vector)
+{
+ /*
+ * if there are no other CPUs in the system then we get an APIC send
+ * error if we try to broadcast, thus avoid sending IPIs in this case.
+ */
+ if (!(num_online_cpus() > 1))
+ return;
+
+ __default_local_send_IPI_allbutself(vector);
+}
+
+static inline void default_send_IPI_all(int vector)
+{
+ __default_local_send_IPI_all(vector);
+}
+#endif
+
+#endif
+
#endif /* _ASM_X86_IPI_H */
diff --git a/arch/x86/include/asm/mach-default/mach_ipi.h b/arch/x86/include/asm/mach-default/mach_ipi.h
deleted file mode 100644
index 85dec63..0000000
--- a/arch/x86/include/asm/mach-default/mach_ipi.h
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef _ASM_X86_MACH_DEFAULT_MACH_IPI_H
-#define _ASM_X86_MACH_DEFAULT_MACH_IPI_H
-
-/* Avoid include hell */
-#define NMI_VECTOR 0x02
-
-void default_send_IPI_mask_bitmask(const struct cpumask *mask, int vector);
-void default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
-void __default_send_IPI_shortcut(unsigned int shortcut, int vector);
-
-extern int no_broadcast;
-
-#ifdef CONFIG_X86_64
-#include <asm/genapic.h>
-#else
-static inline void default_send_IPI_mask(const struct cpumask *mask, int vector)
-{
- default_send_IPI_mask_bitmask(mask, vector);
-}
-void default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
-#endif
-
-static inline void __default_local_send_IPI_allbutself(int vector)
-{
- if (no_broadcast || vector == NMI_VECTOR)
- apic->send_IPI_mask_allbutself(cpu_online_mask, vector);
- else
- __default_send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
-}
-
-static inline void __default_local_send_IPI_all(int vector)
-{
- if (no_broadcast || vector == NMI_VECTOR)
- apic->send_IPI_mask(cpu_online_mask, vector);
- else
- __default_send_IPI_shortcut(APIC_DEST_ALLINC, vector);
-}
-
-#ifdef CONFIG_X86_32
-static inline void default_send_IPI_allbutself(int vector)
-{
- /*
- * if there are no other CPUs in the system then we get an APIC send
- * error if we try to broadcast, thus avoid sending IPIs in this case.
- */
- if (!(num_online_cpus() > 1))
- return;
-
- __default_local_send_IPI_allbutself(vector);
-}
-
-static inline void default_send_IPI_all(int vector)
-{
- __default_local_send_IPI_all(vector);
-}
-#endif
-
-#endif /* _ASM_X86_MACH_DEFAULT_MACH_IPI_H */
diff --git a/arch/x86/include/asm/mach-generic/gpio.h b/arch/x86/include/asm/mach-generic/gpio.h
deleted file mode 100644
index 995c45e..0000000
--- a/arch/x86/include/asm/mach-generic/gpio.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef _ASM_X86_MACH_GENERIC_GPIO_H
-#define _ASM_X86_MACH_GENERIC_GPIO_H
-
-int gpio_request(unsigned gpio, const char *label);
-void gpio_free(unsigned gpio);
-int gpio_direction_input(unsigned gpio);
-int gpio_direction_output(unsigned gpio, int value);
-int gpio_get_value(unsigned gpio);
-void gpio_set_value(unsigned gpio, int value);
-int gpio_to_irq(unsigned gpio);
-int irq_to_gpio(unsigned irq);
-
-#include <asm-generic/gpio.h> /* cansleep wrappers */
-
-#endif /* _ASM_X86_MACH_GENERIC_GPIO_H */
diff --git a/arch/x86/include/asm/mach-generic/mach_ipi.h b/arch/x86/include/asm/mach-generic/mach_ipi.h
deleted file mode 100644
index 5691c09..0000000
--- a/arch/x86/include/asm/mach-generic/mach_ipi.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ASM_X86_MACH_GENERIC_MACH_IPI_H
-#define _ASM_X86_MACH_GENERIC_MACH_IPI_H
-
-#include <asm/genapic.h>
-
-#endif /* _ASM_X86_MACH_GENERIC_MACH_IPI_H */
diff --git a/arch/x86/include/asm/mach-generic/mach_wakecpu.h b/arch/x86/include/asm/mach-generic/mach_wakecpu.h
deleted file mode 100644
index 0b884c0..0000000
--- a/arch/x86/include/asm/mach-generic/mach_wakecpu.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H
-#define _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H
-
-#endif /* _ASM_X86_MACH_GENERIC_MACH_APIC_H */
diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic.c
index 41a0ba3..81efe86 100644
--- a/arch/x86/kernel/apic.c
+++ b/arch/x86/kernel/apic.c
@@ -49,7 +49,7 @@
#include <asm/i8259.h>
#include <asm/smp.h>
-#include <mach_ipi.h>
+#include <asm/genapic.h>
/*
* Sanity check
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
index 11b93ca..ad7f2a6 100644
--- a/arch/x86/kernel/crash.c
+++ b/arch/x86/kernel/crash.c
@@ -28,7 +28,7 @@
#include <asm/reboot.h>
#include <asm/virtext.h>
-#include <mach_ipi.h>
+#include <asm/genapic.h>
#if defined(CONFIG_SMP) && defined(CONFIG_X86_LOCAL_APIC)
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index e0744ea..241a01d 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -62,7 +62,6 @@
#include <asm/uv/uv_hub.h>
#include <asm/uv/uv_irq.h>
-#include <mach_ipi.h>
#include <asm/genapic.h>
#define __apicdebuginit(type) static type __init
diff --git a/arch/x86/kernel/ipi.c b/arch/x86/kernel/ipi.c
index 50076d9..0893fa1 100644
--- a/arch/x86/kernel/ipi.c
+++ b/arch/x86/kernel/ipi.c
@@ -20,7 +20,6 @@
#ifdef CONFIG_X86_32
#include <asm/genapic.h>
-#include <mach_ipi.h>
/*
* the following functions deal with sending IPIs between CPUs.
diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c
index b62a381..5c4f554 100644
--- a/arch/x86/kernel/kgdb.c
+++ b/arch/x86/kernel/kgdb.c
@@ -46,7 +46,7 @@
#include <asm/apicdef.h>
#include <asm/system.h>
-#include <mach_ipi.h>
+#include <asm/genapic.h>
/*
* Put the error code here just in case the user cares:
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 38dace2..32e8f0a 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -24,7 +24,7 @@
# include <asm/iommu.h>
#endif
-#include <mach_ipi.h>
+#include <asm/genapic.h>
/*
* Power off function, if any
diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
index 892e7c3..0eb32ae 100644
--- a/arch/x86/kernel/smp.c
+++ b/arch/x86/kernel/smp.c
@@ -26,7 +26,6 @@
#include <asm/tlbflush.h>
#include <asm/mmu_context.h>
#include <asm/proto.h>
-#include <mach_ipi.h>
#include <asm/genapic.h>
/*
* Some notes on x86 processor bugs affecting SMP operation:
diff --git a/arch/x86/kernel/visws_quirks.c b/arch/x86/kernel/visws_quirks.c
index 3bd7f47..4fd646e 100644
--- a/arch/x86/kernel/visws_quirks.c
+++ b/arch/x86/kernel/visws_quirks.c
@@ -32,7 +32,7 @@
#include <asm/e820.h>
#include <asm/io.h>
-#include <mach_ipi.h>
+#include <asm/genapic.h>
#include <asm/genapic.h>
diff --git a/arch/x86/mach-default/setup.c b/arch/x86/mach-default/setup.c
index df167f2..b65ff0b 100644
--- a/arch/x86/mach-default/setup.c
+++ b/arch/x86/mach-default/setup.c
@@ -10,7 +10,7 @@
#include <asm/e820.h>
#include <asm/setup.h>
-#include <mach_ipi.h>
+#include <asm/genapic.h>
#ifdef CONFIG_HOTPLUG_CPU
#define DEFAULT_SEND_IPI (1)
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index 7d5123e..d9d44c8 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -13,7 +13,7 @@
#include <linux/smp.h>
#include <linux/init.h>
#include <asm/genapic.h>
-#include <asm/mach-default/mach_ipi.h>
+#include <asm/ipi.h>
static void default_vector_allocation_domain(int cpu, struct cpumask *retmask)
{
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 6348e11..14c5af4 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -14,7 +14,7 @@
DEFINE_PER_CPU_SHARED_ALIGNED(struct tlb_state, cpu_tlbstate)
= { &init_mm, 0, };
-#include <mach_ipi.h>
+#include <asm/genapic.h>
/*
* Smarter SMP flushing macros.
* c/o Linus Torvalds.
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 081/114] x86: remove subarchitecture support code
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (79 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 080/114] x86, smp: remove mach_ipi.h Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 082/114] x86: move mach-default/*.h files to asm/ Ingo Molnar
` (34 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Remove remaining bits of the subarchitecture code. Now that all the
special platforms are runtime probed and runtime handled, we can remove
these facilities.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Makefile | 5 -
arch/x86/kernel/Makefile | 2 +-
arch/x86/kernel/probe_32.c | 248 ++++++++++++++++++++++++++++++++++++++++
arch/x86/mach-generic/Makefile | 7 -
arch/x86/mach-generic/probe.c | 156 -------------------------
5 files changed, 249 insertions(+), 169 deletions(-)
create mode 100644 arch/x86/kernel/probe_32.c
delete mode 100644 arch/x86/mach-generic/Makefile
delete mode 100644 arch/x86/mach-generic/probe.c
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index cacee98..799a0d9 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -113,11 +113,6 @@ mcore-y := arch/x86/mach-default/
mflags-$(CONFIG_X86_VOYAGER) := -Iarch/x86/include/asm/mach-voyager
mcore-$(CONFIG_X86_VOYAGER) := arch/x86/mach-voyager/
-# generic subarchitecture
-mflags-$(CONFIG_X86_GENERICARCH):= -Iarch/x86/include/asm/mach-generic
-fcore-$(CONFIG_X86_GENERICARCH) += arch/x86/mach-generic/
-mcore-$(CONFIG_X86_GENERICARCH) := arch/x86/mach-default/
-
# default subarch .h files
mflags-y += -Iarch/x86/include/asm/mach-default
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index ad6df80..61aeca3 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -30,7 +30,7 @@ obj-y += traps.o irq.o irq_$(BITS).o dumpstack_$(BITS).o
obj-y += time_$(BITS).o ioport.o ldt.o dumpstack.o
obj-y += setup.o i8259.o irqinit_$(BITS).o
obj-$(CONFIG_X86_VISWS) += visws_quirks.o
-obj-$(CONFIG_X86_32) += probe_roms_32.o
+obj-$(CONFIG_X86_32) += probe_32.o probe_roms_32.o
obj-$(CONFIG_X86_32) += sys_i386_32.o i386_ksyms_32.o
obj-$(CONFIG_X86_64) += sys_x86_64.o x8664_ksyms_64.o
obj-$(CONFIG_X86_64) += syscall_64.o vsyscall_64.o
diff --git a/arch/x86/kernel/probe_32.c b/arch/x86/kernel/probe_32.c
new file mode 100644
index 0000000..a6fba69
--- /dev/null
+++ b/arch/x86/kernel/probe_32.c
@@ -0,0 +1,248 @@
+/*
+ * Default generic APIC driver. This handles up to 8 CPUs.
+ *
+ * Copyright 2003 Andi Kleen, SuSE Labs.
+ * Subject to the GNU Public License, v.2
+ *
+ * Generic x86 APIC driver probe layer.
+ */
+#include <linux/threads.h>
+#include <linux/cpumask.h>
+#include <linux/string.h>
+#include <linux/kernel.h>
+#include <linux/ctype.h>
+#include <linux/init.h>
+#include <linux/errno.h>
+#include <asm/fixmap.h>
+#include <asm/mpspec.h>
+#include <asm/apicdef.h>
+#include <asm/genapic.h>
+#include <asm/setup.h>
+
+#include <linux/threads.h>
+#include <linux/cpumask.h>
+#include <asm/mpspec.h>
+#include <asm/genapic.h>
+#include <asm/fixmap.h>
+#include <asm/apicdef.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/smp.h>
+#include <linux/init.h>
+#include <asm/genapic.h>
+#include <asm/ipi.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)
+{
+ return 1;
+}
+
+struct genapic apic_default = {
+
+ .name = "default",
+ .probe = probe_default,
+ .acpi_madt_oem_check = NULL,
+ .apic_id_registered = default_apic_id_registered,
+
+ .irq_delivery_mode = dest_LowestPrio,
+ /* logical delivery broadcast to all CPUs: */
+ .irq_dest_mode = 1,
+
+ .target_cpus = default_target_cpus,
+ .disable_esr = 0,
+ .dest_logical = APIC_DEST_LOGICAL,
+ .check_apicid_used = default_check_apicid_used,
+ .check_apicid_present = default_check_apicid_present,
+
+ .vector_allocation_domain = default_vector_allocation_domain,
+ .init_apic_ldr = default_init_apic_ldr,
+
+ .ioapic_phys_id_map = default_ioapic_phys_id_map,
+ .setup_apic_routing = default_setup_apic_routing,
+ .multi_timer_check = NULL,
+ .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 = default_apicid_to_cpu_present,
+ .setup_portio_remap = NULL,
+ .check_phys_apicid_present = default_check_phys_apicid_present,
+ .enable_apic_mode = NULL,
+ .phys_pkg_id = default_phys_pkg_id,
+ .mps_oem_check = NULL,
+
+ .get_apic_id = default_get_apic_id,
+ .set_apic_id = NULL,
+ .apic_id_mask = 0x0F << 24,
+
+ .cpu_mask_to_apicid = default_cpu_mask_to_apicid,
+ .cpu_mask_to_apicid_and = default_cpu_mask_to_apicid_and,
+
+ .send_IPI_mask = default_send_IPI_mask,
+ .send_IPI_mask_allbutself = NULL,
+ .send_IPI_allbutself = default_send_IPI_allbutself,
+ .send_IPI_all = default_send_IPI_all,
+ .send_IPI_self = NULL,
+
+ .wakeup_cpu = NULL,
+ .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW,
+ .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH,
+
+ .wait_for_init_deassert = default_wait_for_init_deassert,
+
+ .smp_callin_clear_local_apic = NULL,
+ .store_NMI_vector = NULL,
+ .inquire_remote_apic = default_inquire_remote_apic,
+};
+
+extern struct genapic apic_numaq;
+extern struct genapic apic_summit;
+extern struct genapic apic_bigsmp;
+extern struct genapic apic_es7000;
+extern struct genapic apic_default;
+
+struct genapic *apic = &apic_default;
+
+static struct genapic *apic_probe[] __initdata = {
+#ifdef CONFIG_X86_NUMAQ
+ &apic_numaq,
+#endif
+#ifdef CONFIG_X86_SUMMIT
+ &apic_summit,
+#endif
+#ifdef CONFIG_X86_BIGSMP
+ &apic_bigsmp,
+#endif
+#ifdef CONFIG_X86_ES7000
+ &apic_es7000,
+#endif
+ &apic_default, /* must be last */
+ NULL,
+};
+
+static int cmdline_apic __initdata;
+static int __init parse_apic(char *arg)
+{
+ int i;
+
+ if (!arg)
+ return -EINVAL;
+
+ for (i = 0; apic_probe[i]; i++) {
+ if (!strcmp(apic_probe[i]->name, arg)) {
+ apic = apic_probe[i];
+ cmdline_apic = 1;
+ return 0;
+ }
+ }
+
+ if (x86_quirks->update_genapic)
+ x86_quirks->update_genapic();
+
+ /* Parsed again by __setup for debug/verbose */
+ return 0;
+}
+early_param("apic", parse_apic);
+
+void __init generic_bigsmp_probe(void)
+{
+#ifdef CONFIG_X86_BIGSMP
+ /*
+ * This routine is used to switch to bigsmp mode when
+ * - There is no apic= option specified by the user
+ * - generic_apic_probe() has chosen apic_default as the sub_arch
+ * - we find more than 8 CPUs in acpi LAPIC listing with xAPIC support
+ */
+
+ if (!cmdline_apic && apic == &apic_default) {
+ if (apic_bigsmp.probe()) {
+ apic = &apic_bigsmp;
+ if (x86_quirks->update_genapic)
+ x86_quirks->update_genapic();
+ printk(KERN_INFO "Overriding APIC driver with %s\n",
+ apic->name);
+ }
+ }
+#endif
+}
+
+void __init generic_apic_probe(void)
+{
+ if (!cmdline_apic) {
+ int i;
+ for (i = 0; apic_probe[i]; i++) {
+ if (apic_probe[i]->probe()) {
+ apic = apic_probe[i];
+ break;
+ }
+ }
+ /* Not visible without early console */
+ if (!apic_probe[i])
+ panic("Didn't find an APIC driver");
+
+ if (x86_quirks->update_genapic)
+ x86_quirks->update_genapic();
+ }
+ printk(KERN_INFO "Using APIC driver %s\n", apic->name);
+}
+
+/* These functions can switch the APIC even after the initial ->probe() */
+
+int __init
+generic_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)
+ 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;
+}
+
+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)
+ 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;
+}
diff --git a/arch/x86/mach-generic/Makefile b/arch/x86/mach-generic/Makefile
deleted file mode 100644
index 05e4a7c..0000000
--- a/arch/x86/mach-generic/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# Makefile for the generic architecture
-#
-
-EXTRA_CFLAGS := -Iarch/x86/kernel
-
-obj-y := probe.o default.o
diff --git a/arch/x86/mach-generic/probe.c b/arch/x86/mach-generic/probe.c
deleted file mode 100644
index c03c722..0000000
--- a/arch/x86/mach-generic/probe.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright 2003 Andi Kleen, SuSE Labs.
- * Subject to the GNU Public License, v.2
- *
- * Generic x86 APIC driver probe layer.
- */
-#include <linux/threads.h>
-#include <linux/cpumask.h>
-#include <linux/string.h>
-#include <linux/kernel.h>
-#include <linux/ctype.h>
-#include <linux/init.h>
-#include <linux/errno.h>
-#include <asm/fixmap.h>
-#include <asm/mpspec.h>
-#include <asm/apicdef.h>
-#include <asm/genapic.h>
-#include <asm/setup.h>
-
-extern struct genapic apic_numaq;
-extern struct genapic apic_summit;
-extern struct genapic apic_bigsmp;
-extern struct genapic apic_es7000;
-extern struct genapic apic_default;
-
-struct genapic *apic = &apic_default;
-
-static struct genapic *apic_probe[] __initdata = {
-#ifdef CONFIG_X86_NUMAQ
- &apic_numaq,
-#endif
-#ifdef CONFIG_X86_SUMMIT
- &apic_summit,
-#endif
-#ifdef CONFIG_X86_BIGSMP
- &apic_bigsmp,
-#endif
-#ifdef CONFIG_X86_ES7000
- &apic_es7000,
-#endif
- &apic_default, /* must be last */
- NULL,
-};
-
-static int cmdline_apic __initdata;
-static int __init parse_apic(char *arg)
-{
- int i;
-
- if (!arg)
- return -EINVAL;
-
- for (i = 0; apic_probe[i]; i++) {
- if (!strcmp(apic_probe[i]->name, arg)) {
- apic = apic_probe[i];
- cmdline_apic = 1;
- return 0;
- }
- }
-
- if (x86_quirks->update_genapic)
- x86_quirks->update_genapic();
-
- /* Parsed again by __setup for debug/verbose */
- return 0;
-}
-early_param("apic", parse_apic);
-
-void __init generic_bigsmp_probe(void)
-{
-#ifdef CONFIG_X86_BIGSMP
- /*
- * This routine is used to switch to bigsmp mode when
- * - There is no apic= option specified by the user
- * - generic_apic_probe() has chosen apic_default as the sub_arch
- * - we find more than 8 CPUs in acpi LAPIC listing with xAPIC support
- */
-
- if (!cmdline_apic && apic == &apic_default) {
- if (apic_bigsmp.probe()) {
- apic = &apic_bigsmp;
- if (x86_quirks->update_genapic)
- x86_quirks->update_genapic();
- printk(KERN_INFO "Overriding APIC driver with %s\n",
- apic->name);
- }
- }
-#endif
-}
-
-void __init generic_apic_probe(void)
-{
- if (!cmdline_apic) {
- int i;
- for (i = 0; apic_probe[i]; i++) {
- if (apic_probe[i]->probe()) {
- apic = apic_probe[i];
- break;
- }
- }
- /* Not visible without early console */
- if (!apic_probe[i])
- panic("Didn't find an APIC driver");
-
- if (x86_quirks->update_genapic)
- x86_quirks->update_genapic();
- }
- printk(KERN_INFO "Using APIC driver %s\n", apic->name);
-}
-
-/* These functions can switch the APIC even after the initial ->probe() */
-
-int __init
-generic_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)
- 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;
-}
-
-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)
- 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;
-}
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 082/114] x86: move mach-default/*.h files to asm/
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (80 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 081/114] x86: remove subarchitecture support code Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 083/114] x86: remove subarchitecture support Ingo Molnar
` (33 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
We are getting rid of subarchitecture support - move the hook files
to asm/. (These are now stale and should be replaced with more explicit
runtime mechanisms - but the transition is simpler this way.)
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/{mach-default => }/apm.h | 0
arch/x86/include/asm/{mach-default => }/do_timer.h | 0
.../include/asm/{mach-default => }/entry_arch.h | 5 +++++
.../include/asm/{mach-default => }/mach_timer.h | 0
.../include/asm/{mach-default => }/mach_traps.h | 0
.../include/asm/{mach-default => }/pci-functions.h | 0
.../include/asm/{mach-default => }/setup_arch.h | 0
.../include/asm/{mach-default => }/smpboot_hooks.h | 0
arch/x86/kernel/apm_32.c | 2 +-
arch/x86/kernel/entry_32.S | 2 +-
arch/x86/kernel/nmi.c | 2 +-
arch/x86/kernel/probe_roms_32.c | 2 +-
arch/x86/kernel/setup.c | 2 +-
arch/x86/kernel/smpboot.c | 2 +-
arch/x86/kernel/time_32.c | 2 +-
arch/x86/kernel/traps.c | 2 +-
arch/x86/pci/pcbios.c | 2 +-
drivers/clocksource/acpi_pm.c | 2 +-
drivers/clocksource/cyclone.c | 2 +-
19 files changed, 16 insertions(+), 11 deletions(-)
rename arch/x86/include/asm/{mach-default => }/apm.h (100%)
rename arch/x86/include/asm/{mach-default => }/do_timer.h (100%)
rename arch/x86/include/asm/{mach-default => }/entry_arch.h (95%)
rename arch/x86/include/asm/{mach-default => }/mach_timer.h (100%)
rename arch/x86/include/asm/{mach-default => }/mach_traps.h (100%)
rename arch/x86/include/asm/{mach-default => }/pci-functions.h (100%)
rename arch/x86/include/asm/{mach-default => }/setup_arch.h (100%)
rename arch/x86/include/asm/{mach-default => }/smpboot_hooks.h (100%)
diff --git a/arch/x86/include/asm/mach-default/apm.h b/arch/x86/include/asm/apm.h
similarity index 100%
rename from arch/x86/include/asm/mach-default/apm.h
rename to arch/x86/include/asm/apm.h
diff --git a/arch/x86/include/asm/mach-default/do_timer.h b/arch/x86/include/asm/do_timer.h
similarity index 100%
rename from arch/x86/include/asm/mach-default/do_timer.h
rename to arch/x86/include/asm/do_timer.h
diff --git a/arch/x86/include/asm/mach-default/entry_arch.h b/arch/x86/include/asm/entry_arch.h
similarity index 95%
rename from arch/x86/include/asm/mach-default/entry_arch.h
rename to arch/x86/include/asm/entry_arch.h
index 6fa399a..b87b077 100644
--- a/arch/x86/include/asm/mach-default/entry_arch.h
+++ b/arch/x86/include/asm/entry_arch.h
@@ -41,10 +41,15 @@ BUILD_INTERRUPT3(invalidate_interrupt7,INVALIDATE_TLB_VECTOR_START+7,
* a much simpler SMP time architecture:
*/
#ifdef CONFIG_X86_LOCAL_APIC
+
BUILD_INTERRUPT(apic_timer_interrupt,LOCAL_TIMER_VECTOR)
BUILD_INTERRUPT(error_interrupt,ERROR_APIC_VECTOR)
BUILD_INTERRUPT(spurious_interrupt,SPURIOUS_APIC_VECTOR)
+#ifdef CONFIG_PERF_COUNTERS
+BUILD_INTERRUPT(perf_counter_interrupt, LOCAL_PERF_VECTOR)
+#endif
+
#ifdef CONFIG_X86_MCE_P4THERMAL
BUILD_INTERRUPT(thermal_interrupt,THERMAL_APIC_VECTOR)
#endif
diff --git a/arch/x86/include/asm/mach-default/mach_timer.h b/arch/x86/include/asm/mach_timer.h
similarity index 100%
rename from arch/x86/include/asm/mach-default/mach_timer.h
rename to arch/x86/include/asm/mach_timer.h
diff --git a/arch/x86/include/asm/mach-default/mach_traps.h b/arch/x86/include/asm/mach_traps.h
similarity index 100%
rename from arch/x86/include/asm/mach-default/mach_traps.h
rename to arch/x86/include/asm/mach_traps.h
diff --git a/arch/x86/include/asm/mach-default/pci-functions.h b/arch/x86/include/asm/pci-functions.h
similarity index 100%
rename from arch/x86/include/asm/mach-default/pci-functions.h
rename to arch/x86/include/asm/pci-functions.h
diff --git a/arch/x86/include/asm/mach-default/setup_arch.h b/arch/x86/include/asm/setup_arch.h
similarity index 100%
rename from arch/x86/include/asm/mach-default/setup_arch.h
rename to arch/x86/include/asm/setup_arch.h
diff --git a/arch/x86/include/asm/mach-default/smpboot_hooks.h b/arch/x86/include/asm/smpboot_hooks.h
similarity index 100%
rename from arch/x86/include/asm/mach-default/smpboot_hooks.h
rename to arch/x86/include/asm/smpboot_hooks.h
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index 98807bb..37ba5f8 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -301,7 +301,7 @@ extern int (*console_blank_hook)(int);
*/
#define APM_ZERO_SEGS
-#include "apm.h"
+#include <asm/apm.h>
/*
* Define to re-initialize the interrupt 0 timer to 100 Hz after a suspend.
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
index a0b91aa..65efd42 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -688,7 +688,7 @@ ENDPROC(name)
#define BUILD_INTERRUPT(name, nr) BUILD_INTERRUPT3(name, nr, smp_##name)
/* The include is where all of the SMP etc. interrupts come from */
-#include "entry_arch.h"
+#include <asm/entry_arch.h>
ENTRY(coprocessor_error)
RING0_INT_FRAME
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c
index 23b6d9e..bdfad80 100644
--- a/arch/x86/kernel/nmi.c
+++ b/arch/x86/kernel/nmi.c
@@ -34,7 +34,7 @@
#include <asm/mce.h>
-#include <mach_traps.h>
+#include <asm/mach_traps.h>
int unknown_nmi_panic;
int nmi_watchdog_enabled;
diff --git a/arch/x86/kernel/probe_roms_32.c b/arch/x86/kernel/probe_roms_32.c
index 675a48c..071e7fe 100644
--- a/arch/x86/kernel/probe_roms_32.c
+++ b/arch/x86/kernel/probe_roms_32.c
@@ -18,7 +18,7 @@
#include <asm/setup.h>
#include <asm/sections.h>
#include <asm/io.h>
-#include <setup_arch.h>
+#include <asm/setup_arch.h>
static struct resource system_rom_resource = {
.name = "System ROM",
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 92e4293..e645d47 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -81,7 +81,7 @@
#include <asm/io_apic.h>
#include <asm/ist.h>
#include <asm/vmi.h>
-#include <setup_arch.h>
+#include <asm/setup_arch.h>
#include <asm/bios_ebda.h>
#include <asm/cacheflush.h>
#include <asm/processor.h>
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 489fde9..e90b3e5 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -66,7 +66,7 @@
#include <linux/mc146818rtc.h>
#include <asm/genapic.h>
-#include <smpboot_hooks.h>
+#include <asm/smpboot_hooks.h>
#ifdef CONFIG_X86_32
u8 apicid_2_node[MAX_APICID];
diff --git a/arch/x86/kernel/time_32.c b/arch/x86/kernel/time_32.c
index 3985cac..764c74e 100644
--- a/arch/x86/kernel/time_32.c
+++ b/arch/x86/kernel/time_32.c
@@ -38,7 +38,7 @@
#include <asm/time.h>
#include <asm/timer.h>
-#include "do_timer.h"
+#include <asm/do_timer.h>
int timer_ack;
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index ed5aee5..214bc32 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -54,7 +54,7 @@
#include <asm/desc.h>
#include <asm/i387.h>
-#include <mach_traps.h>
+#include <asm/mach_traps.h>
#ifdef CONFIG_X86_64
#include <asm/pgalloc.h>
diff --git a/arch/x86/pci/pcbios.c b/arch/x86/pci/pcbios.c
index b82cae9..1c975cc 100644
--- a/arch/x86/pci/pcbios.c
+++ b/arch/x86/pci/pcbios.c
@@ -7,7 +7,7 @@
#include <linux/module.h>
#include <linux/uaccess.h>
#include <asm/pci_x86.h>
-#include <asm/mach-default/pci-functions.h>
+#include <asm/pci-functions.h>
/* BIOS32 signature: "_32_" */
#define BIOS32_SIGNATURE (('_' << 0) + ('3' << 8) + ('2' << 16) + ('_' << 24))
diff --git a/drivers/clocksource/acpi_pm.c b/drivers/clocksource/acpi_pm.c
index e1129fa..ee19b6e 100644
--- a/drivers/clocksource/acpi_pm.c
+++ b/drivers/clocksource/acpi_pm.c
@@ -143,7 +143,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_LE,
#endif
#ifndef CONFIG_X86_64
-#include "mach_timer.h"
+#include <asm/mach_timer.h>
#define PMTMR_EXPECTED_RATE \
((CALIBRATE_LATCH * (PMTMR_TICKS_PER_SEC >> 10)) / (CLOCK_TICK_RATE>>10))
/*
diff --git a/drivers/clocksource/cyclone.c b/drivers/clocksource/cyclone.c
index 1bde303..8615059 100644
--- a/drivers/clocksource/cyclone.c
+++ b/drivers/clocksource/cyclone.c
@@ -7,7 +7,7 @@
#include <asm/pgtable.h>
#include <asm/io.h>
-#include "mach_timer.h"
+#include <asm/mach_timer.h>
#define CYCLONE_CBAR_ADDR 0xFEB00CD0 /* base address ptr */
#define CYCLONE_PMCC_OFFSET 0x51A0 /* offset to control register */
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 083/114] x86: remove subarchitecture support
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (81 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 082/114] x86: move mach-default/*.h files to asm/ Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 084/114] x86/Voyager: clean up BROKEN Kconfig reference Ingo Molnar
` (32 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Remove the 32-bit subarchitecture support code.
All subarchitectures but Voyager have been converted. Voyager will be
done later or will be removed.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Makefile | 21 -----
arch/x86/include/asm/apic.h | 2 +
arch/x86/kernel/Makefile | 2 +-
arch/x86/kernel/io_apic.c | 17 ----
arch/x86/kernel/probe_32.c | 163 +++++++++++++++++++++++++++++++++++++++
arch/x86/mach-default/setup.c | 162 --------------------------------------
arch/x86/mach-generic/default.c | 93 ----------------------
7 files changed, 166 insertions(+), 294 deletions(-)
delete mode 100644 arch/x86/mach-default/setup.c
delete mode 100644 arch/x86/mach-generic/default.c
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 799a0d9..99550c4 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -102,24 +102,6 @@ KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
# prevent gcc from generating any FP code by mistake
KBUILD_CFLAGS += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,)
-###
-# Sub architecture support
-# fcore-y is linked before mcore-y files.
-
-# Default subarch .c files
-mcore-y := arch/x86/mach-default/
-
-# Voyager subarch support
-mflags-$(CONFIG_X86_VOYAGER) := -Iarch/x86/include/asm/mach-voyager
-mcore-$(CONFIG_X86_VOYAGER) := arch/x86/mach-voyager/
-
-# default subarch .h files
-mflags-y += -Iarch/x86/include/asm/mach-default
-
-# 64 bit does not support subarch support - clear sub arch variables
-fcore-$(CONFIG_X86_64) :=
-mcore-$(CONFIG_X86_64) :=
-
KBUILD_CFLAGS += $(mflags-y)
KBUILD_AFLAGS += $(mflags-y)
@@ -145,9 +127,6 @@ core-$(CONFIG_LGUEST_GUEST) += arch/x86/lguest/
core-y += arch/x86/kernel/
core-y += arch/x86/mm/
-# Remaining sub architecture files
-core-y += $(mcore-y)
-
core-y += arch/x86/crypto/
core-y += arch/x86/vdso/
core-$(CONFIG_IA32_EMULATION) += arch/x86/ia32/
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index 6a77068..b03711d 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -215,6 +215,7 @@ static inline void disable_local_APIC(void) { }
#define SET_APIC_ID(x) (apic->set_apic_id(x))
#else
+#ifdef CONFIG_X86_LOCAL_APIC
static inline unsigned default_get_apic_id(unsigned long x)
{
unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR));
@@ -224,6 +225,7 @@ static inline unsigned default_get_apic_id(unsigned long x)
else
return (x >> 24) & 0x0F;
}
+#endif
#endif
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index 61aeca3..cea216f 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -63,7 +63,7 @@ obj-$(CONFIG_SMP) += setup_percpu.o
obj-$(CONFIG_X86_64_SMP) += tsc_sync.o
obj-$(CONFIG_X86_TRAMPOLINE) += trampoline_$(BITS).o
obj-$(CONFIG_X86_MPPARSE) += mpparse.o
-obj-$(CONFIG_X86_LOCAL_APIC) += apic.o nmi.o
+obj-$(CONFIG_X86_LOCAL_APIC) += apic.o nmi.o ipi.o
obj-$(CONFIG_X86_IO_APIC) += io_apic.o
obj-$(CONFIG_X86_REBOOTFIXUPS) += reboot_fixups_32.o
obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index 241a01d..3378ffb 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -797,23 +797,6 @@ static void clear_IO_APIC (void)
clear_IO_APIC_pin(apic, pin);
}
-#if !defined(CONFIG_SMP) && defined(CONFIG_X86_32)
-void default_send_IPI_self(int vector)
-{
- unsigned int cfg;
-
- /*
- * Wait for idle.
- */
- apic_wait_icr_idle();
- cfg = APIC_DM_FIXED | APIC_DEST_SELF | vector | apic->dest_logical;
- /*
- * Send the IPI. The write to APIC_ICR fires this off.
- */
- apic_write(APIC_ICR, cfg);
-}
-#endif /* !CONFIG_SMP && CONFIG_X86_32*/
-
#ifdef CONFIG_X86_32
/*
* support for broken MP BIOSs, enables hand-redirection of PIRQ0-7 to
diff --git a/arch/x86/kernel/probe_32.c b/arch/x86/kernel/probe_32.c
index a6fba69..61339a0 100644
--- a/arch/x86/kernel/probe_32.c
+++ b/arch/x86/kernel/probe_32.c
@@ -32,6 +32,26 @@
#include <asm/genapic.h>
#include <asm/ipi.h>
+#include <linux/smp.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <asm/acpi.h>
+#include <asm/arch_hooks.h>
+#include <asm/e820.h>
+#include <asm/setup.h>
+
+#include <asm/genapic.h>
+
+#ifdef CONFIG_HOTPLUG_CPU
+#define DEFAULT_SEND_IPI (1)
+#else
+#define DEFAULT_SEND_IPI (0)
+#endif
+
+int no_broadcast = DEFAULT_SEND_IPI;
+
+#ifdef CONFIG_X86_LOCAL_APIC
+
static void default_vector_allocation_domain(int cpu, struct cpumask *retmask)
{
/*
@@ -246,3 +266,146 @@ int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
}
return 0;
}
+
+#endif /* CONFIG_X86_LOCAL_APIC */
+
+/**
+ * pre_intr_init_hook - initialisation prior to setting up interrupt vectors
+ *
+ * Description:
+ * Perform any necessary interrupt initialisation prior to setting up
+ * the "ordinary" interrupt call gates. For legacy reasons, the ISA
+ * interrupts should be initialised here if the machine emulates a PC
+ * in any way.
+ **/
+void __init pre_intr_init_hook(void)
+{
+ if (x86_quirks->arch_pre_intr_init) {
+ if (x86_quirks->arch_pre_intr_init())
+ return;
+ }
+ init_ISA_irqs();
+}
+
+/**
+ * intr_init_hook - post gate setup interrupt initialisation
+ *
+ * Description:
+ * Fill in any interrupts that may have been left out by the general
+ * init_IRQ() routine. interrupts having to do with the machine rather
+ * than the devices on the I/O bus (like APIC interrupts in intel MP
+ * systems) are started here.
+ **/
+void __init intr_init_hook(void)
+{
+ if (x86_quirks->arch_intr_init) {
+ if (x86_quirks->arch_intr_init())
+ return;
+ }
+}
+
+/**
+ * pre_setup_arch_hook - hook called prior to any setup_arch() execution
+ *
+ * Description:
+ * generally used to activate any machine specific identification
+ * routines that may be needed before setup_arch() runs. On Voyager
+ * this is used to get the board revision and type.
+ **/
+void __init pre_setup_arch_hook(void)
+{
+}
+
+/**
+ * trap_init_hook - initialise system specific traps
+ *
+ * Description:
+ * Called as the final act of trap_init(). Used in VISWS to initialise
+ * the various board specific APIC traps.
+ **/
+void __init trap_init_hook(void)
+{
+ if (x86_quirks->arch_trap_init) {
+ if (x86_quirks->arch_trap_init())
+ return;
+ }
+}
+
+static struct irqaction irq0 = {
+ .handler = timer_interrupt,
+ .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL,
+ .mask = CPU_MASK_NONE,
+ .name = "timer"
+};
+
+/**
+ * pre_time_init_hook - do any specific initialisations before.
+ *
+ **/
+void __init pre_time_init_hook(void)
+{
+ if (x86_quirks->arch_pre_time_init)
+ x86_quirks->arch_pre_time_init();
+}
+
+/**
+ * time_init_hook - do any specific initialisations for the system timer.
+ *
+ * Description:
+ * Must plug the system timer interrupt source at HZ into the IRQ listed
+ * in irq_vectors.h:TIMER_IRQ
+ **/
+void __init time_init_hook(void)
+{
+ if (x86_quirks->arch_time_init) {
+ /*
+ * A nonzero return code does not mean failure, it means
+ * that the architecture quirk does not want any
+ * generic (timer) setup to be performed after this:
+ */
+ if (x86_quirks->arch_time_init())
+ return;
+ }
+
+ irq0.mask = cpumask_of_cpu(0);
+ setup_irq(0, &irq0);
+}
+
+#ifdef CONFIG_MCA
+/**
+ * mca_nmi_hook - hook into MCA specific NMI chain
+ *
+ * Description:
+ * The MCA (Microchannel Architecture) has an NMI chain for NMI sources
+ * along the MCA bus. Use this to hook into that chain if you will need
+ * it.
+ **/
+void mca_nmi_hook(void)
+{
+ /*
+ * If I recall correctly, there's a whole bunch of other things that
+ * we can do to check for NMI problems, but that's all I know about
+ * at the moment.
+ */
+ pr_warning("NMI generated from unknown source!\n");
+}
+#endif
+
+static __init int no_ipi_broadcast(char *str)
+{
+ get_option(&str, &no_broadcast);
+ pr_info("Using %s mode\n",
+ no_broadcast ? "No IPI Broadcast" : "IPI Broadcast");
+ return 1;
+}
+__setup("no_ipi_broadcast=", no_ipi_broadcast);
+
+static int __init print_ipi_mode(void)
+{
+ pr_info("Using IPI %s mode\n",
+ no_broadcast ? "No-Shortcut" : "Shortcut");
+ return 0;
+}
+
+late_initcall(print_ipi_mode);
+
diff --git a/arch/x86/mach-default/setup.c b/arch/x86/mach-default/setup.c
deleted file mode 100644
index b65ff0b..0000000
--- a/arch/x86/mach-default/setup.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Machine specific setup for generic
- */
-
-#include <linux/smp.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <asm/acpi.h>
-#include <asm/arch_hooks.h>
-#include <asm/e820.h>
-#include <asm/setup.h>
-
-#include <asm/genapic.h>
-
-#ifdef CONFIG_HOTPLUG_CPU
-#define DEFAULT_SEND_IPI (1)
-#else
-#define DEFAULT_SEND_IPI (0)
-#endif
-
-int no_broadcast = DEFAULT_SEND_IPI;
-
-/**
- * pre_intr_init_hook - initialisation prior to setting up interrupt vectors
- *
- * Description:
- * Perform any necessary interrupt initialisation prior to setting up
- * the "ordinary" interrupt call gates. For legacy reasons, the ISA
- * interrupts should be initialised here if the machine emulates a PC
- * in any way.
- **/
-void __init pre_intr_init_hook(void)
-{
- if (x86_quirks->arch_pre_intr_init) {
- if (x86_quirks->arch_pre_intr_init())
- return;
- }
- init_ISA_irqs();
-}
-
-/**
- * intr_init_hook - post gate setup interrupt initialisation
- *
- * Description:
- * Fill in any interrupts that may have been left out by the general
- * init_IRQ() routine. interrupts having to do with the machine rather
- * than the devices on the I/O bus (like APIC interrupts in intel MP
- * systems) are started here.
- **/
-void __init intr_init_hook(void)
-{
- if (x86_quirks->arch_intr_init) {
- if (x86_quirks->arch_intr_init())
- return;
- }
-}
-
-/**
- * pre_setup_arch_hook - hook called prior to any setup_arch() execution
- *
- * Description:
- * generally used to activate any machine specific identification
- * routines that may be needed before setup_arch() runs. On Voyager
- * this is used to get the board revision and type.
- **/
-void __init pre_setup_arch_hook(void)
-{
-}
-
-/**
- * trap_init_hook - initialise system specific traps
- *
- * Description:
- * Called as the final act of trap_init(). Used in VISWS to initialise
- * the various board specific APIC traps.
- **/
-void __init trap_init_hook(void)
-{
- if (x86_quirks->arch_trap_init) {
- if (x86_quirks->arch_trap_init())
- return;
- }
-}
-
-static struct irqaction irq0 = {
- .handler = timer_interrupt,
- .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL,
- .mask = CPU_MASK_NONE,
- .name = "timer"
-};
-
-/**
- * pre_time_init_hook - do any specific initialisations before.
- *
- **/
-void __init pre_time_init_hook(void)
-{
- if (x86_quirks->arch_pre_time_init)
- x86_quirks->arch_pre_time_init();
-}
-
-/**
- * time_init_hook - do any specific initialisations for the system timer.
- *
- * Description:
- * Must plug the system timer interrupt source at HZ into the IRQ listed
- * in irq_vectors.h:TIMER_IRQ
- **/
-void __init time_init_hook(void)
-{
- if (x86_quirks->arch_time_init) {
- /*
- * A nonzero return code does not mean failure, it means
- * that the architecture quirk does not want any
- * generic (timer) setup to be performed after this:
- */
- if (x86_quirks->arch_time_init())
- return;
- }
-
- irq0.mask = cpumask_of_cpu(0);
- setup_irq(0, &irq0);
-}
-
-#ifdef CONFIG_MCA
-/**
- * mca_nmi_hook - hook into MCA specific NMI chain
- *
- * Description:
- * The MCA (Microchannel Architecture) has an NMI chain for NMI sources
- * along the MCA bus. Use this to hook into that chain if you will need
- * it.
- **/
-void mca_nmi_hook(void)
-{
- /*
- * If I recall correctly, there's a whole bunch of other things that
- * we can do to check for NMI problems, but that's all I know about
- * at the moment.
- */
- pr_warning("NMI generated from unknown source!\n");
-}
-#endif
-
-static __init int no_ipi_broadcast(char *str)
-{
- get_option(&str, &no_broadcast);
- pr_info("Using %s mode\n",
- no_broadcast ? "No IPI Broadcast" : "IPI Broadcast");
- return 1;
-}
-__setup("no_ipi_broadcast=", no_ipi_broadcast);
-
-static int __init print_ipi_mode(void)
-{
- pr_info("Using IPI %s mode\n",
- no_broadcast ? "No-Shortcut" : "Shortcut");
- return 0;
-}
-
-late_initcall(print_ipi_mode);
-
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
deleted file mode 100644
index d9d44c8..0000000
--- a/arch/x86/mach-generic/default.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Default generic APIC driver. This handles up to 8 CPUs.
- */
-#define APIC_DEFINITION 1
-#include <linux/threads.h>
-#include <linux/cpumask.h>
-#include <asm/mpspec.h>
-#include <asm/genapic.h>
-#include <asm/fixmap.h>
-#include <asm/apicdef.h>
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/smp.h>
-#include <linux/init.h>
-#include <asm/genapic.h>
-#include <asm/ipi.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)
-{
- return 1;
-}
-
-struct genapic apic_default = {
-
- .name = "default",
- .probe = probe_default,
- .acpi_madt_oem_check = NULL,
- .apic_id_registered = default_apic_id_registered,
-
- .irq_delivery_mode = dest_LowestPrio,
- /* logical delivery broadcast to all CPUs: */
- .irq_dest_mode = 1,
-
- .target_cpus = default_target_cpus,
- .disable_esr = 0,
- .dest_logical = APIC_DEST_LOGICAL,
- .check_apicid_used = default_check_apicid_used,
- .check_apicid_present = default_check_apicid_present,
-
- .vector_allocation_domain = default_vector_allocation_domain,
- .init_apic_ldr = default_init_apic_ldr,
-
- .ioapic_phys_id_map = default_ioapic_phys_id_map,
- .setup_apic_routing = default_setup_apic_routing,
- .multi_timer_check = NULL,
- .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 = default_apicid_to_cpu_present,
- .setup_portio_remap = NULL,
- .check_phys_apicid_present = default_check_phys_apicid_present,
- .enable_apic_mode = NULL,
- .phys_pkg_id = default_phys_pkg_id,
- .mps_oem_check = NULL,
-
- .get_apic_id = default_get_apic_id,
- .set_apic_id = NULL,
- .apic_id_mask = 0x0F << 24,
-
- .cpu_mask_to_apicid = default_cpu_mask_to_apicid,
- .cpu_mask_to_apicid_and = default_cpu_mask_to_apicid_and,
-
- .send_IPI_mask = default_send_IPI_mask,
- .send_IPI_mask_allbutself = NULL,
- .send_IPI_allbutself = default_send_IPI_allbutself,
- .send_IPI_all = default_send_IPI_all,
- .send_IPI_self = NULL,
-
- .wakeup_cpu = NULL,
- .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW,
- .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH,
-
- .wait_for_init_deassert = default_wait_for_init_deassert,
-
- .smp_callin_clear_local_apic = NULL,
- .store_NMI_vector = NULL,
- .inquire_remote_apic = default_inquire_remote_apic,
-};
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 084/114] x86/Voyager: clean up BROKEN Kconfig reference
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (82 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 083/114] x86: remove subarchitecture support Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 085/114] x86: disable Voyager temporarily Ingo Molnar
` (31 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
CONFIG_BROKEN has been removed from the upstream kernel years ago,
but X86_VOYAGER still had a stale reference to it - remove it.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index d6218e6..45c7bdb 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -303,7 +303,7 @@ config X86_ELAN
config X86_VOYAGER
bool "Voyager (NCR)"
- depends on X86_32 && (SMP || BROKEN) && !PCI
+ depends on X86_32 && SMP && !PCI
help
Voyager is an MCA-based 32-way capable SMP architecture proprietary
to NCR Corp. Machine classes 345x/35xx/4100/51xx are Voyager-based.
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 085/114] x86: disable Voyager temporarily
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (83 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 084/114] x86/Voyager: clean up BROKEN Kconfig reference Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 086/114] x86/Voyager: remove MCA Kconfig quirk Ingo Molnar
` (30 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
x86/Voyager does not build right now and it's unclear whether it will
be cleaned up and ported to the subarch-less 32-bit x86 code - so disable
it for now.
If it's fixed we'll re-enable it - or remove it after some time. There's
a very low number of systems running development kernels on x86/Voyager
currently. (one or two on the whole planet)
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 45c7bdb..f983f40 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -303,7 +303,7 @@ config X86_ELAN
config X86_VOYAGER
bool "Voyager (NCR)"
- depends on X86_32 && SMP && !PCI
+ depends on X86_32 && SMP && !PCI && BROKEN
help
Voyager is an MCA-based 32-way capable SMP architecture proprietary
to NCR Corp. Machine classes 345x/35xx/4100/51xx are Voyager-based.
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 086/114] x86/Voyager: remove MCA Kconfig quirk
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (84 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 085/114] x86: disable Voyager temporarily Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 087/114] x86/Voyager: remove NATSEMI " Ingo Molnar
` (29 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Remove Voyager Kconfig quirk: just like any other hardware platform
users of Voyager systems can configure in the hardware drivers they need.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index f983f40..ae37a75 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1873,8 +1873,7 @@ config EISA
source "drivers/eisa/Kconfig"
config MCA
- bool "MCA support" if !X86_VOYAGER
- default y if X86_VOYAGER
+ bool "MCA support"
help
MicroChannel Architecture is found in some IBM PS/2 machines and
laptops. It is a bus system similar to PCI or ISA. See
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 087/114] x86/Voyager: remove NATSEMI Kconfig quirk
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (85 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 086/114] x86/Voyager: remove MCA Kconfig quirk Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 088/114] x86/Voyager: remove KVM " Ingo Molnar
` (28 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
x86/Voyager has this quirk for SCx200 support:
config SCx200
tristate "NatSemi SCx200 support"
depends on !X86_VOYAGER
Remove it - Voyager users can disable drivers they dont need.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index ae37a75..9727dd5 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1884,7 +1884,6 @@ source "drivers/mca/Kconfig"
config SCx200
tristate "NatSemi SCx200 support"
- depends on !X86_VOYAGER
help
This provides basic support for National Semiconductor's
(now AMD's) Geode processors. The driver probes for the
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 088/114] x86/Voyager: remove KVM Kconfig quirk
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (86 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 087/114] x86/Voyager: remove NATSEMI " Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 089/114] x86/Voyager: remove KGDB " Ingo Molnar
` (27 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Voyager and other subarchitectures have this Kconfig quirk:
select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64)
This is unnecessary, as KVM cleanly detects based on CPUID capabilities.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 9727dd5..a783fe7 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -34,7 +34,7 @@ config X86
select HAVE_FUNCTION_TRACER
select HAVE_FUNCTION_GRAPH_TRACER
select HAVE_FUNCTION_TRACE_MCOUNT_TEST
- select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64)
+ select HAVE_KVM
select HAVE_ARCH_KGDB if !X86_VOYAGER
select HAVE_ARCH_TRACEHOOK
select HAVE_GENERIC_DMA_COHERENT if X86_32
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 089/114] x86/Voyager: remove KGDB Kconfig quirk
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (87 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 088/114] x86/Voyager: remove KVM " Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 090/114] x86/Voyager: remove HIBERNATION " Ingo Molnar
` (26 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
x86/Voyager has this KGDB quirk:
select HAVE_ARCH_KGDB if !X86_VOYAGER
This is completely pointless - there's nothing in KGDB that cannot work
on Voyager. Remove it.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index a783fe7..12b433a 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -35,7 +35,7 @@ config X86
select HAVE_FUNCTION_GRAPH_TRACER
select HAVE_FUNCTION_TRACE_MCOUNT_TEST
select HAVE_KVM
- select HAVE_ARCH_KGDB if !X86_VOYAGER
+ select HAVE_ARCH_KGDB
select HAVE_ARCH_TRACEHOOK
select HAVE_GENERIC_DMA_COHERENT if X86_32
select HAVE_EFFICIENT_UNALIGNED_ACCESS
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 090/114] x86/Voyager: remove HIBERNATION Kconfig quirk
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (88 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 089/114] x86/Voyager: remove KGDB " Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 091/114] x86/Voyager: remove ARCH_SUSPEND_POSSIBLE " Ingo Molnar
` (25 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Voyager has this hibernation quirk:
config ARCH_HIBERNATION_POSSIBLE
def_bool y
depends on !SMP || !X86_VOYAGER
Hibernation is a generic facility provided on all x86 platforms. If it
is buggy on Voyager then that bug should be fixed - not worked around.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 12b433a..df952e7 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -140,7 +140,7 @@ config HAVE_CPUMASK_OF_CPU_MAP
config ARCH_HIBERNATION_POSSIBLE
def_bool y
- depends on !SMP || !X86_VOYAGER
+ depends on !SMP
config ARCH_SUSPEND_POSSIBLE
def_bool y
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 091/114] x86/Voyager: remove ARCH_SUSPEND_POSSIBLE Kconfig quirk
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (89 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 090/114] x86/Voyager: remove HIBERNATION " Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 092/114] x86: replace CONFIG_X86_SMP with CONFIG_SMP Ingo Molnar
` (24 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Voyager has this Kconfig quirk for suspend/resume:
config ARCH_SUSPEND_POSSIBLE
def_bool y
depends on !X86_VOYAGER
The proper mechanism to not suspend on a piece of hardware to disable
CONFIG_SUSPEND. Remove the quirk.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index df952e7..8e6413e 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -144,7 +144,6 @@ config ARCH_HIBERNATION_POSSIBLE
config ARCH_SUSPEND_POSSIBLE
def_bool y
- depends on !X86_VOYAGER
config ZONE_DMA32
bool
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 092/114] x86: replace CONFIG_X86_SMP with CONFIG_SMP
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (90 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 091/114] x86/Voyager: remove ARCH_SUSPEND_POSSIBLE " Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 093/114] x86: generalize boot_cpu_id Ingo Molnar
` (23 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
The x86/Voyager subarch used to have this distinction between
'x86 SMP support' and 'Voyager SMP support':
config X86_SMP
bool
depends on SMP && ((X86_32 && !X86_VOYAGER) || X86_64)
This is a pointless distinction - Voyager can (and already does) use
smp_ops to implement various SMP quirks it has - and it can be extended
more to cover all the specialities of Voyager.
So remove this complication in the Kconfig space.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 7 +------
arch/x86/Kconfig.debug | 2 +-
arch/x86/include/asm/entry_arch.h | 2 +-
arch/x86/include/asm/hw_irq.h | 2 +-
arch/x86/kernel/Makefile | 4 ++--
arch/x86/kernel/apic.c | 2 +-
arch/x86/kernel/cpu/addon_cpuid_features.c | 2 +-
arch/x86/kernel/process.c | 2 +-
arch/x86/kernel/setup.c | 2 +-
arch/x86/kernel/tsc.c | 2 +-
arch/x86/kernel/vmiclock_32.c | 2 +-
arch/x86/mm/Makefile | 2 +-
12 files changed, 13 insertions(+), 18 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 8e6413e..3671506 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -173,11 +173,6 @@ config GENERIC_PENDING_IRQ
depends on GENERIC_HARDIRQS && SMP
default y
-config X86_SMP
- bool
- depends on SMP && ((X86_32 && !X86_VOYAGER) || X86_64)
- default y
-
config USE_GENERIC_SMP_HELPERS
def_bool y
depends on SMP
@@ -203,7 +198,7 @@ config X86_BIOS_REBOOT
config X86_TRAMPOLINE
bool
- depends on X86_SMP || (X86_VOYAGER && SMP) || (64BIT && ACPI_SLEEP)
+ depends on SMP || (64BIT && ACPI_SLEEP)
default y
config KTIME_SCALAR
diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
index 28f1114..a38dd60 100644
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
@@ -83,7 +83,7 @@ config DEBUG_PAGEALLOC
config DEBUG_PER_CPU_MAPS
bool "Debug access to per_cpu maps"
depends on DEBUG_KERNEL
- depends on X86_SMP
+ depends on SMP
default n
help
Say Y to verify that the per_cpu map being accessed has
diff --git a/arch/x86/include/asm/entry_arch.h b/arch/x86/include/asm/entry_arch.h
index b87b077..854d538 100644
--- a/arch/x86/include/asm/entry_arch.h
+++ b/arch/x86/include/asm/entry_arch.h
@@ -9,7 +9,7 @@
* is no hardware IRQ pin equivalent for them, they are triggered
* through the ICC by us (IPIs)
*/
-#ifdef CONFIG_X86_SMP
+#ifdef CONFIG_SMP
BUILD_INTERRUPT(reschedule_interrupt,RESCHEDULE_VECTOR)
BUILD_INTERRUPT(call_function_interrupt,CALL_FUNCTION_VECTOR)
BUILD_INTERRUPT(call_function_single_interrupt,CALL_FUNCTION_SINGLE_VECTOR)
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
index bfa921f..4155079 100644
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
@@ -98,7 +98,7 @@ extern asmlinkage void qic_call_function_interrupt(void);
extern void smp_apic_timer_interrupt(struct pt_regs *);
extern void smp_spurious_interrupt(struct pt_regs *);
extern void smp_error_interrupt(struct pt_regs *);
-#ifdef CONFIG_X86_SMP
+#ifdef CONFIG_SMP
extern void smp_reschedule_interrupt(struct pt_regs *);
extern void smp_call_function_interrupt(struct pt_regs *);
extern void smp_call_function_single_interrupt(struct pt_regs *);
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index cea216f..1ab8e47 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -57,8 +57,8 @@ obj-$(CONFIG_X86_CPUID) += cpuid.o
obj-$(CONFIG_PCI) += early-quirks.o
apm-y := apm_32.o
obj-$(CONFIG_APM) += apm.o
-obj-$(CONFIG_X86_SMP) += smp.o
-obj-$(CONFIG_X86_SMP) += smpboot.o tsc_sync.o ipi.o
+obj-$(CONFIG_SMP) += smp.o
+obj-$(CONFIG_SMP) += smpboot.o tsc_sync.o ipi.o
obj-$(CONFIG_SMP) += setup_percpu.o
obj-$(CONFIG_X86_64_SMP) += tsc_sync.o
obj-$(CONFIG_X86_TRAMPOLINE) += trampoline_$(BITS).o
diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic.c
index 81efe86..968c817 100644
--- a/arch/x86/kernel/apic.c
+++ b/arch/x86/kernel/apic.c
@@ -1900,7 +1900,7 @@ void __cpuinit generic_processor_info(int apicid, int version)
}
#endif
-#if defined(CONFIG_X86_SMP) || defined(CONFIG_X86_64)
+#if defined(CONFIG_SMP) || defined(CONFIG_X86_64)
early_per_cpu(x86_cpu_to_apicid, cpu) = apicid;
early_per_cpu(x86_bios_cpu_apicid, cpu) = apicid;
#endif
diff --git a/arch/x86/kernel/cpu/addon_cpuid_features.c b/arch/x86/kernel/cpu/addon_cpuid_features.c
index 4a48bb4..e48640c 100644
--- a/arch/x86/kernel/cpu/addon_cpuid_features.c
+++ b/arch/x86/kernel/cpu/addon_cpuid_features.c
@@ -69,7 +69,7 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c)
*/
void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c)
{
-#ifdef CONFIG_X86_SMP
+#ifdef CONFIG_SMP
unsigned int eax, ebx, ecx, edx, sub_index;
unsigned int ht_mask_width, core_plus_mask_width;
unsigned int core_select_mask, core_level_siblings;
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index e68bb9e..89537f6 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -344,7 +344,7 @@ static void c1e_idle(void)
void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c)
{
-#ifdef CONFIG_X86_SMP
+#ifdef CONFIG_SMP
if (pm_idle == poll_idle && smp_num_siblings > 1) {
printk(KERN_WARNING "WARNING: polling idle and HT enabled,"
" performance may degrade.\n");
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index e645d47..eeb180b 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -588,7 +588,7 @@ early_param("elfcorehdr", setup_elfcorehdr);
static int __init default_update_genapic(void)
{
-#ifdef CONFIG_X86_SMP
+#ifdef CONFIG_SMP
if (!apic->wakeup_cpu)
apic->wakeup_cpu = wakeup_secondary_cpu_via_init;
#endif
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 599e581..83d53ce 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -773,7 +773,7 @@ __cpuinit int unsynchronized_tsc(void)
if (!cpu_has_tsc || tsc_unstable)
return 1;
-#ifdef CONFIG_X86_SMP
+#ifdef CONFIG_SMP
if (apic_is_clustered_box())
return 1;
#endif
diff --git a/arch/x86/kernel/vmiclock_32.c b/arch/x86/kernel/vmiclock_32.c
index c4c1f9e..a4791ef 100644
--- a/arch/x86/kernel/vmiclock_32.c
+++ b/arch/x86/kernel/vmiclock_32.c
@@ -256,7 +256,7 @@ void __devinit vmi_time_bsp_init(void)
*/
clockevents_notify(CLOCK_EVT_NOTIFY_SUSPEND, NULL);
local_irq_disable();
-#ifdef CONFIG_X86_SMP
+#ifdef CONFIG_SMP
/*
* XXX handle_percpu_irq only defined for SMP; we need to switch over
* to using it, since this is a local interrupt, which each CPU must
diff --git a/arch/x86/mm/Makefile b/arch/x86/mm/Makefile
index 9f05157..2b938a3 100644
--- a/arch/x86/mm/Makefile
+++ b/arch/x86/mm/Makefile
@@ -1,7 +1,7 @@
obj-y := init_$(BITS).o fault.o ioremap.o extable.o pageattr.o mmap.o \
pat.o pgtable.o gup.o
-obj-$(CONFIG_X86_SMP) += tlb.o
+obj-$(CONFIG_SMP) += tlb.o
obj-$(CONFIG_X86_32) += pgtable_32.o iomap_32.o
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 093/114] x86: generalize boot_cpu_id
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (91 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 092/114] x86: replace CONFIG_X86_SMP with CONFIG_SMP Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 094/114] x86/Voyager: remove X86_HT Kconfig quirk Ingo Molnar
` (22 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
x86/Voyager can boot on non-zero processors. While that can probably
be fixed by properly remapping the physical CPU IDs, keep boot_cpu_id
for now for easier transition - and expand it to all of x86.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 4 ----
arch/x86/include/asm/cpu.h | 6 +-----
arch/x86/kernel/setup.c | 14 ++++++++++++++
arch/x86/kernel/smpboot.c | 12 ------------
4 files changed, 15 insertions(+), 21 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 3671506..f4dd851 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -238,10 +238,6 @@ config SMP
If you don't know what to do here, say N.
-config X86_HAS_BOOT_CPU_ID
- def_bool y
- depends on X86_VOYAGER
-
config SPARSE_IRQ
bool "Support sparse irq numbering"
depends on PCI_MSI || HT_IRQ
diff --git a/arch/x86/include/asm/cpu.h b/arch/x86/include/asm/cpu.h
index f03b23e..b185091 100644
--- a/arch/x86/include/asm/cpu.h
+++ b/arch/x86/include/asm/cpu.h
@@ -32,10 +32,6 @@ extern void arch_unregister_cpu(int);
DECLARE_PER_CPU(int, cpu_state);
-#ifdef CONFIG_X86_HAS_BOOT_CPU_ID
-extern unsigned char boot_cpu_id;
-#else
-#define boot_cpu_id 0
-#endif
+extern unsigned int boot_cpu_id;
#endif /* _ASM_X86_CPU_H */
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index eeb180b..609e5af 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -112,6 +112,20 @@
#define ARCH_SETUP
#endif
+unsigned int boot_cpu_id __read_mostly;
+
+#ifdef CONFIG_X86_64
+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
+
#ifndef CONFIG_DEBUG_BOOT_PARAMS
struct boot_params __initdata boot_params;
#else
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index e90b3e5..bc7e220 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -905,18 +905,6 @@ 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);
-}
-
-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)
{
int apicid = apic->cpu_present_to_apicid(cpu);
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 094/114] x86/Voyager: remove X86_HT Kconfig quirk
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (92 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 093/114] x86: generalize boot_cpu_id Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 095/114] x86/Voyager: remove X86_BIOS_REBOOT " Ingo Molnar
` (21 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Voyager has this Kconfig quirk:
depends on (X86_32 && !X86_VOYAGER) || X86_64
That is unnecessary as HT support is CPUID driven and explicitly
enumerated.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index f4dd851..1d50c9d 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -188,7 +188,6 @@ config X86_64_SMP
config X86_HT
bool
depends on SMP
- depends on (X86_32 && !X86_VOYAGER) || X86_64
default y
config X86_BIOS_REBOOT
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 095/114] x86/Voyager: remove X86_BIOS_REBOOT Kconfig quirk
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (93 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 094/114] x86/Voyager: remove X86_HT Kconfig quirk Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 096/114] x86/Voyager: remove X86_FIND_SMP_CONFIG " Ingo Molnar
` (20 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Voyager has this Kconfig quirk:
config X86_BIOS_REBOOT
bool
depends on !X86_VOYAGER
default y
Voyager should use the existing machine_ops.emergency_restart reboot
quirk mechanism instead of a build-time quirk.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 6 ------
arch/x86/include/asm/proto.h | 4 ----
arch/x86/kernel/Makefile | 2 +-
3 files changed, 1 insertions(+), 11 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 1d50c9d..c0d79ab 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -190,11 +190,6 @@ config X86_HT
depends on SMP
default y
-config X86_BIOS_REBOOT
- bool
- depends on !X86_VOYAGER
- default y
-
config X86_TRAMPOLINE
bool
depends on SMP || (64BIT && ACPI_SLEEP)
@@ -1361,7 +1356,6 @@ source kernel/Kconfig.hz
config KEXEC
bool "kexec system call"
- depends on X86_BIOS_REBOOT
help
kexec is a system call that implements the ability to shutdown your
current kernel, and to start another kernel. It is like a reboot
diff --git a/arch/x86/include/asm/proto.h b/arch/x86/include/asm/proto.h
index d6a22f9..49fb3ec 100644
--- a/arch/x86/include/asm/proto.h
+++ b/arch/x86/include/asm/proto.h
@@ -18,11 +18,7 @@ extern void syscall32_cpu_init(void);
extern void check_efer(void);
-#ifdef CONFIG_X86_BIOS_REBOOT
extern int reboot_force;
-#else
-static const int reboot_force = 0;
-#endif
long do_arch_prctl(struct task_struct *task, int code, unsigned long addr);
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index 1ab8e47..2ba32d2 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -50,7 +50,7 @@ obj-y += step.o
obj-$(CONFIG_STACKTRACE) += stacktrace.o
obj-y += cpu/
obj-y += acpi/
-obj-$(CONFIG_X86_BIOS_REBOOT) += reboot.o
+obj-y += reboot.o
obj-$(CONFIG_MCA) += mca_32.o
obj-$(CONFIG_X86_MSR) += msr.o
obj-$(CONFIG_X86_CPUID) += cpuid.o
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 096/114] x86/Voyager: remove X86_FIND_SMP_CONFIG Kconfig quirk
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (94 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 095/114] x86/Voyager: remove X86_BIOS_REBOOT " Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 097/114] x86/VisWS: remove " Ingo Molnar
` (19 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
x86/Voyager had this Kconfig quirk:
config X86_FIND_SMP_CONFIG
def_bool y
depends on X86_MPPARSE || X86_VOYAGER
Which splits off the find_smp_config() callback into a build-time quirk.
Voyager should use the existing x86_quirks.mach_find_smp_config() callback
to introduce SMP-config quirks. NUMAQ-32 and VISWS already use this.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 4 ----
arch/x86/include/asm/mpspec.h | 4 +++-
arch/x86/kernel/setup.c | 3 +--
3 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index c0d79ab..df7cb8d 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -254,10 +254,6 @@ config NUMA_MIGRATE_IRQ_DESC
If you don't know what to do here, say N.
-config X86_FIND_SMP_CONFIG
- def_bool y
- depends on X86_MPPARSE || X86_VOYAGER
-
config X86_MPPARSE
bool "Enable MPS table" if ACPI
default y
diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h
index 03fb0d3..d22f732 100644
--- a/arch/x86/include/asm/mpspec.h
+++ b/arch/x86/include/asm/mpspec.h
@@ -56,11 +56,13 @@ extern int smp_found_config;
extern int mpc_default_type;
extern unsigned long mp_lapic_addr;
-extern void find_smp_config(void);
extern void get_smp_config(void);
+
#ifdef CONFIG_X86_MPPARSE
+extern void find_smp_config(void);
extern void early_reserve_e820_mpc_new(void);
#else
+static inline void find_smp_config(void) { }
static inline void early_reserve_e820_mpc_new(void) { }
#endif
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 609e5af..6abce67 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -905,12 +905,11 @@ void __init setup_arch(char **cmdline_p)
*/
acpi_reserve_bootmem();
#endif
-#ifdef CONFIG_X86_FIND_SMP_CONFIG
/*
* Find and reserve possible boot-time SMP configuration:
*/
find_smp_config();
-#endif
+
reserve_crashkernel();
#ifdef CONFIG_X86_64
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 097/114] x86/VisWS: remove Kconfig quirk
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (95 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 096/114] x86/Voyager: remove X86_FIND_SMP_CONFIG " Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 098/114] x86/Voyager: remove VMI " Ingo Molnar
` (18 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
VisWS has this quirk currently:
config X86_VISWS
bool "SGI 320/540 (Visual Workstation)"
depends on X86_32 && PCI && !X86_VOYAGER && X86_MPPARSE && PCI_GODIRECT
The !Voyager quirk is unnecessary.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index df7cb8d..f59d292 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -351,7 +351,7 @@ endchoice
config X86_VISWS
bool "SGI 320/540 (Visual Workstation)"
- depends on X86_32 && PCI && !X86_VOYAGER && X86_MPPARSE && PCI_GODIRECT
+ depends on X86_32 && PCI && X86_MPPARSE && PCI_GODIRECT
help
The SGI Visual Workstation series is an IA32-based workstation
based on SGI systems chips with some legacy PC hardware attached.
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 098/114] x86/Voyager: remove VMI Kconfig quirk
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (96 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 097/114] x86/VisWS: remove " Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 099/114] x86/Voyager: remove KVM_CLOCK quirk Ingo Molnar
` (17 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
x86/Voyager has this build-time quirk:
bool "VMI Guest support"
select PARAVIRT
depends on X86_32
depends on !X86_VOYAGER
Since VMI is auto-detected (and Voyager will be auto-detected) there's no
reason for this quirk.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index f59d292..4bd0c8f 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -406,7 +406,6 @@ config VMI
bool "VMI Guest support"
select PARAVIRT
depends on X86_32
- depends on !X86_VOYAGER
help
VMI provides a paravirtualized interface to the VMware ESX server
(it could be used by other hypervisors in theory too, but is not
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 099/114] x86/Voyager: remove KVM_CLOCK quirk
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (97 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 098/114] x86/Voyager: remove VMI " Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 100/114] x86/Voyager: remove KVM_GUEST quirk Ingo Molnar
` (16 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Voyager has this build-time quirk to exclude KVM_CLOCK:
bool "KVM paravirtualized clock"
select PARAVIRT
select PARAVIRT_CLOCK
depends on !X86_VOYAGER
Voyager support built into a kernel image does not exclude
KVM paravirt clock support - so remove this quirk.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 4bd0c8f..0bf0653 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -416,7 +416,6 @@ config KVM_CLOCK
bool "KVM paravirtualized clock"
select PARAVIRT
select PARAVIRT_CLOCK
- depends on !X86_VOYAGER
help
Turning on this option will allow you to run a paravirtualized clock
when running over the KVM hypervisor. Instead of relying on a PIT
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 100/114] x86/Voyager: remove KVM_GUEST quirk
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (98 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 099/114] x86/Voyager: remove KVM_CLOCK quirk Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 101/114] x86/Voyager: remove PARAVIRT Kconfig quirk Ingo Molnar
` (15 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Voyager has this quirk currently:
config KVM_GUEST
bool "KVM Guest support"
select PARAVIRT
depends on !X86_VOYAGER
Voyager support built into a kernel image does not exclude
KVM paravirt guest support - so remove this quirk.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 0bf0653..363111f 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -426,7 +426,6 @@ config KVM_CLOCK
config KVM_GUEST
bool "KVM Guest support"
select PARAVIRT
- depends on !X86_VOYAGER
help
This option enables various optimizations for running under the KVM
hypervisor.
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 101/114] x86/Voyager: remove PARAVIRT Kconfig quirk
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (99 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 100/114] x86/Voyager: remove KVM_GUEST quirk Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 102/114] x86/Voyager: remove APIC/IO-APIC Kbuild quirk Ingo Molnar
` (14 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Remove this Kconfig quirk:
config PARAVIRT
bool "Enable paravirtualization code"
depends on !X86_VOYAGER
help
Voyager support built into a kernel does not preclude paravirt support.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 363111f..8210534 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -434,7 +434,6 @@ source "arch/x86/lguest/Kconfig"
config PARAVIRT
bool "Enable paravirtualization code"
- depends on !X86_VOYAGER
help
This changes the kernel so it can modify itself when it is run
under a hypervisor, potentially improving performance significantly
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 102/114] x86/Voyager: remove APIC/IO-APIC Kbuild quirk
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (100 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 101/114] x86/Voyager: remove PARAVIRT Kconfig quirk Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 103/114] x86/Voyager: remove MCE quirk Ingo Molnar
` (13 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
The lapic/ioapic code properly auto-detects and is safe to run on CPUs that
have no local APIC. (or which have their lapic turned off in the hardware)
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 8210534..6fbb363 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -642,7 +642,7 @@ source "kernel/Kconfig.preempt"
config X86_UP_APIC
bool "Local APIC support on uniprocessors"
- depends on X86_32 && !SMP && !(X86_VOYAGER || X86_GENERICARCH)
+ depends on X86_32 && !SMP && !X86_GENERICARCH
help
A local APIC (Advanced Programmable Interrupt Controller) is an
integrated interrupt controller in the CPU. If you have a single-CPU
@@ -667,11 +667,11 @@ config X86_UP_IOAPIC
config X86_LOCAL_APIC
def_bool y
- depends on X86_64 || (X86_32 && (X86_UP_APIC || (SMP && !X86_VOYAGER) || X86_GENERICARCH))
+ depends on X86_64 || SMP || X86_GENERICARCH || X86_UP_APIC
config X86_IO_APIC
def_bool y
- depends on X86_64 || (X86_32 && (X86_UP_IOAPIC || (SMP && !X86_VOYAGER) || X86_GENERICARCH))
+ depends on X86_64 || SMP || X86_GENERICARCH || X86_UP_APIC
config X86_VISWS_APIC
def_bool y
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 103/114] x86/Voyager: remove MCE quirk
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (101 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 102/114] x86/Voyager: remove APIC/IO-APIC Kbuild quirk Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 104/114] x86/Voyager: remove HOTPLUG_CPU Kconfig quirk Ingo Molnar
` (12 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
If no MCE code is desired on Voyager hw then the solution
is to turn them off in the .config - and to extend the MCE
code to not initialize on Voyager.
Remove the build-time quirk.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 6fbb363..7cf9f0a 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -703,7 +703,6 @@ config X86_REROUTE_FOR_BROKEN_BOOT_IRQS
config X86_MCE
bool "Machine Check Exception"
- depends on !X86_VOYAGER
---help---
Machine Check Exception support allows the processor to notify the
kernel if it detects a problem (e.g. overheating, component failure).
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 104/114] x86/Voyager: remove HOTPLUG_CPU Kconfig quirk
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (102 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 103/114] x86/Voyager: remove MCE quirk Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 105/114] x86/Voyager: remove power management " Ingo Molnar
` (11 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Voyager has this Kconfig quirk:
config HOTPLUG_CPU
bool "Support for hot-pluggable CPUs"
depends on SMP && HOTPLUG && !X86_VOYAGER
But this exception will be moot once Voyager starts using the
generic x86 code.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 7cf9f0a..206645a 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1470,7 +1470,7 @@ config PHYSICAL_ALIGN
config HOTPLUG_CPU
bool "Support for hot-pluggable CPUs"
- depends on SMP && HOTPLUG && !X86_VOYAGER
+ depends on SMP && HOTPLUG
---help---
Say Y here to allow turning CPUs off and on. CPUs can be
controlled through /sys/devices/system/cpu.
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 105/114] x86/Voyager: remove power management Kconfig quirk
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (103 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 104/114] x86/Voyager: remove HOTPLUG_CPU Kconfig quirk Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 106/114] x86/Voyager: remove ISA quirk Ingo Molnar
` (10 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Voyager has this PM/ACPI Kconfig quirk:
menu "Power management and ACPI options"
depends on !X86_VOYAGER
Most of the PM features are auto-detect so they should be safe to run
on just about any hardware. (If not, those instances need fixing.)
In any case, if a kernel is built for Voyager, the power management
options can be disabled.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 206645a..f95c3b4 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1551,7 +1551,6 @@ config HAVE_ARCH_EARLY_PFN_TO_NID
depends on NUMA
menu "Power management and ACPI options"
- depends on !X86_VOYAGER
config ARCH_HIBERNATION_HEADER
def_bool y
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 106/114] x86/Voyager: remove ISA quirk
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (104 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 105/114] x86/Voyager: remove power management " Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 107/114] x86: cleanup, introduce CONFIG_NON_STANDARD_PLATFORMS Ingo Molnar
` (9 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Voyager has this ISA quirk (because Voyager has no ISA support):
config ISA
bool "ISA support"
depends on !X86_VOYAGER
There's a ton of x86 hardware that does not support ISA, and because
most ISA drivers cannot auto-detect in a safe way, the convention in
the kernel has always been to not enable ISA drivers if they are not
needed.
Voyager users can do likewise - no need for a Kconfig quirk.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index f95c3b4..38ed1a6 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1819,7 +1819,6 @@ if X86_32
config ISA
bool "ISA support"
- depends on !X86_VOYAGER
help
Find out whether you have ISA slots on your motherboard. ISA is the
name of a bus system, i.e. the way the CPU talks to the other stuff
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 107/114] x86: cleanup, introduce CONFIG_NON_STANDARD_PLATFORMS
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (105 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 106/114] x86/Voyager: remove ISA quirk Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 108/114] x86: move ELAN to the NON_STANDARD_PLATFORM section Ingo Molnar
` (8 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Introduce a Y/N Kconfig option for non-PC x86 platforms.
Make VisWS, RDC321 and SGI/UV depend on this.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 38ed1a6..b090e5a 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -349,9 +349,23 @@ config X86_VSMP
endchoice
+config X86_NON_STANDARD
+ bool "Support for non-standard x86 platforms"
+ help
+ If you disable this option then the kernel will only support
+ standard PC platforms. (which covers the vast majority of
+ systems out there.)
+
+ If you enable this option then you'll be able to select a number
+ of less common non-PC x86 platforms: VisWS, RDC321, SGI/UV.
+
+ If you have one of these systems, or if you want to build a
+ generic distribution kernel, say Y here - otherwise say N.
+
config X86_VISWS
bool "SGI 320/540 (Visual Workstation)"
depends on X86_32 && PCI && X86_MPPARSE && PCI_GODIRECT
+ depends on X86_NON_STANDARD
help
The SGI Visual Workstation series is an IA32-based workstation
based on SGI systems chips with some legacy PC hardware attached.
@@ -364,6 +378,7 @@ config X86_VISWS
config X86_RDC321X
bool "RDC R-321x SoC"
depends on X86_32
+ depends on X86_NON_STANDARD
select M486
select X86_REBOOTFIXUPS
help
@@ -374,6 +389,7 @@ config X86_RDC321X
config X86_UV
bool "SGI Ultraviolet"
depends on X86_64
+ depends on X86_NON_STANDARD
help
This option is needed in order to support SGI Ultraviolet systems.
If you don't have one of these, you should say N here.
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 108/114] x86: move ELAN to the NON_STANDARD_PLATFORM section
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (106 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 107/114] x86: cleanup, introduce CONFIG_NON_STANDARD_PLATFORMS Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 109/114] x86: move VOYAGER " Ingo Molnar
` (7 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Move X86_ELAN (old, AMD based web-boxes) from the subarchitecture
menu to the non-standard-platform section.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index b090e5a..b7617e3 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -271,16 +271,6 @@ config X86_PC
help
Choose this option if your computer is a standard PC or compatible.
-config X86_ELAN
- bool "AMD Elan"
- depends on X86_32
- help
- Select this for an AMD Elan processor.
-
- Do not use this option for K6/Athlon/Opteron processors!
-
- If unsure, choose "PC-compatible" instead.
-
config X86_VOYAGER
bool "Voyager (NCR)"
depends on X86_32 && SMP && !PCI && BROKEN
@@ -394,6 +384,17 @@ config X86_UV
This option is needed in order to support SGI Ultraviolet systems.
If you don't have one of these, you should say N here.
+config X86_ELAN
+ bool "AMD Elan"
+ depends on X86_32
+ depends on X86_NON_STANDARD
+ help
+ Select this for an AMD Elan processor.
+
+ Do not use this option for K6/Athlon/Opteron processors!
+
+ If unsure, choose "PC-compatible" instead.
+
config SCHED_OMIT_FRAME_POINTER
def_bool y
prompt "Single-depth WCHAN output"
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 109/114] x86: move VOYAGER to the NON_STANDARD_PLATFORM section
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (107 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 108/114] x86: move ELAN to the NON_STANDARD_PLATFORM section Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 110/114] x86: move non-standard 32-bit platform Kconfig entries Ingo Molnar
` (6 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Move X86_ELAN (old, NCR hw platform built on Intel CPUs) from the
subarchitecture menu to the non-standard-platform section.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 25 +++++++++++++------------
1 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index b7617e3..207dc95 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -271,18 +271,6 @@ config X86_PC
help
Choose this option if your computer is a standard PC or compatible.
-config X86_VOYAGER
- bool "Voyager (NCR)"
- depends on X86_32 && SMP && !PCI && BROKEN
- help
- Voyager is an MCA-based 32-way capable SMP architecture proprietary
- to NCR Corp. Machine classes 345x/35xx/4100/51xx are Voyager-based.
-
- *** WARNING ***
-
- If you do not specifically know you have a Voyager based machine,
- say N here, otherwise the kernel you build will not be bootable.
-
config X86_GENERICARCH
bool "Generic architecture"
depends on X86_32
@@ -395,6 +383,19 @@ config X86_ELAN
If unsure, choose "PC-compatible" instead.
+config X86_VOYAGER
+ bool "Voyager (NCR)"
+ depends on X86_32 && SMP && !PCI && BROKEN
+ depends on X86_NON_STANDARD
+ help
+ Voyager is an MCA-based 32-way capable SMP architecture proprietary
+ to NCR Corp. Machine classes 345x/35xx/4100/51xx are Voyager-based.
+
+ *** WARNING ***
+
+ If you do not specifically know you have a Voyager based machine,
+ say N here, otherwise the kernel you build will not be bootable.
+
config SCHED_OMIT_FRAME_POINTER
def_bool y
prompt "Single-depth WCHAN output"
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 110/114] x86: move non-standard 32-bit platform Kconfig entries
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (108 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 109/114] x86: move VOYAGER " Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 111/114] x86: move X86_VSMP from subarch menu Ingo Molnar
` (5 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
- make X86_GENERICARCH depend X86_NON_STANDARD
- move X86_SUMMIT, X86_ES7000 and X86_BIGSMP out of the subarchitecture
menu and under this option
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 88 ++++++++++++++++++++++++++---------------------------
1 files changed, 43 insertions(+), 45 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 207dc95..2fe2982 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -271,51 +271,6 @@ config X86_PC
help
Choose this option if your computer is a standard PC or compatible.
-config X86_GENERICARCH
- bool "Generic architecture"
- depends on X86_32
- help
- This option compiles in the NUMAQ, Summit, bigsmp, ES7000, default
- subarchitectures. It is intended for a generic binary kernel.
- if you select them all, kernel will probe it one by one. and will
- fallback to default.
-
-if X86_GENERICARCH
-
-config X86_NUMAQ
- bool "NUMAQ (IBM/Sequent)"
- depends on SMP && X86_32 && PCI && X86_MPPARSE
- select NUMA
- help
- This option is used for getting Linux to run on a NUMAQ (IBM/Sequent)
- NUMA multiquad box. This changes the way that processors are
- bootstrapped, and uses Clustered Logical APIC addressing mode instead
- of Flat Logical. You will need a new lynxer.elf file to flash your
- firmware with - send email to <Martin.Bligh@us.ibm.com>.
-
-config X86_SUMMIT
- bool "Summit/EXA (IBM x440)"
- depends on X86_32 && SMP
- help
- This option is needed for IBM systems that use the Summit/EXA chipset.
- In particular, it is needed for the x440.
-
-config X86_ES7000
- bool "Support for Unisys ES7000 IA32 series"
- depends on X86_32 && SMP
- help
- Support for Unisys ES7000 systems. Say 'Y' here if this kernel is
- supposed to run on an IA32-based Unisys ES7000 system.
-
-config X86_BIGSMP
- bool "Support for big SMP systems with more than 8 CPUs"
- depends on X86_32 && SMP
- help
- This option is needed for the systems that have more than 8 CPUs
- and if the system is not of any sub-arch type above.
-
-endif
-
config X86_VSMP
bool "Support for ScaleMP vSMP"
select PARAVIRT
@@ -396,6 +351,49 @@ config X86_VOYAGER
If you do not specifically know you have a Voyager based machine,
say N here, otherwise the kernel you build will not be bootable.
+config X86_GENERICARCH
+ bool "Support non-standard 32-bit SMP architectures"
+ depends on X86_32 && SMP
+ depends on X86_NON_STANDARD
+ help
+ This option compiles in the NUMAQ, Summit, bigsmp, ES7000, default
+ subarchitectures. It is intended for a generic binary kernel.
+ if you select them all, kernel will probe it one by one. and will
+ fallback to default.
+
+config X86_NUMAQ
+ bool "NUMAQ (IBM/Sequent)"
+ depends on X86_GENERICARCH
+ select NUMA
+ select X86_MPPARSE
+ help
+ This option is used for getting Linux to run on a NUMAQ (IBM/Sequent)
+ NUMA multiquad box. This changes the way that processors are
+ bootstrapped, and uses Clustered Logical APIC addressing mode instead
+ of Flat Logical. You will need a new lynxer.elf file to flash your
+ firmware with - send email to <Martin.Bligh@us.ibm.com>.
+
+config X86_SUMMIT
+ bool "Summit/EXA (IBM x440)"
+ depends on X86_GENERICARCH
+ help
+ This option is needed for IBM systems that use the Summit/EXA chipset.
+ In particular, it is needed for the x440.
+
+config X86_ES7000
+ bool "Support for Unisys ES7000 IA32 series"
+ depends on X86_GENERICARCH
+ help
+ Support for Unisys ES7000 systems. Say 'Y' here if this kernel is
+ supposed to run on an IA32-based Unisys ES7000 system.
+
+config X86_BIGSMP
+ bool "Support for big SMP systems with more than 8 CPUs"
+ depends on X86_GENERICARCH
+ help
+ This option is needed for the systems that have more than 8 CPUs
+ and if the system is not of any sub-arch type above.
+
config SCHED_OMIT_FRAME_POINTER
def_bool y
prompt "Single-depth WCHAN output"
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 111/114] x86: move X86_VSMP from subarch menu
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (109 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 110/114] x86: move non-standard 32-bit platform Kconfig entries Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 112/114] x86: remove the " Ingo Molnar
` (4 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Move X86_VSMP out of the subarch menu - this way it can be enabled
together with standard PC support as well, in the same kernel.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 2fe2982..ddddfb8 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -271,15 +271,6 @@ config X86_PC
help
Choose this option if your computer is a standard PC or compatible.
-config X86_VSMP
- bool "Support for ScaleMP vSMP"
- select PARAVIRT
- depends on X86_64 && PCI
- help
- Support for ScaleMP vSMP systems. Say 'Y' here if this kernel is
- supposed to run on these EM64T-based machines. Only choose this option
- if you have one of these machines.
-
endchoice
config X86_NON_STANDARD
@@ -327,6 +318,16 @@ config X86_UV
This option is needed in order to support SGI Ultraviolet systems.
If you don't have one of these, you should say N here.
+config X86_VSMP
+ bool "Support for ScaleMP vSMP"
+ select PARAVIRT
+ depends on X86_64 && PCI
+ depends on X86_NON_STANDARD
+ help
+ Support for ScaleMP vSMP systems. Say 'Y' here if this kernel is
+ supposed to run on these EM64T-based machines. Only choose this option
+ if you have one of these machines.
+
config X86_ELAN
bool "AMD Elan"
depends on X86_32
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 112/114] x86: remove the subarch menu
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (110 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 111/114] x86: move X86_VSMP from subarch menu Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:42 ` [PATCH 113/114] x86: rename X86_GENERICARCH to X86_32_NON_STANDARD Ingo Molnar
` (3 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Remove the subarch menu and standardize on X86_PC.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 10 +---------
1 files changed, 1 insertions(+), 9 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index ddddfb8..4773f1c 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -262,16 +262,8 @@ config X86_MPPARSE
For old smp systems that do not have proper acpi support. Newer systems
(esp with 64bit cpus) with acpi support, MADT and DSDT will override it
-choice
- prompt "Subarchitecture Type"
- default X86_PC
-
config X86_PC
- bool "PC-compatible"
- help
- Choose this option if your computer is a standard PC or compatible.
-
-endchoice
+ def_bool y
config X86_NON_STANDARD
bool "Support for non-standard x86 platforms"
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 113/114] x86: rename X86_GENERICARCH to X86_32_NON_STANDARD
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (111 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 112/114] x86: remove the " Ingo Molnar
@ 2009-01-28 23:42 ` Ingo Molnar
2009-01-28 23:43 ` [PATCH 114/114] x86/Voyager: move to the X86_32_NON_STANDARD code section Ingo Molnar
` (2 subsequent siblings)
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
X86_GENERICARCH is a misnomer - it contains non-PC 32-bit architectures
that are not included in the default build.
Rename it to X86_32_NON_STANDARD.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 22 +++++++++++-----------
arch/x86/kernel/acpi/boot.c | 2 +-
arch/x86/kernel/mpparse.c | 2 +-
arch/x86/kernel/setup.c | 2 +-
arch/x86/kernel/smpboot.c | 2 +-
drivers/mtd/nand/Kconfig | 2 +-
6 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 4773f1c..1427cb1 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -344,7 +344,7 @@ config X86_VOYAGER
If you do not specifically know you have a Voyager based machine,
say N here, otherwise the kernel you build will not be bootable.
-config X86_GENERICARCH
+config X86_32_NON_STANDARD
bool "Support non-standard 32-bit SMP architectures"
depends on X86_32 && SMP
depends on X86_NON_STANDARD
@@ -356,7 +356,7 @@ config X86_GENERICARCH
config X86_NUMAQ
bool "NUMAQ (IBM/Sequent)"
- depends on X86_GENERICARCH
+ depends on X86_32_NON_STANDARD
select NUMA
select X86_MPPARSE
help
@@ -368,21 +368,21 @@ config X86_NUMAQ
config X86_SUMMIT
bool "Summit/EXA (IBM x440)"
- depends on X86_GENERICARCH
+ depends on X86_32_NON_STANDARD
help
This option is needed for IBM systems that use the Summit/EXA chipset.
In particular, it is needed for the x440.
config X86_ES7000
bool "Support for Unisys ES7000 IA32 series"
- depends on X86_GENERICARCH
+ depends on X86_32_NON_STANDARD
help
Support for Unisys ES7000 systems. Say 'Y' here if this kernel is
supposed to run on an IA32-based Unisys ES7000 system.
config X86_BIGSMP
bool "Support for big SMP systems with more than 8 CPUs"
- depends on X86_GENERICARCH
+ depends on X86_32_NON_STANDARD
help
This option is needed for the systems that have more than 8 CPUs
and if the system is not of any sub-arch type above.
@@ -475,11 +475,11 @@ config MEMTEST
config X86_SUMMIT_NUMA
def_bool y
- depends on X86_32 && NUMA && X86_GENERICARCH
+ depends on X86_32 && NUMA && X86_32_NON_STANDARD
config X86_CYCLONE_TIMER
def_bool y
- depends on X86_GENERICARCH
+ depends on X86_32_NON_STANDARD
source "arch/x86/Kconfig.cpu"
@@ -651,7 +651,7 @@ source "kernel/Kconfig.preempt"
config X86_UP_APIC
bool "Local APIC support on uniprocessors"
- depends on X86_32 && !SMP && !X86_GENERICARCH
+ depends on X86_32 && !SMP && !X86_32_NON_STANDARD
help
A local APIC (Advanced Programmable Interrupt Controller) is an
integrated interrupt controller in the CPU. If you have a single-CPU
@@ -676,11 +676,11 @@ config X86_UP_IOAPIC
config X86_LOCAL_APIC
def_bool y
- depends on X86_64 || SMP || X86_GENERICARCH || X86_UP_APIC
+ depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_APIC
config X86_IO_APIC
def_bool y
- depends on X86_64 || SMP || X86_GENERICARCH || X86_UP_APIC
+ depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_APIC
config X86_VISWS_APIC
def_bool y
@@ -1122,7 +1122,7 @@ config ARCH_SPARSEMEM_DEFAULT
config ARCH_SPARSEMEM_ENABLE
def_bool y
- depends on X86_64 || NUMA || (EXPERIMENTAL && X86_PC) || X86_GENERICARCH
+ depends on X86_64 || NUMA || (EXPERIMENTAL && X86_PC) || X86_32_NON_STANDARD
select SPARSEMEM_STATIC if X86_32
select SPARSEMEM_VMEMMAP_ENABLE if X86_64
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index cb8b527..7352c60 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -1335,7 +1335,7 @@ static void __init acpi_process_madt(void)
if (!error) {
acpi_lapic = 1;
-#ifdef CONFIG_X86_GENERICARCH
+#ifdef CONFIG_X86_32_NON_STANDARD
generic_bigsmp_probe();
#endif
/*
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
index 94fe710..89aaced 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -372,7 +372,7 @@ static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early)
(*x86_quirks->mpc_record)++;
}
-#ifdef CONFIG_X86_GENERICARCH
+#ifdef CONFIG_X86_32_NON_STANDARD
generic_bigsmp_probe();
#endif
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 6abce67..f64e1a4 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -936,7 +936,7 @@ void __init setup_arch(char **cmdline_p)
map_vsyscall();
#endif
-#ifdef CONFIG_X86_GENERICARCH
+#ifdef CONFIG_X86_32_NON_STANDARD
generic_apic_probe();
#endif
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index bc7e220..fc80bc1 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1007,7 +1007,7 @@ static int __init smp_sanity_check(unsigned max_cpus)
printk(KERN_WARNING
"More than 8 CPUs detected - skipping them.\n"
- "Use CONFIG_X86_GENERICARCH and CONFIG_X86_BIGSMP.\n");
+ "Use CONFIG_X86_32_NON_STANDARD and CONFIG_X86_BIGSMP.\n");
nr = 0;
for_each_present_cpu(cpu) {
diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
index 8b12e6e..9289236 100644
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
@@ -273,7 +273,7 @@ config MTD_NAND_CAFE
config MTD_NAND_CS553X
tristate "NAND support for CS5535/CS5536 (AMD Geode companion chip)"
- depends on X86_32 && (X86_PC || X86_GENERICARCH)
+ depends on X86_32 && (X86_PC || X86_32_NON_STANDARD)
help
The CS553x companion chips for the AMD Geode processor
include NAND flash controllers with built-in hardware ECC
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 114/114] x86/Voyager: move to the X86_32_NON_STANDARD code section
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (112 preceding siblings ...)
2009-01-28 23:42 ` [PATCH 113/114] x86: rename X86_GENERICARCH to X86_32_NON_STANDARD Ingo Molnar
@ 2009-01-28 23:43 ` Ingo Molnar
2009-01-29 1:52 ` x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Suresh Siddha
2009-01-29 14:02 ` Andi Kleen
115 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-28 23:43 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar
Make Voyager depend on X86_32_NON_STANDARD - it is a non-standard 32-bit
SMP architecture.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/Kconfig | 34 +++++++++++++++++-----------------
1 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 1427cb1..5bf0e0c 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -331,19 +331,6 @@ config X86_ELAN
If unsure, choose "PC-compatible" instead.
-config X86_VOYAGER
- bool "Voyager (NCR)"
- depends on X86_32 && SMP && !PCI && BROKEN
- depends on X86_NON_STANDARD
- help
- Voyager is an MCA-based 32-way capable SMP architecture proprietary
- to NCR Corp. Machine classes 345x/35xx/4100/51xx are Voyager-based.
-
- *** WARNING ***
-
- If you do not specifically know you have a Voyager based machine,
- say N here, otherwise the kernel you build will not be bootable.
-
config X86_32_NON_STANDARD
bool "Support non-standard 32-bit SMP architectures"
depends on X86_32 && SMP
@@ -354,6 +341,13 @@ config X86_32_NON_STANDARD
if you select them all, kernel will probe it one by one. and will
fallback to default.
+config X86_BIGSMP
+ bool "Support for big SMP systems with more than 8 CPUs"
+ depends on X86_32_NON_STANDARD
+ help
+ This option is needed for the systems that have more than 8 CPUs
+ and if the system is not of any sub-arch type above.
+
config X86_NUMAQ
bool "NUMAQ (IBM/Sequent)"
depends on X86_32_NON_STANDARD
@@ -380,12 +374,18 @@ config X86_ES7000
Support for Unisys ES7000 systems. Say 'Y' here if this kernel is
supposed to run on an IA32-based Unisys ES7000 system.
-config X86_BIGSMP
- bool "Support for big SMP systems with more than 8 CPUs"
+config X86_VOYAGER
+ bool "Voyager (NCR)"
+ depends on SMP && !PCI && BROKEN
depends on X86_32_NON_STANDARD
help
- This option is needed for the systems that have more than 8 CPUs
- and if the system is not of any sub-arch type above.
+ Voyager is an MCA-based 32-way capable SMP architecture proprietary
+ to NCR Corp. Machine classes 345x/35xx/4100/51xx are Voyager-based.
+
+ *** WARNING ***
+
+ If you do not specifically know you have a Voyager based machine,
+ say N here, otherwise the kernel you build will not be bootable.
config SCHED_OMIT_FRAME_POINTER
def_bool y
--
1.6.0.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* Re: x86: unify genapic code, unify subarchitectures, remove old subarchitecture code
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (113 preceding siblings ...)
2009-01-28 23:43 ` [PATCH 114/114] x86/Voyager: move to the X86_32_NON_STANDARD code section Ingo Molnar
@ 2009-01-29 1:52 ` Suresh Siddha
2009-01-29 11:27 ` Ingo Molnar
2009-01-29 14:02 ` Andi Kleen
115 siblings, 1 reply; 134+ messages in thread
From: Suresh Siddha @ 2009-01-29 1:52 UTC (permalink / raw)
To: Ingo Molnar; +Cc: linux-kernel@vger.kernel.org, H. Peter Anvin, Thomas Gleixner
On Wed, 2009-01-28 at 15:41 -0800, Ingo Molnar wrote:
> 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.
Here's one :)
diff --git a/arch/x86/include/asm/genapic.h
b/arch/x86/include/asm/genapic.h
index 4bbcf26..273b994 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -145,7 +145,7 @@ static inline unsigned int read_apic_id(void)
{
unsigned int reg;
- reg = *(u32 *)(APIC_BASE + APIC_ID);
+ reg = apic_read(APIC_ID);
return apic->get_apic_id(reg);
}
^ permalink raw reply related [flat|nested] 134+ messages in thread* Re: x86: unify genapic code, unify subarchitectures, remove old subarchitecture code
2009-01-29 1:52 ` x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Suresh Siddha
@ 2009-01-29 11:27 ` Ingo Molnar
2009-01-29 20:11 ` Suresh Siddha
0 siblings, 1 reply; 134+ messages in thread
From: Ingo Molnar @ 2009-01-29 11:27 UTC (permalink / raw)
To: Suresh Siddha
Cc: linux-kernel@vger.kernel.org, H. Peter Anvin, Thomas Gleixner
* Suresh Siddha <suresh.b.siddha@intel.com> wrote:
> On Wed, 2009-01-28 at 15:41 -0800, Ingo Molnar wrote:
> > 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.
>
> Here's one :)
>
> diff --git a/arch/x86/include/asm/genapic.h
> b/arch/x86/include/asm/genapic.h
> index 4bbcf26..273b994 100644
> --- a/arch/x86/include/asm/genapic.h
> +++ b/arch/x86/include/asm/genapic.h
> @@ -145,7 +145,7 @@ static inline unsigned int read_apic_id(void)
> {
> unsigned int reg;
>
> - reg = *(u32 *)(APIC_BASE + APIC_ID);
> + reg = apic_read(APIC_ID);
>
ah, indeed - hardcoded mmio access to the lapic isnt quite
xapic_ops-compatible ;-)
Applied to tip/x86/apic (see the commit below), thanks Suresh! The xapic
bisection breakage is 40 commits so i'll likely rebase those bits.
Did it work fine on xapic otherwise?
Ingo
---------------->
>From 97918fc3a0e1a31407df298392a12451b289ed1f Mon Sep 17 00:00:00 2001
From: Suresh Siddha <suresh.b.siddha@intel.com>
Date: Wed, 28 Jan 2009 17:52:57 -0800
Subject: [PATCH] x86: remove mach_apic.h, fix
Use apic_read() instead of open-coded mmio.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/genapic.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h
index 4bbcf26..273b994 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -145,7 +145,7 @@ static inline unsigned int read_apic_id(void)
{
unsigned int reg;
- reg = *(u32 *)(APIC_BASE + APIC_ID);
+ reg = apic_read(APIC_ID);
return apic->get_apic_id(reg);
}
^ permalink raw reply related [flat|nested] 134+ messages in thread* Re: x86: unify genapic code, unify subarchitectures, remove old subarchitecture code
2009-01-29 11:27 ` Ingo Molnar
@ 2009-01-29 20:11 ` Suresh Siddha
2009-01-29 20:26 ` Ingo Molnar
0 siblings, 1 reply; 134+ messages in thread
From: Suresh Siddha @ 2009-01-29 20:11 UTC (permalink / raw)
To: Ingo Molnar
Cc: Siddha, Suresh B, linux-kernel@vger.kernel.org, H. Peter Anvin,
Thomas Gleixner
On Thu, Jan 29, 2009 at 03:27:00AM -0800, Ingo Molnar wrote:
> Did it work fine on xapic otherwise?
xapic fix for 32bit platform with less than 8 cpu's appended. Thanks.
---
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
---
diff --git a/arch/x86/kernel/probe_32.c b/arch/x86/kernel/probe_32.c
index 61339a0..b5db26f 100644
--- a/arch/x86/kernel/probe_32.c
+++ b/arch/x86/kernel/probe_32.c
@@ -113,7 +113,7 @@ struct genapic apic_default = {
.cpu_mask_to_apicid_and = default_cpu_mask_to_apicid_and,
.send_IPI_mask = default_send_IPI_mask,
- .send_IPI_mask_allbutself = NULL,
+ .send_IPI_mask_allbutself = default_send_IPI_mask_allbutself,
.send_IPI_allbutself = default_send_IPI_allbutself,
.send_IPI_all = default_send_IPI_all,
.send_IPI_self = NULL,
^ permalink raw reply related [flat|nested] 134+ messages in thread* Re: x86: unify genapic code, unify subarchitectures, remove old subarchitecture code
2009-01-29 20:11 ` Suresh Siddha
@ 2009-01-29 20:26 ` Ingo Molnar
0 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-29 20:26 UTC (permalink / raw)
To: Suresh Siddha
Cc: linux-kernel@vger.kernel.org, H. Peter Anvin, Thomas Gleixner
* Suresh Siddha <suresh.b.siddha@intel.com> wrote:
> On Thu, Jan 29, 2009 at 03:27:00AM -0800, Ingo Molnar wrote:
> > Did it work fine on xapic otherwise?
>
> xapic fix for 32bit platform with less than 8 cpu's appended. Thanks.
> ---
>
> Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
> ---
> diff --git a/arch/x86/kernel/probe_32.c b/arch/x86/kernel/probe_32.c
> index 61339a0..b5db26f 100644
> --- a/arch/x86/kernel/probe_32.c
> +++ b/arch/x86/kernel/probe_32.c
> @@ -113,7 +113,7 @@ struct genapic apic_default = {
> .cpu_mask_to_apicid_and = default_cpu_mask_to_apicid_and,
>
> .send_IPI_mask = default_send_IPI_mask,
> - .send_IPI_mask_allbutself = NULL,
> + .send_IPI_mask_allbutself = default_send_IPI_mask_allbutself,
> .send_IPI_allbutself = default_send_IPI_allbutself,
> .send_IPI_all = default_send_IPI_all,
> .send_IPI_self = NULL,
applied to tip/x86/apic, thanks Suresh!
Ingo
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: x86: unify genapic code, unify subarchitectures, remove old subarchitecture code
2009-01-28 23:41 x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Ingo Molnar
` (114 preceding siblings ...)
2009-01-29 1:52 ` x86: unify genapic code, unify subarchitectures, remove old subarchitecture code Suresh Siddha
@ 2009-01-29 14:02 ` Andi Kleen
2009-01-29 20:36 ` Yinghai Lu
` (2 more replies)
115 siblings, 3 replies; 134+ messages in thread
From: Andi Kleen @ 2009-01-29 14:02 UTC (permalink / raw)
To: Ingo Molnar; +Cc: linux-kernel, H. Peter Anvin, Thomas Gleixner
Ingo Molnar <mingo@elte.hu> writes:
>
> 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 haven't read it all, but the stuff I looked at looked
all reasonable and indeed cleaned up the 32bit code significantly
(and be neutral on 64bit). Thanks for doing that work.
My suggestion would be to deprecate and then remove es7000 and
numaq too. The es7000 subarch is only for very old es7000 systems (the
newer ones all work with bigsmp) and I expect the user base is very
likely zero or very near it. For NUMAQ it's similar -- there's
apparently one system left at IBM, and I'm sure IBM can find some
replacement. Especially NUMAQ has some ugly ifdefery outside the
subarch code too that would be good to remove. Overall that would
be a good cleanup without impacting the user base really.
Also bigsmp is kind of obsolete too, it could be probably
merged with default with very tiny impact because it's not
all that different.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
^ permalink raw reply [flat|nested] 134+ messages in thread* Re: x86: unify genapic code, unify subarchitectures, remove old subarchitecture code
2009-01-29 14:02 ` Andi Kleen
@ 2009-01-29 20:36 ` Yinghai Lu
2009-01-29 21:04 ` H. Peter Anvin
2009-01-29 21:24 ` Tim Pepper
2009-01-29 22:29 ` Ingo Molnar
2 siblings, 1 reply; 134+ messages in thread
From: Yinghai Lu @ 2009-01-29 20:36 UTC (permalink / raw)
To: Andi Kleen; +Cc: Ingo Molnar, linux-kernel, H. Peter Anvin, Thomas Gleixner
On Thu, Jan 29, 2009 at 6:02 AM, Andi Kleen <andi@firstfloor.org> wrote:
> Also bigsmp is kind of obsolete too, it could be probably
> merged with default with very tiny impact because it's not
> all that different.
yes bigsmp should not be treated non-standard.
YH
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: x86: unify genapic code, unify subarchitectures, remove old subarchitecture code
2009-01-29 20:36 ` Yinghai Lu
@ 2009-01-29 21:04 ` H. Peter Anvin
0 siblings, 0 replies; 134+ messages in thread
From: H. Peter Anvin @ 2009-01-29 21:04 UTC (permalink / raw)
To: Yinghai Lu; +Cc: Andi Kleen, Ingo Molnar, linux-kernel, Thomas Gleixner
Yinghai Lu wrote:
> On Thu, Jan 29, 2009 at 6:02 AM, Andi Kleen <andi@firstfloor.org> wrote:
>> Also bigsmp is kind of obsolete too, it could be probably
>> merged with default with very tiny impact because it's not
>> all that different.
>
> yes bigsmp should not be treated non-standard.
>
Yes, but one step at a time, please. First let's clean up the subarch
mess, and then we can worry about reunifying the operations that remain.
-hpa
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: x86: unify genapic code, unify subarchitectures, remove old subarchitecture code
2009-01-29 14:02 ` Andi Kleen
2009-01-29 20:36 ` Yinghai Lu
@ 2009-01-29 21:24 ` Tim Pepper
2009-01-29 22:14 ` Ingo Molnar
2009-01-29 22:29 ` Ingo Molnar
2 siblings, 1 reply; 134+ messages in thread
From: Tim Pepper @ 2009-01-29 21:24 UTC (permalink / raw)
To: Andi Kleen; +Cc: Ingo Molnar, linux-kernel, H. Peter Anvin, Thomas Gleixner
On Thu, Jan 29, 2009 at 6:02 AM, Andi Kleen <andi@firstfloor.org> wrote:
> My suggestion would be to deprecate and then remove es7000 and
> numaq too. The es7000 subarch is only for very old es7000 systems (the
> newer ones all work with bigsmp) and I expect the user base is very
> likely zero or very near it. For NUMAQ it's similar -- there's
> apparently one system left at IBM, and I'm sure IBM can find some
> replacement. Especially NUMAQ has some ugly ifdefery outside the
> subarch code too that would be good to remove. Overall that would
> be a good cleanup without impacting the user base really.
The machines (yes plural!) on which we had regular testing happening
have been offline for a few months due to some broader dependencies
(eg: console server in the old product used an old version of windows
that doesn't meet the corporate security standards) and we've just not
managed to get past that. That in turn is in the way of debugging
boot issues with newer kernels. At this point the most passionate
Sequent/IBMers caring about the NUMAQ support are resigned to it being
a lost cause.
The main benefit to carrying NUMAQ support along this long was these
machines had a knack for triggering real bugs. But since there's no
active bug testing happening on them now and it doesn't look like
there will be...
RIP NUMAQ! (sorry dhansen and apw :)
I believe in the past there've been some let's kill off NUMAQ patches
floated...if anybody has something that applies, go for it. Else
we'll post something shortly.
Tim
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: x86: unify genapic code, unify subarchitectures, remove old subarchitecture code
2009-01-29 21:24 ` Tim Pepper
@ 2009-01-29 22:14 ` Ingo Molnar
2009-01-29 22:19 ` Valdis.Kletnieks
` (2 more replies)
0 siblings, 3 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-29 22:14 UTC (permalink / raw)
To: Tim Pepper; +Cc: Andi Kleen, linux-kernel, H. Peter Anvin, Thomas Gleixner
* Tim Pepper <lnxninja@linux.vnet.ibm.com> wrote:
> The machines (yes plural!) on which we had regular testing happening
> have been offline for a few months due to some broader dependencies (eg:
> console server in the old product used an old version of windows that
> doesn't meet the corporate security standards) and we've just not
> managed to get past that. That in turn is in the way of debugging boot
> issues with newer kernels. At this point the most passionate
> Sequent/IBMers caring about the NUMAQ support are resigned to it being a
> lost cause.
>
> The main benefit to carrying NUMAQ support along this long was these
> machines had a knack for triggering real bugs. But since there's no
> active bug testing happening on them now and it doesn't look like there
> will be...
At this point there's no technical need to kill it - it's a zero-overhead
thing tucked away into a single .c module in arch/x86/kernel/numaq_32.c. I
even consolidated most of its headers in that file, to reduce its cross
section.
That was the main point of the restructuring i did - subarchitectures were
causing ongoing maintenance overhead before. That overhead is practically
zero now.
So two days ago it might have made some sense to rip out this code - now
there's no pressing need really. We can remove it in a few years once the
last beep has been received from those platforms. The numaq code is now
quite similar to an old driver in drivers/* - there's no real downside
from having it around.
Ingo
^ permalink raw reply [flat|nested] 134+ messages in thread* Re: x86: unify genapic code, unify subarchitectures, remove old subarchitecture code
2009-01-29 22:14 ` Ingo Molnar
@ 2009-01-29 22:19 ` Valdis.Kletnieks
2009-01-29 22:58 ` Tim Pepper
2009-01-30 9:01 ` Andi Kleen
2 siblings, 0 replies; 134+ messages in thread
From: Valdis.Kletnieks @ 2009-01-29 22:19 UTC (permalink / raw)
To: Ingo Molnar
Cc: Tim Pepper, Andi Kleen, linux-kernel, H. Peter Anvin,
Thomas Gleixner
[-- Attachment #1: Type: text/plain, Size: 517 bytes --]
On Thu, 29 Jan 2009 23:14:02 +0100, Ingo Molnar said:
> So two days ago it might have made some sense to rip out this code - now
> there's no pressing need really. We can remove it in a few years once the
> last beep has been received from those platforms. The numaq code is now
> quite similar to an old driver in drivers/* - there's no real downside
> from having it around.
Eventually, somebody will end up submitting a patch that adds the almost
inevitable 'depends on BROKEN' to the appropriate Kconfig...
[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: x86: unify genapic code, unify subarchitectures, remove old subarchitecture code
2009-01-29 22:14 ` Ingo Molnar
2009-01-29 22:19 ` Valdis.Kletnieks
@ 2009-01-29 22:58 ` Tim Pepper
2009-01-29 23:27 ` Ingo Molnar
2009-01-30 9:01 ` Andi Kleen
2 siblings, 1 reply; 134+ messages in thread
From: Tim Pepper @ 2009-01-29 22:58 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Andi Kleen, linux-kernel, H. Peter Anvin, Thomas Gleixner
On Thu, Jan 29, 2009 at 2:14 PM, Ingo Molnar <mingo@elte.hu> wrote:
> At this point there's no technical need to kill it - it's a zero-overhead
> thing tucked away into a single .c module in arch/x86/kernel/numaq_32.c. I
> even consolidated most of its headers in that file, to reduce its cross
> section.
Wish we'd have piped up earlier to save you a bit of work.
> So two days ago it might have made some sense to rip out this code - now
> there's no pressing need really. We can remove it in a few years once the
> last beep has been received from those platforms. The numaq code is now
> quite similar to an old driver in drivers/* - there's no real downside
> from having it around.
We can make the NUMAQ's beep still, if not boot. :)
Reality is they're just not worth the effort any more and there's no
sign of anybody else having them. Assuming your code goes in for
2.6.30 it'll be easy to drop NUMAQ support. Even if there's not much
downside there's also not much reason to leave it in but marked
deprecated/broken.
Tim
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: x86: unify genapic code, unify subarchitectures, remove old subarchitecture code
2009-01-29 22:58 ` Tim Pepper
@ 2009-01-29 23:27 ` Ingo Molnar
0 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-29 23:27 UTC (permalink / raw)
To: Tim Pepper; +Cc: Andi Kleen, linux-kernel, H. Peter Anvin, Thomas Gleixner
* Tim Pepper <lnxninja@linux.vnet.ibm.com> wrote:
> On Thu, Jan 29, 2009 at 2:14 PM, Ingo Molnar <mingo@elte.hu> wrote:
> > At this point there's no technical need to kill it - it's a
> > zero-overhead thing tucked away into a single .c module in
> > arch/x86/kernel/numaq_32.c. I even consolidated most of its headers in
> > that file, to reduce its cross section.
>
> Wish we'd have piped up earlier to save you a bit of work.
Well bigsmp wasnt going to go away anytime soon so the de-subarching and
unification work had to be done anyway. NUMAQ came along for the ride ;-)
I've got some more restructuring plans in this area so the time was well
spent in any case.
> We can make the NUMAQ's beep still, if not boot. :)
>
> Reality is they're just not worth the effort any more and there's no
> sign of anybody else having them. Assuming your code goes in for 2.6.30
> it'll be easy to drop NUMAQ support. Even if there's not much downside
> there's also not much reason to leave it in but marked
> deprecated/broken.
Yes, unless there's major stability problems with the x86/apic branch
we'll merge it into v2.6.30. NUMAQ is a single .c module now
(default-disabled) so not much of a concern.
Ingo
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: x86: unify genapic code, unify subarchitectures, remove old subarchitecture code
2009-01-29 22:14 ` Ingo Molnar
2009-01-29 22:19 ` Valdis.Kletnieks
2009-01-29 22:58 ` Tim Pepper
@ 2009-01-30 9:01 ` Andi Kleen
2 siblings, 0 replies; 134+ messages in thread
From: Andi Kleen @ 2009-01-30 9:01 UTC (permalink / raw)
To: Ingo Molnar
Cc: Tim Pepper, Andi Kleen, linux-kernel, H. Peter Anvin,
Thomas Gleixner
> At this point there's no technical need to kill it - it's a zero-overhead
> thing tucked away into a single .c module in arch/x86/kernel/numaq_32.c. I
> even consolidated most of its headers in that file, to reduce its cross
> section.
There's still a couple of hooks in the subarch interface (even your new one)
which are effectively NUMAQ only. These are far from zero overhead. Plus the
ugly wards in smpboot.c like the special path to wake up CPUs via NMI and
some other things. And the hacks like the special ECR access. NUMAQ is really
very very different from a normal PC and needed a lot of special code.
Even with your changes removing NUMAQ would be a significant cleanup.
Also BTW if it hasn't been tested it's unlikely to work and
keeping code around that doesn't work doesn't seem very useful.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: x86: unify genapic code, unify subarchitectures, remove old subarchitecture code
2009-01-29 14:02 ` Andi Kleen
2009-01-29 20:36 ` Yinghai Lu
2009-01-29 21:24 ` Tim Pepper
@ 2009-01-29 22:29 ` Ingo Molnar
2 siblings, 0 replies; 134+ messages in thread
From: Ingo Molnar @ 2009-01-29 22:29 UTC (permalink / raw)
To: Andi Kleen; +Cc: linux-kernel, H. Peter Anvin, Thomas Gleixner
* Andi Kleen <andi@firstfloor.org> wrote:
> Also bigsmp is kind of obsolete too, it could be probably
> merged with default with very tiny impact because it's not
> all that different.
i dont think you have understood the driving principle behind this
restructuring and unification.
The whole _point_ of the apic driver infrastructure is to use it for
dissimilar APIC modes.
In the future we'll create _more_ of them, not less - so that we can
remove runtime conditionals from the drivers and that we can use the APIC
driver for the hardware that is the most efficient.
For example, the apic_default driver (which is used if all APIC IDs are
between 0 and 7 - which is the majority of current hardware), is more
efficient at sending IPIs, because it can send a broadcast IPI (used for
TLB flushes for example) as a single IPI.
The apic_bigsmp driver on the other hand has to use a 'serialized'
sequence of IPIs, to each CPU separately. That is less efficient,
especially for something as performance-sensitive as TLB flushes.
To "unify" the ability of apic_bigsmp to deal with APIC IDs >= 8 with the
more efficient logical addressing mode of apc_default is possible but ugly
- we'd have to add runtime checks and flip between the two methods. What
So what you call "very tiny impact" is in reality unnecessary and
avoidable overhead.
Ingo
^ permalink raw reply [flat|nested] 134+ messages in thread