| .. | .. |
|---|
| 1 | 1 | // 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> |
|---|
| 8 | 2 | |
|---|
| 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" |
|---|
| 12 | 7 | |
|---|
| 13 | 8 | int x2apic_phys; |
|---|
| 14 | 9 | |
|---|
| .. | .. |
|---|
| 88 | 83 | |
|---|
| 89 | 84 | static void x2apic_send_IPI_allbutself(int vector) |
|---|
| 90 | 85 | { |
|---|
| 91 | | - __x2apic_send_IPI_mask(cpu_online_mask, vector, APIC_DEST_ALLBUT); |
|---|
| 86 | + __x2apic_send_IPI_shorthand(vector, APIC_DEST_ALLBUT); |
|---|
| 92 | 87 | } |
|---|
| 93 | 88 | |
|---|
| 94 | 89 | static void x2apic_send_IPI_all(int vector) |
|---|
| 95 | 90 | { |
|---|
| 96 | | - __x2apic_send_IPI_mask(cpu_online_mask, vector, APIC_DEST_ALLINC); |
|---|
| 91 | + __x2apic_send_IPI_shorthand(vector, APIC_DEST_ALLINC); |
|---|
| 97 | 92 | } |
|---|
| 98 | 93 | |
|---|
| 99 | 94 | static void init_x2apic_ldr(void) |
|---|
| .. | .. |
|---|
| 102 | 97 | |
|---|
| 103 | 98 | static int x2apic_phys_probe(void) |
|---|
| 104 | 99 | { |
|---|
| 105 | | - if (x2apic_mode && (x2apic_phys || x2apic_fadt_phys())) |
|---|
| 100 | + if (!x2apic_mode) |
|---|
| 101 | + return 0; |
|---|
| 102 | + |
|---|
| 103 | + if (x2apic_phys || x2apic_fadt_phys()) |
|---|
| 106 | 104 | return 1; |
|---|
| 107 | 105 | |
|---|
| 108 | 106 | return apic == &apic_x2apic_phys; |
|---|
| .. | .. |
|---|
| 128 | 126 | native_x2apic_icr_write(cfg, apicid); |
|---|
| 129 | 127 | } |
|---|
| 130 | 128 | |
|---|
| 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 | + |
|---|
| 131 | 138 | unsigned int x2apic_get_apic_id(unsigned long id) |
|---|
| 132 | 139 | { |
|---|
| 133 | 140 | return id; |
|---|