hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/arch/x86/kernel/apic/x2apic_phys.c
....@@ -1,14 +1,9 @@
11 // SPDX-License-Identifier: GPL-2.0
2
-#include <linux/threads.h>
3
-#include <linux/cpumask.h>
4
-#include <linux/string.h>
5
-#include <linux/kernel.h>
6
-#include <linux/ctype.h>
7
-#include <linux/dmar.h>
82
9
-#include <asm/smp.h>
10
-#include <asm/ipi.h>
11
-#include "x2apic.h"
3
+#include <linux/cpumask.h>
4
+#include <linux/acpi.h>
5
+
6
+#include "local.h"
127
138 int x2apic_phys;
149
....@@ -88,12 +83,12 @@
8883
8984 static void x2apic_send_IPI_allbutself(int vector)
9085 {
91
- __x2apic_send_IPI_mask(cpu_online_mask, vector, APIC_DEST_ALLBUT);
86
+ __x2apic_send_IPI_shorthand(vector, APIC_DEST_ALLBUT);
9287 }
9388
9489 static void x2apic_send_IPI_all(int vector)
9590 {
96
- __x2apic_send_IPI_mask(cpu_online_mask, vector, APIC_DEST_ALLINC);
91
+ __x2apic_send_IPI_shorthand(vector, APIC_DEST_ALLINC);
9792 }
9893
9994 static void init_x2apic_ldr(void)
....@@ -102,7 +97,10 @@
10297
10398 static int x2apic_phys_probe(void)
10499 {
105
- if (x2apic_mode && (x2apic_phys || x2apic_fadt_phys()))
100
+ if (!x2apic_mode)
101
+ return 0;
102
+
103
+ if (x2apic_phys || x2apic_fadt_phys())
106104 return 1;
107105
108106 return apic == &apic_x2apic_phys;
....@@ -128,6 +126,15 @@
128126 native_x2apic_icr_write(cfg, apicid);
129127 }
130128
129
+void __x2apic_send_IPI_shorthand(int vector, u32 which)
130
+{
131
+ unsigned long cfg = __prepare_ICR(which, vector, 0);
132
+
133
+ /* x2apic MSRs are special and need a special fence: */
134
+ weak_wrmsr_fence();
135
+ native_x2apic_icr_write(cfg, 0);
136
+}
137
+
131138 unsigned int x2apic_get_apic_id(unsigned long id)
132139 {
133140 return id;