| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | #ifndef _ASM_X86_APIC_H |
|---|
| 2 | 3 | #define _ASM_X86_APIC_H |
|---|
| 3 | 4 | |
|---|
| .. | .. |
|---|
| 52 | 53 | extern int local_apic_timer_c2_ok; |
|---|
| 53 | 54 | |
|---|
| 54 | 55 | extern int disable_apic; |
|---|
| 55 | | -extern unsigned int lapic_timer_frequency; |
|---|
| 56 | +extern unsigned int lapic_timer_period; |
|---|
| 56 | 57 | |
|---|
| 57 | 58 | extern enum apic_intr_mode_id apic_intr_mode; |
|---|
| 58 | 59 | enum apic_intr_mode_id { |
|---|
| .. | .. |
|---|
| 135 | 136 | extern void clear_local_APIC(void); |
|---|
| 136 | 137 | extern void disconnect_bsp_APIC(int virt_wire_setup); |
|---|
| 137 | 138 | extern void disable_local_APIC(void); |
|---|
| 139 | +extern void apic_soft_disable(void); |
|---|
| 138 | 140 | extern void lapic_shutdown(void); |
|---|
| 139 | 141 | extern void sync_Arb_IDs(void); |
|---|
| 140 | 142 | extern void init_bsp_APIC(void); |
|---|
| 143 | +extern void apic_intr_mode_select(void); |
|---|
| 141 | 144 | extern void apic_intr_mode_init(void); |
|---|
| 142 | 145 | extern void init_apic_mappings(void); |
|---|
| 143 | 146 | void register_lapic_address(unsigned long address); |
|---|
| .. | .. |
|---|
| 154 | 157 | extern int apic_force_enable(unsigned long addr); |
|---|
| 155 | 158 | #endif |
|---|
| 156 | 159 | |
|---|
| 157 | | -extern void apic_bsp_setup(bool upmode); |
|---|
| 158 | 160 | extern void apic_ap_setup(void); |
|---|
| 159 | 161 | |
|---|
| 160 | 162 | /* |
|---|
| .. | .. |
|---|
| 175 | 177 | extern void lapic_update_legacy_vectors(void); |
|---|
| 176 | 178 | extern void lapic_online(void); |
|---|
| 177 | 179 | extern void lapic_offline(void); |
|---|
| 180 | +extern bool apic_needs_pit(void); |
|---|
| 181 | + |
|---|
| 182 | +extern void apic_send_IPI_allbutself(unsigned int vector); |
|---|
| 178 | 183 | |
|---|
| 179 | 184 | #else /* !CONFIG_X86_LOCAL_APIC */ |
|---|
| 180 | 185 | static inline void lapic_shutdown(void) { } |
|---|
| .. | .. |
|---|
| 185 | 190 | # define setup_secondary_APIC_clock x86_init_noop |
|---|
| 186 | 191 | static inline void lapic_update_tsc_freq(void) { } |
|---|
| 187 | 192 | static inline void init_bsp_APIC(void) { } |
|---|
| 193 | +static inline void apic_intr_mode_select(void) { } |
|---|
| 188 | 194 | static inline void apic_intr_mode_init(void) { } |
|---|
| 189 | 195 | static inline void lapic_assign_system_vectors(void) { } |
|---|
| 190 | 196 | static inline void lapic_assign_legacy_vector(unsigned int i, bool r) { } |
|---|
| 197 | +static inline bool apic_needs_pit(void) { return true; } |
|---|
| 191 | 198 | #endif /* !CONFIG_X86_LOCAL_APIC */ |
|---|
| 192 | 199 | |
|---|
| 193 | 200 | #ifdef CONFIG_X86_X2APIC |
|---|
| .. | .. |
|---|
| 265 | 272 | |
|---|
| 266 | 273 | /* |
|---|
| 267 | 274 | * Copyright 2004 James Cleverdon, IBM. |
|---|
| 268 | | - * Subject to the GNU Public License, v.2 |
|---|
| 269 | 275 | * |
|---|
| 270 | 276 | * Generic APIC sub-arch data struct. |
|---|
| 271 | 277 | * |
|---|
| .. | .. |
|---|
| 360 | 366 | #define apic_driver(sym) \ |
|---|
| 361 | 367 | static const struct apic *__apicdrivers_##sym __used \ |
|---|
| 362 | 368 | __aligned(sizeof(struct apic *)) \ |
|---|
| 363 | | - __section(.apicdrivers) = { &sym } |
|---|
| 369 | + __section(".apicdrivers") = { &sym } |
|---|
| 364 | 370 | |
|---|
| 365 | 371 | #define apic_drivers(sym1, sym2) \ |
|---|
| 366 | 372 | static struct apic *__apicdrivers_##sym1##sym2[2] __used \ |
|---|
| 367 | 373 | __aligned(sizeof(struct apic *)) \ |
|---|
| 368 | | - __section(.apicdrivers) = { &sym1, &sym2 } |
|---|
| 374 | + __section(".apicdrivers") = { &sym1, &sym2 } |
|---|
| 369 | 375 | |
|---|
| 370 | 376 | extern struct apic *__apicdrivers[], *__apicdrivers_end[]; |
|---|
| 371 | 377 | |
|---|
| .. | .. |
|---|
| 464 | 470 | #define TRAMPOLINE_PHYS_LOW 0x467 |
|---|
| 465 | 471 | #define TRAMPOLINE_PHYS_HIGH 0x469 |
|---|
| 466 | 472 | |
|---|
| 467 | | -#ifdef CONFIG_X86_64 |
|---|
| 468 | | -extern void apic_send_IPI_self(int vector); |
|---|
| 469 | | - |
|---|
| 470 | | -DECLARE_PER_CPU(int, x2apic_extra_bits); |
|---|
| 471 | | -#endif |
|---|
| 472 | | - |
|---|
| 473 | 473 | extern void generic_bigsmp_probe(void); |
|---|
| 474 | 474 | |
|---|
| 475 | 475 | #ifdef CONFIG_X86_LOCAL_APIC |
|---|
| .. | .. |
|---|
| 505 | 505 | |
|---|
| 506 | 506 | #ifdef CONFIG_SMP |
|---|
| 507 | 507 | bool apic_id_is_primary_thread(unsigned int id); |
|---|
| 508 | +void apic_smt_update(void); |
|---|
| 508 | 509 | #else |
|---|
| 509 | 510 | static inline bool apic_id_is_primary_thread(unsigned int id) { return false; } |
|---|
| 511 | +static inline void apic_smt_update(void) { } |
|---|
| 510 | 512 | #endif |
|---|
| 511 | 513 | |
|---|
| 512 | | -extern void irq_enter(void); |
|---|
| 513 | | -extern void irq_exit(void); |
|---|
| 514 | +struct msi_msg; |
|---|
| 514 | 515 | |
|---|
| 515 | | -static inline void entering_irq(void) |
|---|
| 516 | | -{ |
|---|
| 517 | | - irq_enter(); |
|---|
| 518 | | - kvm_set_cpu_l1tf_flush_l1d(); |
|---|
| 519 | | -} |
|---|
| 520 | | - |
|---|
| 521 | | -static inline void entering_ack_irq(void) |
|---|
| 522 | | -{ |
|---|
| 523 | | - entering_irq(); |
|---|
| 524 | | - ack_APIC_irq(); |
|---|
| 525 | | -} |
|---|
| 526 | | - |
|---|
| 527 | | -static inline void ipi_entering_ack_irq(void) |
|---|
| 528 | | -{ |
|---|
| 529 | | - irq_enter(); |
|---|
| 530 | | - ack_APIC_irq(); |
|---|
| 531 | | - kvm_set_cpu_l1tf_flush_l1d(); |
|---|
| 532 | | -} |
|---|
| 533 | | - |
|---|
| 534 | | -static inline void exiting_irq(void) |
|---|
| 535 | | -{ |
|---|
| 536 | | - irq_exit(); |
|---|
| 537 | | -} |
|---|
| 538 | | - |
|---|
| 539 | | -static inline void exiting_ack_irq(void) |
|---|
| 540 | | -{ |
|---|
| 541 | | - ack_APIC_irq(); |
|---|
| 542 | | - irq_exit(); |
|---|
| 543 | | -} |
|---|
| 516 | +#ifdef CONFIG_PCI_MSI |
|---|
| 517 | +void x86_vector_msi_compose_msg(struct irq_data *data, struct msi_msg *msg); |
|---|
| 518 | +#else |
|---|
| 519 | +# define x86_vector_msi_compose_msg NULL |
|---|
| 520 | +#endif |
|---|
| 544 | 521 | |
|---|
| 545 | 522 | extern void ioapic_zap_locks(void); |
|---|
| 546 | 523 | |
|---|