diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-07-18 17:00:05 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-18 17:00:05 -0400 |
commit | 453c1404c5273a30d715e5a83372a78cff70b6d9 (patch) | |
tree | 94a5a3abd85137c4def416a84a45989751260f20 /include | |
parent | a208f37a465e222218974ab20a31b42b7b4893b2 (diff) | |
parent | 35b680557f95564f70f21a8d3f5c72e101fab260 (diff) |
Merge branch 'x86/apic' into x86/x2apic
Conflicts:
arch/x86/kernel/paravirt.c
arch/x86/kernel/smpboot.c
arch/x86/kernel/vmi_32.c
arch/x86/lguest/boot.c
arch/x86/xen/enlighten.c
include/asm-x86/apic.h
include/asm-x86/paravirt.h
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-x86/apic.h | 29 | ||||
-rw-r--r-- | include/asm-x86/cpufeature.h | 1 | ||||
-rw-r--r-- | include/asm-x86/mach-bigsmp/mach_apic.h | 4 | ||||
-rw-r--r-- | include/asm-x86/mach-default/mach_apic.h | 4 | ||||
-rw-r--r-- | include/asm-x86/mach-es7000/mach_apic.h | 4 | ||||
-rw-r--r-- | include/asm-x86/mach-summit/mach_apic.h | 4 |
6 files changed, 18 insertions, 28 deletions
diff --git a/include/asm-x86/apic.h b/include/asm-x86/apic.h index fcd2f01277b6..300b65e57240 100644 --- a/include/asm-x86/apic.h +++ b/include/asm-x86/apic.h | |||
@@ -3,6 +3,8 @@ | |||
3 | 3 | ||
4 | #include <linux/pm.h> | 4 | #include <linux/pm.h> |
5 | #include <linux/delay.h> | 5 | #include <linux/delay.h> |
6 | |||
7 | #include <asm/alternative.h> | ||
6 | #include <asm/fixmap.h> | 8 | #include <asm/fixmap.h> |
7 | #include <asm/apicdef.h> | 9 | #include <asm/apicdef.h> |
8 | #include <asm/processor.h> | 10 | #include <asm/processor.h> |
@@ -12,7 +14,7 @@ | |||
12 | 14 | ||
13 | #define ARCH_APICTIMER_STOPS_ON_C3 1 | 15 | #define ARCH_APICTIMER_STOPS_ON_C3 1 |
14 | 16 | ||
15 | #define Dprintk(x...) | 17 | #define Dprintk printk |
16 | 18 | ||
17 | /* | 19 | /* |
18 | * Debugging macros | 20 | * Debugging macros |
@@ -37,7 +39,7 @@ extern void generic_apic_probe(void); | |||
37 | 39 | ||
38 | #ifdef CONFIG_X86_LOCAL_APIC | 40 | #ifdef CONFIG_X86_LOCAL_APIC |
39 | 41 | ||
40 | extern int apic_verbosity; | 42 | extern unsigned int apic_verbosity; |
41 | extern int local_apic_timer_c2_ok; | 43 | extern int local_apic_timer_c2_ok; |
42 | 44 | ||
43 | extern int ioapic_force; | 45 | extern int ioapic_force; |
@@ -57,12 +59,11 @@ extern int is_vsmp_box(void); | |||
57 | 59 | ||
58 | static inline void native_apic_mem_write(u32 reg, u32 v) | 60 | static inline void native_apic_mem_write(u32 reg, u32 v) |
59 | { | 61 | { |
60 | *((volatile u32 *)(APIC_BASE + reg)) = v; | 62 | volatile u32 *addr = (volatile u32 *)(APIC_BASE + reg); |
61 | } | ||
62 | 63 | ||
63 | static inline void native_apic_mem_write_atomic(u32 reg, u32 v) | 64 | alternative_io("movl %0, %1", "xchgl %0, %1", X86_FEATURE_11AP, |
64 | { | 65 | ASM_OUTPUT2("=r" (v), "=m" (*addr)), |
65 | (void)xchg((u32 *)(APIC_BASE + reg), v); | 66 | ASM_OUTPUT2("0" (v), "m" (*addr))); |
66 | } | 67 | } |
67 | 68 | ||
68 | static inline u32 native_apic_mem_read(u32 reg) | 69 | static inline u32 native_apic_mem_read(u32 reg) |
@@ -101,7 +102,6 @@ extern void x2apic_icr_write(u32 low, u32 id); | |||
101 | struct apic_ops { | 102 | struct apic_ops { |
102 | u32 (*read)(u32 reg); | 103 | u32 (*read)(u32 reg); |
103 | void (*write)(u32 reg, u32 v); | 104 | void (*write)(u32 reg, u32 v); |
104 | void (*write_atomic)(u32 reg, u32 v); | ||
105 | u64 (*icr_read)(void); | 105 | u64 (*icr_read)(void); |
106 | void (*icr_write)(u32 low, u32 high); | 106 | void (*icr_write)(u32 low, u32 high); |
107 | void (*wait_icr_idle)(void); | 107 | void (*wait_icr_idle)(void); |
@@ -112,7 +112,6 @@ extern struct apic_ops *apic_ops; | |||
112 | 112 | ||
113 | #define apic_read (apic_ops->read) | 113 | #define apic_read (apic_ops->read) |
114 | #define apic_write (apic_ops->write) | 114 | #define apic_write (apic_ops->write) |
115 | #define apic_write_atomic (apic_ops->write_atomic) | ||
116 | #define apic_icr_read (apic_ops->icr_read) | 115 | #define apic_icr_read (apic_ops->icr_read) |
117 | #define apic_icr_write (apic_ops->icr_write) | 116 | #define apic_icr_write (apic_ops->icr_write) |
118 | #define apic_wait_icr_idle (apic_ops->wait_icr_idle) | 117 | #define apic_wait_icr_idle (apic_ops->wait_icr_idle) |
@@ -120,16 +119,6 @@ extern struct apic_ops *apic_ops; | |||
120 | 119 | ||
121 | extern int get_physical_broadcast(void); | 120 | extern int get_physical_broadcast(void); |
122 | 121 | ||
123 | #ifdef CONFIG_X86_GOOD_APIC | ||
124 | # define FORCE_READ_AROUND_WRITE 0 | ||
125 | # define apic_read_around(x) | ||
126 | # define apic_write_around(x, y) apic_write((x), (y)) | ||
127 | #else | ||
128 | # define FORCE_READ_AROUND_WRITE 1 | ||
129 | # define apic_read_around(x) apic_read(x) | ||
130 | # define apic_write_around(x, y) apic_write_atomic((x), (y)) | ||
131 | #endif | ||
132 | |||
133 | #ifdef CONFIG_X86_64 | 122 | #ifdef CONFIG_X86_64 |
134 | static inline void ack_x2APIC_irq(void) | 123 | static inline void ack_x2APIC_irq(void) |
135 | { | 124 | { |
@@ -150,7 +139,7 @@ static inline void ack_APIC_irq(void) | |||
150 | 139 | ||
151 | /* Docs say use 0 for future compatibility */ | 140 | /* Docs say use 0 for future compatibility */ |
152 | #ifdef CONFIG_X86_32 | 141 | #ifdef CONFIG_X86_32 |
153 | apic_write_around(APIC_EOI, 0); | 142 | apic_write(APIC_EOI, 0); |
154 | #else | 143 | #else |
155 | native_apic_mem_write(APIC_EOI, 0); | 144 | native_apic_mem_write(APIC_EOI, 0); |
156 | #endif | 145 | #endif |
diff --git a/include/asm-x86/cpufeature.h b/include/asm-x86/cpufeature.h index 5be9510ee012..89a7af37e37e 100644 --- a/include/asm-x86/cpufeature.h +++ b/include/asm-x86/cpufeature.h | |||
@@ -79,6 +79,7 @@ | |||
79 | #define X86_FEATURE_REP_GOOD (3*32+16) /* rep microcode works well on this CPU */ | 79 | #define X86_FEATURE_REP_GOOD (3*32+16) /* rep microcode works well on this CPU */ |
80 | #define X86_FEATURE_MFENCE_RDTSC (3*32+17) /* Mfence synchronizes RDTSC */ | 80 | #define X86_FEATURE_MFENCE_RDTSC (3*32+17) /* Mfence synchronizes RDTSC */ |
81 | #define X86_FEATURE_LFENCE_RDTSC (3*32+18) /* Lfence synchronizes RDTSC */ | 81 | #define X86_FEATURE_LFENCE_RDTSC (3*32+18) /* Lfence synchronizes RDTSC */ |
82 | #define X86_FEATURE_11AP (3*32+19) /* Bad local APIC aka 11AP */ | ||
82 | 83 | ||
83 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ | 84 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ |
84 | #define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ | 85 | #define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ |
diff --git a/include/asm-x86/mach-bigsmp/mach_apic.h b/include/asm-x86/mach-bigsmp/mach_apic.h index 017c8c19ad8f..c3b9dc6970c9 100644 --- a/include/asm-x86/mach-bigsmp/mach_apic.h +++ b/include/asm-x86/mach-bigsmp/mach_apic.h | |||
@@ -63,9 +63,9 @@ static inline void init_apic_ldr(void) | |||
63 | unsigned long val; | 63 | unsigned long val; |
64 | int cpu = smp_processor_id(); | 64 | int cpu = smp_processor_id(); |
65 | 65 | ||
66 | apic_write_around(APIC_DFR, APIC_DFR_VALUE); | 66 | apic_write(APIC_DFR, APIC_DFR_VALUE); |
67 | val = calculate_ldr(cpu); | 67 | val = calculate_ldr(cpu); |
68 | apic_write_around(APIC_LDR, val); | 68 | apic_write(APIC_LDR, val); |
69 | } | 69 | } |
70 | 70 | ||
71 | static inline void setup_apic_routing(void) | 71 | static inline void setup_apic_routing(void) |
diff --git a/include/asm-x86/mach-default/mach_apic.h b/include/asm-x86/mach-default/mach_apic.h index 3d2b455581ec..e7ff8ac6abc5 100644 --- a/include/asm-x86/mach-default/mach_apic.h +++ b/include/asm-x86/mach-default/mach_apic.h | |||
@@ -48,10 +48,10 @@ static inline void init_apic_ldr(void) | |||
48 | { | 48 | { |
49 | unsigned long val; | 49 | unsigned long val; |
50 | 50 | ||
51 | apic_write_around(APIC_DFR, APIC_DFR_VALUE); | 51 | apic_write(APIC_DFR, APIC_DFR_VALUE); |
52 | val = apic_read(APIC_LDR) & ~APIC_LDR_MASK; | 52 | val = apic_read(APIC_LDR) & ~APIC_LDR_MASK; |
53 | val |= SET_APIC_LOGICAL_ID(1UL << smp_processor_id()); | 53 | val |= SET_APIC_LOGICAL_ID(1UL << smp_processor_id()); |
54 | apic_write_around(APIC_LDR, val); | 54 | apic_write(APIC_LDR, val); |
55 | } | 55 | } |
56 | 56 | ||
57 | static inline int apic_id_registered(void) | 57 | static inline int apic_id_registered(void) |
diff --git a/include/asm-x86/mach-es7000/mach_apic.h b/include/asm-x86/mach-es7000/mach_apic.h index b3556ec3bca5..63b4d9c189bf 100644 --- a/include/asm-x86/mach-es7000/mach_apic.h +++ b/include/asm-x86/mach-es7000/mach_apic.h | |||
@@ -66,9 +66,9 @@ static inline void init_apic_ldr(void) | |||
66 | unsigned long val; | 66 | unsigned long val; |
67 | int cpu = smp_processor_id(); | 67 | int cpu = smp_processor_id(); |
68 | 68 | ||
69 | apic_write_around(APIC_DFR, APIC_DFR_VALUE); | 69 | apic_write(APIC_DFR, APIC_DFR_VALUE); |
70 | val = calculate_ldr(cpu); | 70 | val = calculate_ldr(cpu); |
71 | apic_write_around(APIC_LDR, val); | 71 | apic_write(APIC_LDR, val); |
72 | } | 72 | } |
73 | 73 | ||
74 | #ifndef CONFIG_X86_GENERICARCH | 74 | #ifndef CONFIG_X86_GENERICARCH |
diff --git a/include/asm-x86/mach-summit/mach_apic.h b/include/asm-x86/mach-summit/mach_apic.h index 1f76c2e70232..75d2c95005d7 100644 --- a/include/asm-x86/mach-summit/mach_apic.h +++ b/include/asm-x86/mach-summit/mach_apic.h | |||
@@ -63,10 +63,10 @@ static inline void init_apic_ldr(void) | |||
63 | * BIOS puts 5 CPUs in one APIC cluster, we're hosed. */ | 63 | * BIOS puts 5 CPUs in one APIC cluster, we're hosed. */ |
64 | BUG_ON(count >= XAPIC_DEST_CPUS_SHIFT); | 64 | BUG_ON(count >= XAPIC_DEST_CPUS_SHIFT); |
65 | id = my_cluster | (1UL << count); | 65 | id = my_cluster | (1UL << count); |
66 | apic_write_around(APIC_DFR, APIC_DFR_VALUE); | 66 | apic_write(APIC_DFR, APIC_DFR_VALUE); |
67 | val = apic_read(APIC_LDR) & ~APIC_LDR_MASK; | 67 | val = apic_read(APIC_LDR) & ~APIC_LDR_MASK; |
68 | val |= SET_APIC_LOGICAL_ID(id); | 68 | val |= SET_APIC_LOGICAL_ID(id); |
69 | apic_write_around(APIC_LDR, val); | 69 | apic_write(APIC_LDR, val); |
70 | } | 70 | } |
71 | 71 | ||
72 | static inline int multi_timer_check(int apic, int irq) | 72 | static inline int multi_timer_check(int apic, int irq) |