| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright 2004 James Cleverdon, IBM. |
|---|
| 3 | | - * Subject to the GNU Public License, v.2 |
|---|
| 4 | 4 | * |
|---|
| 5 | 5 | * Flat APIC subarch code. |
|---|
| 6 | 6 | * |
|---|
| .. | .. |
|---|
| 8 | 8 | * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and |
|---|
| 9 | 9 | * James Cleverdon. |
|---|
| 10 | 10 | */ |
|---|
| 11 | | -#include <linux/errno.h> |
|---|
| 12 | | -#include <linux/threads.h> |
|---|
| 13 | 11 | #include <linux/cpumask.h> |
|---|
| 14 | | -#include <linux/string.h> |
|---|
| 15 | | -#include <linux/kernel.h> |
|---|
| 16 | | -#include <linux/ctype.h> |
|---|
| 17 | | -#include <linux/hardirq.h> |
|---|
| 18 | 12 | #include <linux/export.h> |
|---|
| 19 | | -#include <asm/smp.h> |
|---|
| 20 | | -#include <asm/apic.h> |
|---|
| 21 | | -#include <asm/ipi.h> |
|---|
| 22 | | -#include <asm/jailhouse_para.h> |
|---|
| 23 | | - |
|---|
| 24 | 13 | #include <linux/acpi.h> |
|---|
| 14 | + |
|---|
| 15 | +#include <asm/jailhouse_para.h> |
|---|
| 16 | +#include <asm/apic.h> |
|---|
| 17 | + |
|---|
| 18 | +#include "local.h" |
|---|
| 25 | 19 | |
|---|
| 26 | 20 | static struct apic apic_physflat; |
|---|
| 27 | 21 | static struct apic apic_flat; |
|---|
| .. | .. |
|---|
| 77 | 71 | int cpu = smp_processor_id(); |
|---|
| 78 | 72 | |
|---|
| 79 | 73 | if (cpu < BITS_PER_LONG) |
|---|
| 80 | | - clear_bit(cpu, &mask); |
|---|
| 74 | + __clear_bit(cpu, &mask); |
|---|
| 81 | 75 | |
|---|
| 82 | 76 | _flat_send_IPI_mask(mask, vector); |
|---|
| 83 | | -} |
|---|
| 84 | | - |
|---|
| 85 | | -static void flat_send_IPI_allbutself(int vector) |
|---|
| 86 | | -{ |
|---|
| 87 | | - int cpu = smp_processor_id(); |
|---|
| 88 | | - |
|---|
| 89 | | - if (IS_ENABLED(CONFIG_HOTPLUG_CPU) || vector == NMI_VECTOR) { |
|---|
| 90 | | - if (!cpumask_equal(cpu_online_mask, cpumask_of(cpu))) { |
|---|
| 91 | | - unsigned long mask = cpumask_bits(cpu_online_mask)[0]; |
|---|
| 92 | | - |
|---|
| 93 | | - if (cpu < BITS_PER_LONG) |
|---|
| 94 | | - clear_bit(cpu, &mask); |
|---|
| 95 | | - |
|---|
| 96 | | - _flat_send_IPI_mask(mask, vector); |
|---|
| 97 | | - } |
|---|
| 98 | | - } else if (num_online_cpus() > 1) { |
|---|
| 99 | | - __default_send_IPI_shortcut(APIC_DEST_ALLBUT, |
|---|
| 100 | | - vector, apic->dest_logical); |
|---|
| 101 | | - } |
|---|
| 102 | | -} |
|---|
| 103 | | - |
|---|
| 104 | | -static void flat_send_IPI_all(int vector) |
|---|
| 105 | | -{ |
|---|
| 106 | | - if (vector == NMI_VECTOR) { |
|---|
| 107 | | - flat_send_IPI_mask(cpu_online_mask, vector); |
|---|
| 108 | | - } else { |
|---|
| 109 | | - __default_send_IPI_shortcut(APIC_DEST_ALLINC, |
|---|
| 110 | | - vector, apic->dest_logical); |
|---|
| 111 | | - } |
|---|
| 112 | 77 | } |
|---|
| 113 | 78 | |
|---|
| 114 | 79 | static unsigned int flat_get_apic_id(unsigned long x) |
|---|
| .. | .. |
|---|
| 172 | 137 | .send_IPI = default_send_IPI_single, |
|---|
| 173 | 138 | .send_IPI_mask = flat_send_IPI_mask, |
|---|
| 174 | 139 | .send_IPI_mask_allbutself = flat_send_IPI_mask_allbutself, |
|---|
| 175 | | - .send_IPI_allbutself = flat_send_IPI_allbutself, |
|---|
| 176 | | - .send_IPI_all = flat_send_IPI_all, |
|---|
| 177 | | - .send_IPI_self = apic_send_IPI_self, |
|---|
| 140 | + .send_IPI_allbutself = default_send_IPI_allbutself, |
|---|
| 141 | + .send_IPI_all = default_send_IPI_all, |
|---|
| 142 | + .send_IPI_self = default_send_IPI_self, |
|---|
| 178 | 143 | |
|---|
| 179 | 144 | .inquire_remote_apic = default_inquire_remote_apic, |
|---|
| 180 | 145 | |
|---|
| .. | .. |
|---|
| 224 | 189 | */ |
|---|
| 225 | 190 | } |
|---|
| 226 | 191 | |
|---|
| 227 | | -static void physflat_send_IPI_allbutself(int vector) |
|---|
| 228 | | -{ |
|---|
| 229 | | - default_send_IPI_mask_allbutself_phys(cpu_online_mask, vector); |
|---|
| 230 | | -} |
|---|
| 231 | | - |
|---|
| 232 | | -static void physflat_send_IPI_all(int vector) |
|---|
| 233 | | -{ |
|---|
| 234 | | - default_send_IPI_mask_sequence_phys(cpu_online_mask, vector); |
|---|
| 235 | | -} |
|---|
| 236 | | - |
|---|
| 237 | 192 | static int physflat_probe(void) |
|---|
| 238 | 193 | { |
|---|
| 239 | 194 | if (apic == &apic_physflat || num_possible_cpus() > 8 || |
|---|
| .. | .. |
|---|
| 275 | 230 | .send_IPI = default_send_IPI_single_phys, |
|---|
| 276 | 231 | .send_IPI_mask = default_send_IPI_mask_sequence_phys, |
|---|
| 277 | 232 | .send_IPI_mask_allbutself = default_send_IPI_mask_allbutself_phys, |
|---|
| 278 | | - .send_IPI_allbutself = physflat_send_IPI_allbutself, |
|---|
| 279 | | - .send_IPI_all = physflat_send_IPI_all, |
|---|
| 280 | | - .send_IPI_self = apic_send_IPI_self, |
|---|
| 233 | + .send_IPI_allbutself = default_send_IPI_allbutself, |
|---|
| 234 | + .send_IPI_all = default_send_IPI_all, |
|---|
| 235 | + .send_IPI_self = default_send_IPI_self, |
|---|
| 281 | 236 | |
|---|
| 282 | 237 | .inquire_remote_apic = default_inquire_remote_apic, |
|---|
| 283 | 238 | |
|---|