hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/arch/x86/include/asm/apic.h
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 #ifndef _ASM_X86_APIC_H
23 #define _ASM_X86_APIC_H
34
....@@ -52,7 +53,7 @@
5253 extern int local_apic_timer_c2_ok;
5354
5455 extern int disable_apic;
55
-extern unsigned int lapic_timer_frequency;
56
+extern unsigned int lapic_timer_period;
5657
5758 extern enum apic_intr_mode_id apic_intr_mode;
5859 enum apic_intr_mode_id {
....@@ -135,9 +136,11 @@
135136 extern void clear_local_APIC(void);
136137 extern void disconnect_bsp_APIC(int virt_wire_setup);
137138 extern void disable_local_APIC(void);
139
+extern void apic_soft_disable(void);
138140 extern void lapic_shutdown(void);
139141 extern void sync_Arb_IDs(void);
140142 extern void init_bsp_APIC(void);
143
+extern void apic_intr_mode_select(void);
141144 extern void apic_intr_mode_init(void);
142145 extern void init_apic_mappings(void);
143146 void register_lapic_address(unsigned long address);
....@@ -154,7 +157,6 @@
154157 extern int apic_force_enable(unsigned long addr);
155158 #endif
156159
157
-extern void apic_bsp_setup(bool upmode);
158160 extern void apic_ap_setup(void);
159161
160162 /*
....@@ -175,6 +177,9 @@
175177 extern void lapic_update_legacy_vectors(void);
176178 extern void lapic_online(void);
177179 extern void lapic_offline(void);
180
+extern bool apic_needs_pit(void);
181
+
182
+extern void apic_send_IPI_allbutself(unsigned int vector);
178183
179184 #else /* !CONFIG_X86_LOCAL_APIC */
180185 static inline void lapic_shutdown(void) { }
....@@ -185,9 +190,11 @@
185190 # define setup_secondary_APIC_clock x86_init_noop
186191 static inline void lapic_update_tsc_freq(void) { }
187192 static inline void init_bsp_APIC(void) { }
193
+static inline void apic_intr_mode_select(void) { }
188194 static inline void apic_intr_mode_init(void) { }
189195 static inline void lapic_assign_system_vectors(void) { }
190196 static inline void lapic_assign_legacy_vector(unsigned int i, bool r) { }
197
+static inline bool apic_needs_pit(void) { return true; }
191198 #endif /* !CONFIG_X86_LOCAL_APIC */
192199
193200 #ifdef CONFIG_X86_X2APIC
....@@ -265,7 +272,6 @@
265272
266273 /*
267274 * Copyright 2004 James Cleverdon, IBM.
268
- * Subject to the GNU Public License, v.2
269275 *
270276 * Generic APIC sub-arch data struct.
271277 *
....@@ -360,12 +366,12 @@
360366 #define apic_driver(sym) \
361367 static const struct apic *__apicdrivers_##sym __used \
362368 __aligned(sizeof(struct apic *)) \
363
- __section(.apicdrivers) = { &sym }
369
+ __section(".apicdrivers") = { &sym }
364370
365371 #define apic_drivers(sym1, sym2) \
366372 static struct apic *__apicdrivers_##sym1##sym2[2] __used \
367373 __aligned(sizeof(struct apic *)) \
368
- __section(.apicdrivers) = { &sym1, &sym2 }
374
+ __section(".apicdrivers") = { &sym1, &sym2 }
369375
370376 extern struct apic *__apicdrivers[], *__apicdrivers_end[];
371377
....@@ -464,12 +470,6 @@
464470 #define TRAMPOLINE_PHYS_LOW 0x467
465471 #define TRAMPOLINE_PHYS_HIGH 0x469
466472
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
-
473473 extern void generic_bigsmp_probe(void);
474474
475475 #ifdef CONFIG_X86_LOCAL_APIC
....@@ -505,42 +505,19 @@
505505
506506 #ifdef CONFIG_SMP
507507 bool apic_id_is_primary_thread(unsigned int id);
508
+void apic_smt_update(void);
508509 #else
509510 static inline bool apic_id_is_primary_thread(unsigned int id) { return false; }
511
+static inline void apic_smt_update(void) { }
510512 #endif
511513
512
-extern void irq_enter(void);
513
-extern void irq_exit(void);
514
+struct msi_msg;
514515
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
544521
545522 extern void ioapic_zap_locks(void);
546523