aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86_64/kernel/apic.c83
-rw-r--r--arch/x86_64/kernel/io_apic.c14
-rw-r--r--arch/x86_64/kernel/mce_intel.c4
-rw-r--r--arch/x86_64/kernel/smpboot.c11
-rw-r--r--include/asm-x86_64/apic.h6
5 files changed, 49 insertions, 69 deletions
diff --git a/arch/x86_64/kernel/apic.c b/arch/x86_64/kernel/apic.c
index c3239f6c22be..8fdd089fd17e 100644
--- a/arch/x86_64/kernel/apic.c
+++ b/arch/x86_64/kernel/apic.c
@@ -53,20 +53,17 @@ static void apic_pm_activate(void);
53 53
54void enable_NMI_through_LVT0 (void * dummy) 54void enable_NMI_through_LVT0 (void * dummy)
55{ 55{
56 unsigned int v, ver; 56 unsigned int v;
57 57
58 ver = apic_read(APIC_LVR);
59 ver = GET_APIC_VERSION(ver);
60 v = APIC_DM_NMI; /* unmask and set to NMI */ 58 v = APIC_DM_NMI; /* unmask and set to NMI */
61 apic_write_around(APIC_LVT0, v); 59 apic_write(APIC_LVT0, v);
62} 60}
63 61
64int get_maxlvt(void) 62int get_maxlvt(void)
65{ 63{
66 unsigned int v, ver, maxlvt; 64 unsigned int v, maxlvt;
67 65
68 v = apic_read(APIC_LVR); 66 v = apic_read(APIC_LVR);
69 ver = GET_APIC_VERSION(v);
70 maxlvt = GET_APIC_MAXLVT(v); 67 maxlvt = GET_APIC_MAXLVT(v);
71 return maxlvt; 68 return maxlvt;
72} 69}
@@ -84,33 +81,33 @@ void clear_local_APIC(void)
84 */ 81 */
85 if (maxlvt >= 3) { 82 if (maxlvt >= 3) {
86 v = ERROR_APIC_VECTOR; /* any non-zero vector will do */ 83 v = ERROR_APIC_VECTOR; /* any non-zero vector will do */
87 apic_write_around(APIC_LVTERR, v | APIC_LVT_MASKED); 84 apic_write(APIC_LVTERR, v | APIC_LVT_MASKED);
88 } 85 }
89 /* 86 /*
90 * Careful: we have to set masks only first to deassert 87 * Careful: we have to set masks only first to deassert
91 * any level-triggered sources. 88 * any level-triggered sources.
92 */ 89 */
93 v = apic_read(APIC_LVTT); 90 v = apic_read(APIC_LVTT);
94 apic_write_around(APIC_LVTT, v | APIC_LVT_MASKED); 91 apic_write(APIC_LVTT, v | APIC_LVT_MASKED);
95 v = apic_read(APIC_LVT0); 92 v = apic_read(APIC_LVT0);
96 apic_write_around(APIC_LVT0, v | APIC_LVT_MASKED); 93 apic_write(APIC_LVT0, v | APIC_LVT_MASKED);
97 v = apic_read(APIC_LVT1); 94 v = apic_read(APIC_LVT1);
98 apic_write_around(APIC_LVT1, v | APIC_LVT_MASKED); 95 apic_write(APIC_LVT1, v | APIC_LVT_MASKED);
99 if (maxlvt >= 4) { 96 if (maxlvt >= 4) {
100 v = apic_read(APIC_LVTPC); 97 v = apic_read(APIC_LVTPC);
101 apic_write_around(APIC_LVTPC, v | APIC_LVT_MASKED); 98 apic_write(APIC_LVTPC, v | APIC_LVT_MASKED);
102 } 99 }
103 100
104 /* 101 /*
105 * Clean APIC state for other OSs: 102 * Clean APIC state for other OSs:
106 */ 103 */
107 apic_write_around(APIC_LVTT, APIC_LVT_MASKED); 104 apic_write(APIC_LVTT, APIC_LVT_MASKED);
108 apic_write_around(APIC_LVT0, APIC_LVT_MASKED); 105 apic_write(APIC_LVT0, APIC_LVT_MASKED);
109 apic_write_around(APIC_LVT1, APIC_LVT_MASKED); 106 apic_write(APIC_LVT1, APIC_LVT_MASKED);
110 if (maxlvt >= 3) 107 if (maxlvt >= 3)
111 apic_write_around(APIC_LVTERR, APIC_LVT_MASKED); 108 apic_write(APIC_LVTERR, APIC_LVT_MASKED);
112 if (maxlvt >= 4) 109 if (maxlvt >= 4)
113 apic_write_around(APIC_LVTPC, APIC_LVT_MASKED); 110 apic_write(APIC_LVTPC, APIC_LVT_MASKED);
114 v = GET_APIC_VERSION(apic_read(APIC_LVR)); 111 v = GET_APIC_VERSION(apic_read(APIC_LVR));
115 apic_write(APIC_ESR, 0); 112 apic_write(APIC_ESR, 0);
116 apic_read(APIC_ESR); 113 apic_read(APIC_ESR);
@@ -155,7 +152,7 @@ void disconnect_bsp_APIC(int virt_wire_setup)
155 value &= ~APIC_VECTOR_MASK; 152 value &= ~APIC_VECTOR_MASK;
156 value |= APIC_SPIV_APIC_ENABLED; 153 value |= APIC_SPIV_APIC_ENABLED;
157 value |= 0xf; 154 value |= 0xf;
158 apic_write_around(APIC_SPIV, value); 155 apic_write(APIC_SPIV, value);
159 156
160 if (!virt_wire_setup) { 157 if (!virt_wire_setup) {
161 /* For LVT0 make it edge triggered, active high, external and enabled */ 158 /* For LVT0 make it edge triggered, active high, external and enabled */
@@ -165,11 +162,11 @@ void disconnect_bsp_APIC(int virt_wire_setup)
165 APIC_LVT_LEVEL_TRIGGER | APIC_LVT_MASKED ); 162 APIC_LVT_LEVEL_TRIGGER | APIC_LVT_MASKED );
166 value |= APIC_LVT_REMOTE_IRR | APIC_SEND_PENDING; 163 value |= APIC_LVT_REMOTE_IRR | APIC_SEND_PENDING;
167 value = SET_APIC_DELIVERY_MODE(value, APIC_MODE_EXTINT); 164 value = SET_APIC_DELIVERY_MODE(value, APIC_MODE_EXTINT);
168 apic_write_around(APIC_LVT0, value); 165 apic_write(APIC_LVT0, value);
169 } 166 }
170 else { 167 else {
171 /* Disable LVT0 */ 168 /* Disable LVT0 */
172 apic_write_around(APIC_LVT0, APIC_LVT_MASKED); 169 apic_write(APIC_LVT0, APIC_LVT_MASKED);
173 } 170 }
174 171
175 /* For LVT1 make it edge triggered, active high, nmi and enabled */ 172 /* For LVT1 make it edge triggered, active high, nmi and enabled */
@@ -180,7 +177,7 @@ void disconnect_bsp_APIC(int virt_wire_setup)
180 APIC_LVT_LEVEL_TRIGGER | APIC_LVT_MASKED); 177 APIC_LVT_LEVEL_TRIGGER | APIC_LVT_MASKED);
181 value |= APIC_LVT_REMOTE_IRR | APIC_SEND_PENDING; 178 value |= APIC_LVT_REMOTE_IRR | APIC_SEND_PENDING;
182 value = SET_APIC_DELIVERY_MODE(value, APIC_MODE_NMI); 179 value = SET_APIC_DELIVERY_MODE(value, APIC_MODE_NMI);
183 apic_write_around(APIC_LVT1, value); 180 apic_write(APIC_LVT1, value);
184 } 181 }
185} 182}
186 183
@@ -196,7 +193,7 @@ void disable_local_APIC(void)
196 */ 193 */
197 value = apic_read(APIC_SPIV); 194 value = apic_read(APIC_SPIV);
198 value &= ~APIC_SPIV_APIC_ENABLED; 195 value &= ~APIC_SPIV_APIC_ENABLED;
199 apic_write_around(APIC_SPIV, value); 196 apic_write(APIC_SPIV, value);
200} 197}
201 198
202/* 199/*
@@ -273,7 +270,7 @@ void __init sync_Arb_IDs(void)
273 apic_wait_icr_idle(); 270 apic_wait_icr_idle();
274 271
275 apic_printk(APIC_DEBUG, "Synchronizing Arb IDs.\n"); 272 apic_printk(APIC_DEBUG, "Synchronizing Arb IDs.\n");
276 apic_write_around(APIC_ICR, APIC_DEST_ALLINC | APIC_INT_LEVELTRIG 273 apic_write(APIC_ICR, APIC_DEST_ALLINC | APIC_INT_LEVELTRIG
277 | APIC_DM_INIT); 274 | APIC_DM_INIT);
278} 275}
279 276
@@ -284,7 +281,7 @@ extern void __error_in_apic_c (void);
284 */ 281 */
285void __init init_bsp_APIC(void) 282void __init init_bsp_APIC(void)
286{ 283{
287 unsigned int value, ver; 284 unsigned int value;
288 285
289 /* 286 /*
290 * Don't do the setup now if we have a SMP BIOS as the 287 * Don't do the setup now if we have a SMP BIOS as the
@@ -294,7 +291,6 @@ void __init init_bsp_APIC(void)
294 return; 291 return;
295 292
296 value = apic_read(APIC_LVR); 293 value = apic_read(APIC_LVR);
297 ver = GET_APIC_VERSION(value);
298 294
299 /* 295 /*
300 * Do not trust the local APIC being empty at bootup. 296 * Do not trust the local APIC being empty at bootup.
@@ -309,22 +305,21 @@ void __init init_bsp_APIC(void)
309 value |= APIC_SPIV_APIC_ENABLED; 305 value |= APIC_SPIV_APIC_ENABLED;
310 value |= APIC_SPIV_FOCUS_DISABLED; 306 value |= APIC_SPIV_FOCUS_DISABLED;
311 value |= SPURIOUS_APIC_VECTOR; 307 value |= SPURIOUS_APIC_VECTOR;
312 apic_write_around(APIC_SPIV, value); 308 apic_write(APIC_SPIV, value);
313 309
314 /* 310 /*
315 * Set up the virtual wire mode. 311 * Set up the virtual wire mode.
316 */ 312 */
317 apic_write_around(APIC_LVT0, APIC_DM_EXTINT); 313 apic_write(APIC_LVT0, APIC_DM_EXTINT);
318 value = APIC_DM_NMI; 314 value = APIC_DM_NMI;
319 apic_write_around(APIC_LVT1, value); 315 apic_write(APIC_LVT1, value);
320} 316}
321 317
322void __cpuinit setup_local_APIC (void) 318void __cpuinit setup_local_APIC (void)
323{ 319{
324 unsigned int value, ver, maxlvt; 320 unsigned int value, maxlvt;
325 321
326 value = apic_read(APIC_LVR); 322 value = apic_read(APIC_LVR);
327 ver = GET_APIC_VERSION(value);
328 323
329 if ((SPURIOUS_APIC_VECTOR & 0x0f) != 0x0f) 324 if ((SPURIOUS_APIC_VECTOR & 0x0f) != 0x0f)
330 __error_in_apic_c(); 325 __error_in_apic_c();
@@ -349,7 +344,7 @@ void __cpuinit setup_local_APIC (void)
349 */ 344 */
350 value = apic_read(APIC_TASKPRI); 345 value = apic_read(APIC_TASKPRI);
351 value &= ~APIC_TPRI_MASK; 346 value &= ~APIC_TPRI_MASK;
352 apic_write_around(APIC_TASKPRI, value); 347 apic_write(APIC_TASKPRI, value);
353 348
354 /* 349 /*
355 * Now that we are all set up, enable the APIC 350 * Now that we are all set up, enable the APIC
@@ -391,7 +386,7 @@ void __cpuinit setup_local_APIC (void)
391 * Set spurious IRQ vector 386 * Set spurious IRQ vector
392 */ 387 */
393 value |= SPURIOUS_APIC_VECTOR; 388 value |= SPURIOUS_APIC_VECTOR;
394 apic_write_around(APIC_SPIV, value); 389 apic_write(APIC_SPIV, value);
395 390
396 /* 391 /*
397 * Set up LVT0, LVT1: 392 * Set up LVT0, LVT1:
@@ -411,7 +406,7 @@ void __cpuinit setup_local_APIC (void)
411 value = APIC_DM_EXTINT | APIC_LVT_MASKED; 406 value = APIC_DM_EXTINT | APIC_LVT_MASKED;
412 apic_printk(APIC_VERBOSE, "masked ExtINT on CPU#%d\n", smp_processor_id()); 407 apic_printk(APIC_VERBOSE, "masked ExtINT on CPU#%d\n", smp_processor_id());
413 } 408 }
414 apic_write_around(APIC_LVT0, value); 409 apic_write(APIC_LVT0, value);
415 410
416 /* 411 /*
417 * only the BP should see the LINT1 NMI signal, obviously. 412 * only the BP should see the LINT1 NMI signal, obviously.
@@ -420,14 +415,14 @@ void __cpuinit setup_local_APIC (void)
420 value = APIC_DM_NMI; 415 value = APIC_DM_NMI;
421 else 416 else
422 value = APIC_DM_NMI | APIC_LVT_MASKED; 417 value = APIC_DM_NMI | APIC_LVT_MASKED;
423 apic_write_around(APIC_LVT1, value); 418 apic_write(APIC_LVT1, value);
424 419
425 { 420 {
426 unsigned oldvalue; 421 unsigned oldvalue;
427 maxlvt = get_maxlvt(); 422 maxlvt = get_maxlvt();
428 oldvalue = apic_read(APIC_ESR); 423 oldvalue = apic_read(APIC_ESR);
429 value = ERROR_APIC_VECTOR; // enables sending errors 424 value = ERROR_APIC_VECTOR; // enables sending errors
430 apic_write_around(APIC_LVTERR, value); 425 apic_write(APIC_LVTERR, value);
431 /* 426 /*
432 * spec says clear errors after enabling vector. 427 * spec says clear errors after enabling vector.
433 */ 428 */
@@ -672,17 +667,17 @@ static void __setup_APIC_LVTT(unsigned int clocks)
672 if (cpu_isset(cpu, timer_interrupt_broadcast_ipi_mask)) 667 if (cpu_isset(cpu, timer_interrupt_broadcast_ipi_mask))
673 lvtt_value |= APIC_LVT_MASKED; 668 lvtt_value |= APIC_LVT_MASKED;
674 669
675 apic_write_around(APIC_LVTT, lvtt_value); 670 apic_write(APIC_LVTT, lvtt_value);
676 671
677 /* 672 /*
678 * Divide PICLK by 16 673 * Divide PICLK by 16
679 */ 674 */
680 tmp_value = apic_read(APIC_TDCR); 675 tmp_value = apic_read(APIC_TDCR);
681 apic_write_around(APIC_TDCR, (tmp_value 676 apic_write(APIC_TDCR, (tmp_value
682 & ~(APIC_TDR_DIV_1 | APIC_TDR_DIV_TMBASE)) 677 & ~(APIC_TDR_DIV_1 | APIC_TDR_DIV_TMBASE))
683 | APIC_TDR_DIV_16); 678 | APIC_TDR_DIV_16);
684 679
685 apic_write_around(APIC_TMICT, clocks/APIC_DIVISOR); 680 apic_write(APIC_TMICT, clocks/APIC_DIVISOR);
686} 681}
687 682
688static void setup_APIC_timer(unsigned int clocks) 683static void setup_APIC_timer(unsigned int clocks)
@@ -691,12 +686,6 @@ static void setup_APIC_timer(unsigned int clocks)
691 686
692 local_irq_save(flags); 687 local_irq_save(flags);
693 688
694 /* For some reasons this doesn't work on Simics, so fake it for now */
695 if (!strstr(boot_cpu_data.x86_model_id, "Screwdriver")) {
696 __setup_APIC_LVTT(clocks);
697 return;
698 }
699
700 /* wait for irq slice */ 689 /* wait for irq slice */
701 if (vxtime.hpet_address) { 690 if (vxtime.hpet_address) {
702 int trigger = hpet_readl(HPET_T0_CMP); 691 int trigger = hpet_readl(HPET_T0_CMP);
@@ -709,7 +698,7 @@ static void setup_APIC_timer(unsigned int clocks)
709 outb_p(0x00, 0x43); 698 outb_p(0x00, 0x43);
710 c2 = inb_p(0x40); 699 c2 = inb_p(0x40);
711 c2 |= inb_p(0x40) << 8; 700 c2 |= inb_p(0x40) << 8;
712 do { 701 do {
713 c1 = c2; 702 c1 = c2;
714 outb_p(0x00, 0x43); 703 outb_p(0x00, 0x43);
715 c2 = inb_p(0x40); 704 c2 = inb_p(0x40);
@@ -800,7 +789,7 @@ void disable_APIC_timer(void)
800 unsigned long v; 789 unsigned long v;
801 790
802 v = apic_read(APIC_LVTT); 791 v = apic_read(APIC_LVTT);
803 apic_write_around(APIC_LVTT, v | APIC_LVT_MASKED); 792 apic_write(APIC_LVTT, v | APIC_LVT_MASKED);
804 } 793 }
805} 794}
806 795
@@ -813,7 +802,7 @@ void enable_APIC_timer(void)
813 unsigned long v; 802 unsigned long v;
814 803
815 v = apic_read(APIC_LVTT); 804 v = apic_read(APIC_LVTT);
816 apic_write_around(APIC_LVTT, v & ~APIC_LVT_MASKED); 805 apic_write(APIC_LVTT, v & ~APIC_LVT_MASKED);
817 } 806 }
818} 807}
819 808
@@ -1066,7 +1055,7 @@ int __init APIC_init_uniprocessor (void)
1066 connect_bsp_APIC(); 1055 connect_bsp_APIC();
1067 1056
1068 phys_cpu_present_map = physid_mask_of_physid(boot_cpu_id); 1057 phys_cpu_present_map = physid_mask_of_physid(boot_cpu_id);
1069 apic_write_around(APIC_ID, SET_APIC_ID(boot_cpu_id)); 1058 apic_write(APIC_ID, SET_APIC_ID(boot_cpu_id));
1070 1059
1071 setup_local_APIC(); 1060 setup_local_APIC();
1072 1061
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
index fd1e7c36dc23..e8cf44ef8778 100644
--- a/arch/x86_64/kernel/io_apic.c
+++ b/arch/x86_64/kernel/io_apic.c
@@ -910,7 +910,7 @@ static void __init setup_ExtINT_IRQ0_pin(unsigned int apic, unsigned int pin, in
910 disable_8259A_irq(0); 910 disable_8259A_irq(0);
911 911
912 /* mask LVT0 */ 912 /* mask LVT0 */
913 apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT); 913 apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
914 914
915 /* 915 /*
916 * We use logical delivery to get the timer IRQ 916 * We use logical delivery to get the timer IRQ
@@ -1635,7 +1635,7 @@ static void enable_lapic_irq (unsigned int irq)
1635 unsigned long v; 1635 unsigned long v;
1636 1636
1637 v = apic_read(APIC_LVT0); 1637 v = apic_read(APIC_LVT0);
1638 apic_write_around(APIC_LVT0, v & ~APIC_LVT_MASKED); 1638 apic_write(APIC_LVT0, v & ~APIC_LVT_MASKED);
1639} 1639}
1640 1640
1641static void disable_lapic_irq (unsigned int irq) 1641static void disable_lapic_irq (unsigned int irq)
@@ -1643,7 +1643,7 @@ static void disable_lapic_irq (unsigned int irq)
1643 unsigned long v; 1643 unsigned long v;
1644 1644
1645 v = apic_read(APIC_LVT0); 1645 v = apic_read(APIC_LVT0);
1646 apic_write_around(APIC_LVT0, v | APIC_LVT_MASKED); 1646 apic_write(APIC_LVT0, v | APIC_LVT_MASKED);
1647} 1647}
1648 1648
1649static void ack_lapic_irq (unsigned int irq) 1649static void ack_lapic_irq (unsigned int irq)
@@ -1769,7 +1769,7 @@ static inline void check_timer(void)
1769 * the 8259A which implies the virtual wire has to be 1769 * the 8259A which implies the virtual wire has to be
1770 * disabled in the local APIC. 1770 * disabled in the local APIC.
1771 */ 1771 */
1772 apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT); 1772 apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
1773 init_8259A(1); 1773 init_8259A(1);
1774 enable_8259A_irq(0); 1774 enable_8259A_irq(0);
1775 1775
@@ -1835,21 +1835,21 @@ static inline void check_timer(void)
1835 1835
1836 disable_8259A_irq(0); 1836 disable_8259A_irq(0);
1837 irq_desc[0].handler = &lapic_irq_type; 1837 irq_desc[0].handler = &lapic_irq_type;
1838 apic_write_around(APIC_LVT0, APIC_DM_FIXED | vector); /* Fixed mode */ 1838 apic_write(APIC_LVT0, APIC_DM_FIXED | vector); /* Fixed mode */
1839 enable_8259A_irq(0); 1839 enable_8259A_irq(0);
1840 1840
1841 if (timer_irq_works()) { 1841 if (timer_irq_works()) {
1842 apic_printk(APIC_QUIET, " works.\n"); 1842 apic_printk(APIC_QUIET, " works.\n");
1843 return; 1843 return;
1844 } 1844 }
1845 apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | vector); 1845 apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | vector);
1846 apic_printk(APIC_VERBOSE," failed.\n"); 1846 apic_printk(APIC_VERBOSE," failed.\n");
1847 1847
1848 apic_printk(APIC_VERBOSE, KERN_INFO "...trying to set up timer as ExtINT IRQ..."); 1848 apic_printk(APIC_VERBOSE, KERN_INFO "...trying to set up timer as ExtINT IRQ...");
1849 1849
1850 init_8259A(0); 1850 init_8259A(0);
1851 make_8259A_irq(0); 1851 make_8259A_irq(0);
1852 apic_write_around(APIC_LVT0, APIC_DM_EXTINT); 1852 apic_write(APIC_LVT0, APIC_DM_EXTINT);
1853 1853
1854 unlock_ExtINT_logic(); 1854 unlock_ExtINT_logic();
1855 1855
diff --git a/arch/x86_64/kernel/mce_intel.c b/arch/x86_64/kernel/mce_intel.c
index 3ef845e8d3b0..8f533d2c40cb 100644
--- a/arch/x86_64/kernel/mce_intel.c
+++ b/arch/x86_64/kernel/mce_intel.c
@@ -80,7 +80,7 @@ static void __cpuinit intel_init_thermal(struct cpuinfo_x86 *c)
80 80
81 h = THERMAL_APIC_VECTOR; 81 h = THERMAL_APIC_VECTOR;
82 h |= (APIC_DM_FIXED | APIC_LVT_MASKED); 82 h |= (APIC_DM_FIXED | APIC_LVT_MASKED);
83 apic_write_around(APIC_LVTTHMR, h); 83 apic_write(APIC_LVTTHMR, h);
84 84
85 rdmsr(MSR_IA32_THERM_INTERRUPT, l, h); 85 rdmsr(MSR_IA32_THERM_INTERRUPT, l, h);
86 wrmsr(MSR_IA32_THERM_INTERRUPT, l | 0x03, h); 86 wrmsr(MSR_IA32_THERM_INTERRUPT, l | 0x03, h);
@@ -89,7 +89,7 @@ static void __cpuinit intel_init_thermal(struct cpuinfo_x86 *c)
89 wrmsr(MSR_IA32_MISC_ENABLE, l | (1 << 3), h); 89 wrmsr(MSR_IA32_MISC_ENABLE, l | (1 << 3), h);
90 90
91 l = apic_read(APIC_LVTTHMR); 91 l = apic_read(APIC_LVTTHMR);
92 apic_write_around(APIC_LVTTHMR, l & ~APIC_LVT_MASKED); 92 apic_write(APIC_LVTTHMR, l & ~APIC_LVT_MASKED);
93 printk(KERN_INFO "CPU%d: Thermal monitoring enabled (%s)\n", 93 printk(KERN_INFO "CPU%d: Thermal monitoring enabled (%s)\n",
94 cpu, tm2 ? "TM2" : "TM1"); 94 cpu, tm2 ? "TM2" : "TM1");
95 return; 95 return;
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c
index c8169d066cbd..c9e941ae5019 100644
--- a/arch/x86_64/kernel/smpboot.c
+++ b/arch/x86_64/kernel/smpboot.c
@@ -666,7 +666,6 @@ static int __cpuinit wakeup_secondary_via_INIT(int phys_apicid, unsigned int sta
666 666
667 for (j = 1; j <= num_starts; j++) { 667 for (j = 1; j <= num_starts; j++) {
668 Dprintk("Sending STARTUP #%d.\n",j); 668 Dprintk("Sending STARTUP #%d.\n",j);
669 apic_read_around(APIC_SPIV);
670 apic_write(APIC_ESR, 0); 669 apic_write(APIC_ESR, 0);
671 apic_read(APIC_ESR); 670 apic_read(APIC_ESR);
672 Dprintk("After apic_write.\n"); 671 Dprintk("After apic_write.\n");
@@ -705,7 +704,6 @@ static int __cpuinit wakeup_secondary_via_INIT(int phys_apicid, unsigned int sta
705 * Due to the Pentium erratum 3AP. 704 * Due to the Pentium erratum 3AP.
706 */ 705 */
707 if (maxlvt > 3) { 706 if (maxlvt > 3) {
708 apic_read_around(APIC_SPIV);
709 apic_write(APIC_ESR, 0); 707 apic_write(APIC_ESR, 0);
710 } 708 }
711 accept_status = (apic_read(APIC_ESR) & 0xEF); 709 accept_status = (apic_read(APIC_ESR) & 0xEF);
@@ -842,11 +840,8 @@ do_rest:
842 /* 840 /*
843 * Be paranoid about clearing APIC errors. 841 * Be paranoid about clearing APIC errors.
844 */ 842 */
845 if (APIC_INTEGRATED(apic_version[apicid])) { 843 apic_write(APIC_ESR, 0);
846 apic_read_around(APIC_SPIV); 844 apic_read(APIC_ESR);
847 apic_write(APIC_ESR, 0);
848 apic_read(APIC_ESR);
849 }
850 845
851 /* 846 /*
852 * Status is now clean 847 * Status is now clean
@@ -1024,7 +1019,7 @@ static int __init smp_sanity_check(unsigned max_cpus)
1024 /* 1019 /*
1025 * If we couldn't find a local APIC, then get out of here now! 1020 * If we couldn't find a local APIC, then get out of here now!
1026 */ 1021 */
1027 if (APIC_INTEGRATED(apic_version[boot_cpu_id]) && !cpu_has_apic) { 1022 if (!cpu_has_apic) {
1028 printk(KERN_ERR "BIOS bug, local APIC #%d not detected!...\n", 1023 printk(KERN_ERR "BIOS bug, local APIC #%d not detected!...\n",
1029 boot_cpu_id); 1024 boot_cpu_id);
1030 printk(KERN_ERR "... forcing use of dummy APIC emulation. (tell your hw vendor)\n"); 1025 printk(KERN_ERR "... forcing use of dummy APIC emulation. (tell your hw vendor)\n");
diff --git a/include/asm-x86_64/apic.h b/include/asm-x86_64/apic.h
index f95847acd0f0..4f6a4dc455bb 100644
--- a/include/asm-x86_64/apic.h
+++ b/include/asm-x86_64/apic.h
@@ -52,10 +52,6 @@ static __inline__ void apic_wait_icr_idle(void)
52 while ( apic_read( APIC_ICR ) & APIC_ICR_BUSY ); 52 while ( apic_read( APIC_ICR ) & APIC_ICR_BUSY );
53} 53}
54 54
55#define FORCE_READ_AROUND_WRITE 0
56#define apic_read_around(x)
57#define apic_write_around(x,y) apic_write((x),(y))
58
59static inline void ack_APIC_irq(void) 55static inline void ack_APIC_irq(void)
60{ 56{
61 /* 57 /*
@@ -66,7 +62,7 @@ static inline void ack_APIC_irq(void)
66 */ 62 */
67 63
68 /* Docs say use 0 for future compatibility */ 64 /* Docs say use 0 for future compatibility */
69 apic_write_around(APIC_EOI, 0); 65 apic_write(APIC_EOI, 0);
70} 66}
71 67
72extern int get_maxlvt (void); 68extern int get_maxlvt (void);