Lines Matching full:apic

3  *	Local APIC handling, local APIC timers
13 * Mikael Pettersson : Power Management for UP-APIC.
53 #include <asm/apic.h>
84 * Hypervisor supports 15 bits of APIC ID in MSI Extended Destination ID
97 /* Local APIC was disabled by the BIOS and enabled by the kernel */
104 * local APIC. Before entering Symmetric I/O Mode, either
110 /* NMI and 8259 INTR go through APIC */ in imcr_pic_to_apic()
122 * Knob to control our willingness to enable the local APIC.
129 * APIC command line parameters
154 /* Disable local APIC timer from the kernel commandline or via dmi quirk */
156 /* Local APIC timer works in C2 */
171 .name = "Local APIC",
188 * Check, if the APIC is integrated or a separate chip
196 * Check, whether this is a modern or a first generation APIC
200 /* AMD systems use old APIC versions, so check the CPU */ in modern_apic()
205 /* Hygon systems use modern APIC */ in modern_apic()
213 * right after this call apic become NOOP driven
214 * so apic->write/read doesn't do anything
247 * - we always have APIC integrated on 64bit mode in lapic_get_maxlvt()
254 * Local APIC timer
265 * This function sets up the local APIC timer, with a timeout of
266 * 'clocks' APIC bus clock. During calibration we actually call
272 * P5 APIC double write bug.
285 * The i82489DX APIC uses bit 18 and 19 for the base divider. This in __setup_APIC_LVTT()
301 * writing to the APIC LVTT and TSC_DEADLINE MSR isn't serialized. in __setup_APIC_LVTT()
388 pr_err(FW_BUG "cpu %d, try to use APIC%lX (LVT offset %d) for " in setup_APIC_eilvt()
396 pr_err(FW_BUG "cpu %d, try to use APIC%lX (LVT offset %d) for " in setup_APIC_eilvt()
481 * Local APIC timer broadcast function
492 * The local apic timer can be used for any function which is CPU local.
568 * Setup the local APIC timer for this CPU. Copy the initialized values
621 * In this functions we calibrate APIC bus clocks to the external timer.
624 * irqs synchronous. CPUs connected by the same APIC bus have the very same bus
708 pr_warn("APIC calibration not consistent with PM-Timer: %ldms instead of 100ms\n", in calibrate_by_pmtimer()
714 pr_info("APIC delta adjusted to PM-Timer: " in calibrate_by_pmtimer()
752 * and apic timer calibration. in apic_needs_pit()
757 /* Is there an APIC at all or is it disabled? */ in apic_needs_pit()
763 * configuration, the local APIC timer won't be set up. Make sure in apic_needs_pit()
778 /* APIC timer disabled? */ in apic_needs_pit()
782 * The APIC timer frequency is known already, no PIT calibration in apic_needs_pit()
809 * local APIC timer, no need for broadcast timer. in calibrate_APIC_clock()
815 apic_pr_verbose("Using local APIC timer interrupts. Calibrating APIC timer ...\n"); in calibrate_APIC_clock()
825 * Setup the APIC counter to maximum. There is no way the lapic in calibrate_APIC_clock()
876 /* Build delta t1-t2 as apic timer counts down */ in calibrate_APIC_clock()
904 * Do a sanity check on the APIC calibration result in calibrate_APIC_clock()
908 pr_warn("APIC frequency too slow, disabling apic timer\n"); in calibrate_APIC_clock()
915 * PM timer calibration failed or not turned on so lets try APIC in calibrate_APIC_clock()
920 apic_pr_verbose("... verify APIC timer\n"); in calibrate_APIC_clock()
923 * Setup the apic timer manually in calibrate_APIC_clock()
952 pr_warn("APIC timer disabled due to verification failure\n"); in calibrate_APIC_clock()
960 * Setup the boot APIC
967 * The local apic timer can be disabled via the kernel in setup_boot_APIC_clock()
973 pr_info("Disabling APIC timer\n"); in setup_boot_APIC_clock()
1008 * The guts of the apic timer interrupt
1042 * Local APIC timer interrupt. This is the most natural way for doing
1044 * broadcast interrupts too. [in case the hw doesn't support APIC timers]
1062 * Local APIC start and shutdown
1066 * clear_local_APIC - shutdown the local APIC
1069 * the local APIC has no dangling leftovers. Also used to cleanout any BIOS
1082 * Masking an LVT entry can trigger a local APIC error in clear_local_APIC()
1120 * Clean APIC state for other OSs: in clear_local_APIC()
1130 /* Integrated APIC (!82489DX) ? */ in clear_local_APIC()
1140 * apic_soft_disable - Clears and software disables the local APIC on hotplug
1143 * MSR_IA32_APICBASE. Clearing that bit on systems based on the 3 wire APIC
1144 * bus would require a hardware reset as the APIC would lose track of bus
1146 * but it has to be guaranteed that no interrupt is sent to the APIC while
1156 /* Soft disable APIC (implies clearing of registers for 82489DX!). */ in apic_soft_disable()
1163 * disable_local_APIC - clear and disable the local APIC
1214 * sync_Arb_IDs - synchronize APIC bus arbitration IDs
1240 pr_info("APIC disabled via kernel command line\n"); in __apic_intr_mode_select()
1246 /* On 64-bit, the APIC must be integrated, Check local APIC only */ in __apic_intr_mode_select()
1249 pr_info("APIC disabled by BIOS\n"); in __apic_intr_mode_select()
1253 /* On 32-bit, the APIC may be integrated APIC or 82489DX */ in __apic_intr_mode_select()
1255 /* Neither 82489DX nor integrated APIC ? */ in __apic_intr_mode_select()
1261 /* If the BIOS pretends there is an integrated APIC ? */ in __apic_intr_mode_select()
1265 pr_err(FW_BUG "Local APIC not detected, force emulation\n"); in __apic_intr_mode_select()
1274 pr_info("APIC: ACPI MADT or MP tables are not detected\n"); in __apic_intr_mode_select()
1283 pr_info("APIC: SMP mode deactivated\n"); in __apic_intr_mode_select()
1306 * through-I/O-APIC virtual wire mode might be active. in init_bsp_APIC()
1312 * Do not trust the local APIC being empty at bootup. in init_bsp_APIC()
1317 * Enable APIC. in init_bsp_APIC()
1355 pr_info("APIC: Keep in PIC mode(8259)\n"); in apic_intr_mode_init()
1358 pr_info("APIC: Switch to virtual wire mode setup\n"); in apic_intr_mode_init()
1361 pr_info("APIC: Switch to virtual wire mode setup with no configuration\n"); in apic_intr_mode_init()
1365 pr_info("APIC: Switch to symmetric I/O mode setup\n"); in apic_intr_mode_init()
1368 pr_info("APIC: Switch to symmetric I/O mode setup in no SMP routine\n"); in apic_intr_mode_init()
1391 if (apic->disable_esr) { in lapic_setup_esr()
1445 * If the ISR map is not empty. ACK the APIC and run another round in apic_check_and_ack()
1482 /* 512 loops are way oversized and give the APIC a chance to obey. */ in apic_pending_intr_clear()
1488 pr_warn("APIC: Stale IRR: %256pb ISR: %256pb\n", irr.map, isr.map); in apic_pending_intr_clear()
1492 * setup_local_APIC - setup the local APIC
1494 * Used to setup local APIC while initializing BSP or bringing up APs.
1508 * If this comes from kexec/kcrash the APIC might be enabled in in setup_local_APIC()
1517 if (lapic_is_integrated() && apic->disable_esr) { in setup_local_APIC()
1526 * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel in setup_local_APIC()
1531 if (apic->init_apic_ldr) in setup_local_APIC()
1532 apic->init_apic_ldr(); in setup_local_APIC()
1535 * Set Task Priority to 'accept all except vectors 0-31'. An APIC in setup_local_APIC()
1549 * Now that we are all set up, enable the APIC in setup_local_APIC()
1554 * Enable APIC in setup_local_APIC()
1560 * Some unknown Intel IO/APIC (or APIC) errata is biting us with in setup_local_APIC()
1597 * set up through-local-APIC on the boot CPU's LINT0. This is not in setup_local_APIC()
1602 * TODO: set up through-local-APIC from through-I/O-APIC? --macro in setup_local_APIC()
1630 /* Recheck CMCI information after local APIC is up on CPU #0 */ in setup_local_APIC()
1643 /* Disable the local apic timer */ in end_local_APIC_setup()
1654 * APIC setup function for application processors. Called from smpboot.c
1665 * This can be invoked from check_x2apic() before the APIC has been in apic_read_boot_cpu_id()
1744 pr_warn("APIC locked in x2apic mode, can't disable\n"); in setup_nox2apic()
1761 * Try to make the AP's APIC state match that of the BSP, but if the in x2apic_setup()
1803 * Don't reread the APIC ID as it was already done from in x2apic_disable()
1804 * check_x2apic() and the APIC driver still is a x2APIC variant, in x2apic_disable()
1840 * MSI, that increases the maximum APIC ID that can be in try_to_enable_x2apic()
1850 * in physical mode, and CPUs with an APIC ID that cannot in try_to_enable_x2apic()
1879 * Checkme: Can we simply turn off x2APIC here instead of disabling the APIC? in check_x2apic()
1882 pr_err("Disabling APIC, expect reduced performance and functionality.\n"); in check_x2apic()
1898 pr_info("Not enabling interrupt remapping due to skipped IO-APIC setup\n"); in enable_IR_x2apic()
1908 pr_info("Saving IO-APIC state failed: %d\n", ret); in enable_IR_x2apic()
1932 * On AMD64 we trust the BIOS - if it says no APIC it is likely
1933 * not correctly set up (usually the APIC timer won't work etc.)
1938 pr_info("No local APIC present\n"); in detect_init_APIC()
1952 * The APIC feature bit should now be enabled in apic_verify()
1957 pr_warn("Could not enable APIC!\n"); in apic_verify()
1962 /* The BIOS may have set up the APIC at some other address */ in apic_verify()
1970 pr_info("Found and enabled local APIC!\n"); in apic_verify()
1982 * Some BIOSes disable the local APIC in the APIC_BASE in apic_force_enable()
1989 pr_info("Local APIC disabled by BIOS -- reenabling.\n"); in apic_force_enable()
2000 * Detect and initialize APIC
2027 * Over-ride BIOS and try to enable the local APIC only if in detect_init_APIC()
2031 pr_info("Local APIC disabled by BIOS -- " in detect_init_APIC()
2047 pr_info("No local APIC present or hardware disabled\n"); in detect_init_APIC()
2053 * init_apic_mappings - initialize APIC mappings
2065 pr_info("APIC: disable apic facility\n"); in init_apic_mappings()
2075 apic_pr_verbose("Mapped APIC to %16lx (%16lx)\n", apic_mmio_base, mp_lapic_addr); in apic_set_fixmap()
2091 * Local APIC interrupts
2111 pr_info("Spurious APIC interrupt (vector 0xFF) on CPU#%d, should never happen.\n", in handle_spurious_interrupt()
2153 * This interrupt should never happen with our APIC/SMP architecture
2158 "Send CS error", /* APIC Error Bit 0 */ in DEFINE_IDTENTRY_SYSVEC()
2159 "Receive CS error", /* APIC Error Bit 1 */ in DEFINE_IDTENTRY_SYSVEC()
2160 "Send accept error", /* APIC Error Bit 2 */ in DEFINE_IDTENTRY_SYSVEC()
2161 "Receive accept error", /* APIC Error Bit 3 */ in DEFINE_IDTENTRY_SYSVEC()
2162 "Redirectable IPI", /* APIC Error Bit 4 */ in DEFINE_IDTENTRY_SYSVEC()
2163 "Send illegal vector", /* APIC Error Bit 5 */ in DEFINE_IDTENTRY_SYSVEC()
2164 "Received illegal vector", /* APIC Error Bit 6 */ in DEFINE_IDTENTRY_SYSVEC()
2165 "Illegal register address", /* APIC Error Bit 7 */ in DEFINE_IDTENTRY_SYSVEC()
2178 apic_pr_debug("APIC error on CPU%d: %02x", smp_processor_id(), v); in DEFINE_IDTENTRY_SYSVEC()
2194 * connect_bsp_APIC - attach the APIC to the interrupt system
2201 * Do not trust the local APIC being empty at bootup. in connect_bsp_APIC()
2205 * PIC mode, enable APIC mode in the IMCR, i.e. connect BSP's in connect_bsp_APIC()
2206 * local APIC to INT and NMI lines. in connect_bsp_APIC()
2208 apic_pr_verbose("Leaving PIC mode, enabling APIC mode.\n"); in connect_bsp_APIC()
2215 * disconnect_bsp_APIC - detach the APIC from the interrupt system
2219 * APIC is disabled.
2229 * certain older boards). Note that APIC interrupts, including in disconnect_bsp_APIC()
2233 apic_pr_verbose("Disabling APIC mode, entering PIC mode.\n"); in disconnect_bsp_APIC()
2284 msg->arch_addr_lo.dest_mode_logical = apic->dest_mode_logical; in __irq_msi_compose_msg()
2293 * APIC ID into the high bits of the address. Anything else would in __irq_msi_compose_msg()
2298 * 5-11 to be used, giving support for 15 bits of APIC IDs in total. in __irq_msi_compose_msg()
2324 * apic_bsp_setup - Setup function for local apic and io-apic
2359 * 'active' is true if the local APIC was enabled by us and
2364 /* r/w apic fields */
2416 * Mask IOAPIC before disabling the local APIC to prevent stale IRR in lapic_suspend()
2441 * IO-APIC and PIC have their own resume routines. in lapic_resume()
2523 /* local apic needs to resume before other devices access its registers. */
2541 pr_info("APIC: %s detected, Multi Chassis\n", d->ident); in set_multi()
2583 * APIC command line parameters
2630 pr_warn("APIC Verbosity level %s not recognised" in apic_set_verbosity()
2631 " use apic=verbose or apic=debug\n", arg); in apic_set_verbosity()
2638 early_param("apic", apic_set_verbosity);
2645 /* Put local APIC into the resource map. */ in lapic_insert_resource()