aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/apic
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/apic')
-rw-r--r--arch/x86/kernel/apic/apic.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index c3be10f5773e..9b849d4957dc 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -232,6 +232,24 @@ static int modern_apic(void)
232 return lapic_get_version() >= 0x14; 232 return lapic_get_version() >= 0x14;
233} 233}
234 234
235/*
236 * bare function to substitute write operation
237 * and it's _that_ fast :)
238 */
239void native_apic_write_dummy(u32 reg, u32 v)
240{
241 WARN_ON_ONCE((cpu_has_apic || !disable_apic));
242}
243
244/*
245 * right after this call apic->write doesn't do anything
246 * note that there is no restore operation it works one way
247 */
248void apic_disable(void)
249{
250 apic->write = native_apic_write_dummy;
251}
252
235void native_apic_wait_icr_idle(void) 253void native_apic_wait_icr_idle(void)
236{ 254{
237 while (apic_read(APIC_ICR) & APIC_ICR_BUSY) 255 while (apic_read(APIC_ICR) & APIC_ICR_BUSY)
@@ -1582,6 +1600,12 @@ void __init init_apic_mappings(void)
1582 */ 1600 */
1583 if (boot_cpu_physical_apicid == -1U) 1601 if (boot_cpu_physical_apicid == -1U)
1584 boot_cpu_physical_apicid = read_apic_id(); 1602 boot_cpu_physical_apicid = read_apic_id();
1603
1604 /* lets check if we may to NOP'ify apic operations */
1605 if (!cpu_has_apic) {
1606 pr_info("APIC: disable apic facility\n");
1607 apic_disable();
1608 }
1585} 1609}
1586 1610
1587/* 1611/*