diff options
Diffstat (limited to 'include/asm-x86')
-rw-r--r-- | include/asm-x86/apic.h | 24 | ||||
-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 | ||||
-rw-r--r-- | include/asm-x86/paravirt.h | 6 |
7 files changed, 16 insertions, 31 deletions
diff --git a/include/asm-x86/apic.h b/include/asm-x86/apic.h index 4e2c1e517f06..ea866baccefc 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> |
@@ -48,7 +50,6 @@ extern int disable_apic; | |||
48 | #include <asm/paravirt.h> | 50 | #include <asm/paravirt.h> |
49 | #else | 51 | #else |
50 | #define apic_write native_apic_write | 52 | #define apic_write native_apic_write |
51 | #define apic_write_atomic native_apic_write_atomic | ||
52 | #define apic_read native_apic_read | 53 | #define apic_read native_apic_read |
53 | #define setup_boot_clock setup_boot_APIC_clock | 54 | #define setup_boot_clock setup_boot_APIC_clock |
54 | #define setup_secondary_clock setup_secondary_APIC_clock | 55 | #define setup_secondary_clock setup_secondary_APIC_clock |
@@ -58,12 +59,11 @@ extern int is_vsmp_box(void); | |||
58 | 59 | ||
59 | static inline void native_apic_write(unsigned long reg, u32 v) | 60 | static inline void native_apic_write(unsigned long reg, u32 v) |
60 | { | 61 | { |
61 | *((volatile u32 *)(APIC_BASE + reg)) = v; | 62 | volatile u32 *addr = (volatile u32 *)(APIC_BASE + reg); |
62 | } | ||
63 | 63 | ||
64 | static inline void native_apic_write_atomic(unsigned long reg, u32 v) | 64 | alternative_io("movl %0, %1", "xchgl %0, %1", X86_FEATURE_11AP, |
65 | { | 65 | ASM_OUTPUT2("=r" (v), "=m" (*addr)), |
66 | (void)xchg((u32 *)(APIC_BASE + reg), v); | 66 | ASM_OUTPUT2("0" (v), "m" (*addr))); |
67 | } | 67 | } |
68 | 68 | ||
69 | static inline u32 native_apic_read(unsigned long reg) | 69 | static inline u32 native_apic_read(unsigned long reg) |
@@ -75,16 +75,6 @@ extern void apic_wait_icr_idle(void); | |||
75 | extern u32 safe_apic_wait_icr_idle(void); | 75 | extern u32 safe_apic_wait_icr_idle(void); |
76 | extern int get_physical_broadcast(void); | 76 | extern int get_physical_broadcast(void); |
77 | 77 | ||
78 | #ifdef CONFIG_X86_GOOD_APIC | ||
79 | # define FORCE_READ_AROUND_WRITE 0 | ||
80 | # define apic_read_around(x) | ||
81 | # define apic_write_around(x, y) apic_write((x), (y)) | ||
82 | #else | ||
83 | # define FORCE_READ_AROUND_WRITE 1 | ||
84 | # define apic_read_around(x) apic_read(x) | ||
85 | # define apic_write_around(x, y) apic_write_atomic((x), (y)) | ||
86 | #endif | ||
87 | |||
88 | static inline void ack_APIC_irq(void) | 78 | static inline void ack_APIC_irq(void) |
89 | { | 79 | { |
90 | /* | 80 | /* |
@@ -95,7 +85,7 @@ static inline void ack_APIC_irq(void) | |||
95 | */ | 85 | */ |
96 | 86 | ||
97 | /* Docs say use 0 for future compatibility */ | 87 | /* Docs say use 0 for future compatibility */ |
98 | apic_write_around(APIC_EOI, 0); | 88 | apic_write(APIC_EOI, 0); |
99 | } | 89 | } |
100 | 90 | ||
101 | extern int lapic_get_maxlvt(void); | 91 | extern int lapic_get_maxlvt(void); |
diff --git a/include/asm-x86/cpufeature.h b/include/asm-x86/cpufeature.h index 75ef959db329..2f5a792b0acc 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 0b2cde5e1b74..f3226b9a6b82 100644 --- a/include/asm-x86/mach-default/mach_apic.h +++ b/include/asm-x86/mach-default/mach_apic.h | |||
@@ -46,10 +46,10 @@ static inline void init_apic_ldr(void) | |||
46 | { | 46 | { |
47 | unsigned long val; | 47 | unsigned long val; |
48 | 48 | ||
49 | apic_write_around(APIC_DFR, APIC_DFR_VALUE); | 49 | apic_write(APIC_DFR, APIC_DFR_VALUE); |
50 | val = apic_read(APIC_LDR) & ~APIC_LDR_MASK; | 50 | val = apic_read(APIC_LDR) & ~APIC_LDR_MASK; |
51 | val |= SET_APIC_LOGICAL_ID(1UL << smp_processor_id()); | 51 | val |= SET_APIC_LOGICAL_ID(1UL << smp_processor_id()); |
52 | apic_write_around(APIC_LDR, val); | 52 | apic_write(APIC_LDR, val); |
53 | } | 53 | } |
54 | 54 | ||
55 | static inline int apic_id_registered(void) | 55 | 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 fbc8ad256f5a..0a3fdf930672 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) |
diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h index ef5e8ec6a6ab..719d959d0bc4 100644 --- a/include/asm-x86/paravirt.h +++ b/include/asm-x86/paravirt.h | |||
@@ -205,7 +205,6 @@ struct pv_apic_ops { | |||
205 | * these shouldn't be in this interface. | 205 | * these shouldn't be in this interface. |
206 | */ | 206 | */ |
207 | void (*apic_write)(unsigned long reg, u32 v); | 207 | void (*apic_write)(unsigned long reg, u32 v); |
208 | void (*apic_write_atomic)(unsigned long reg, u32 v); | ||
209 | u32 (*apic_read)(unsigned long reg); | 208 | u32 (*apic_read)(unsigned long reg); |
210 | void (*setup_boot_clock)(void); | 209 | void (*setup_boot_clock)(void); |
211 | void (*setup_secondary_clock)(void); | 210 | void (*setup_secondary_clock)(void); |
@@ -896,11 +895,6 @@ static inline void apic_write(unsigned long reg, u32 v) | |||
896 | PVOP_VCALL2(pv_apic_ops.apic_write, reg, v); | 895 | PVOP_VCALL2(pv_apic_ops.apic_write, reg, v); |
897 | } | 896 | } |
898 | 897 | ||
899 | static inline void apic_write_atomic(unsigned long reg, u32 v) | ||
900 | { | ||
901 | PVOP_VCALL2(pv_apic_ops.apic_write_atomic, reg, v); | ||
902 | } | ||
903 | |||
904 | static inline u32 apic_read(unsigned long reg) | 898 | static inline u32 apic_read(unsigned long reg) |
905 | { | 899 | { |
906 | return PVOP_CALL1(unsigned long, pv_apic_ops.apic_read, reg); | 900 | return PVOP_CALL1(unsigned long, pv_apic_ops.apic_read, reg); |