hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/arch/arm64/include/asm/smp.h
....@@ -1,31 +1,27 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright (C) 2012 ARM Ltd.
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
7
- *
8
- * This program is distributed in the hope that it will be useful,
9
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
- * GNU General Public License for more details.
12
- *
13
- * You should have received a copy of the GNU General Public License
14
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
154 */
165 #ifndef __ASM_SMP_H
176 #define __ASM_SMP_H
187
19
-/* Values for secondary_data.status */
8
+#include <linux/const.h>
209
21
-#define CPU_MMU_OFF (-1)
22
-#define CPU_BOOT_SUCCESS (0)
10
+/* Values for secondary_data.status */
11
+#define CPU_STUCK_REASON_SHIFT (8)
12
+#define CPU_BOOT_STATUS_MASK ((UL(1) << CPU_STUCK_REASON_SHIFT) - 1)
13
+
14
+#define CPU_MMU_OFF (-1)
15
+#define CPU_BOOT_SUCCESS (0)
2316 /* The cpu invoked ops->cpu_die, synchronise it with cpu_kill */
24
-#define CPU_KILL_ME (1)
17
+#define CPU_KILL_ME (1)
2518 /* The cpu couldn't die gracefully and is looping in the kernel */
26
-#define CPU_STUCK_IN_KERNEL (2)
19
+#define CPU_STUCK_IN_KERNEL (2)
2720 /* Fatal system error detected by secondary CPU, crash the system */
28
-#define CPU_PANIC_KERNEL (3)
21
+#define CPU_PANIC_KERNEL (3)
22
+
23
+#define CPU_STUCK_REASON_52_BIT_VA (UL(1) << CPU_STUCK_REASON_SHIFT)
24
+#define CPU_STUCK_REASON_NO_GRAN (UL(2) << CPU_STUCK_REASON_SHIFT)
2925
3026 #ifndef __ASSEMBLY__
3127
....@@ -46,17 +42,18 @@
4642 */
4743 #define raw_smp_processor_id() (*raw_cpu_ptr(&cpu_number))
4844
45
+/*
46
+ * Logical CPU mapping.
47
+ */
48
+extern u64 __cpu_logical_map[NR_CPUS];
49
+extern u64 cpu_logical_map(unsigned int cpu);
50
+
51
+static inline void set_cpu_logical_map(unsigned int cpu, u64 hwid)
52
+{
53
+ __cpu_logical_map[cpu] = hwid;
54
+}
55
+
4956 struct seq_file;
50
-
51
-/*
52
- * generate IPI list text
53
- */
54
-extern void show_ipi_list(struct seq_file *p, int prec);
55
-
56
-/*
57
- * Called from C code, this handles an IPI.
58
- */
59
-extern void handle_IPI(int ipinr, struct pt_regs *regs);
6057
6158 /*
6259 * Discover the set of possible CPUs and determine their
....@@ -65,17 +62,9 @@
6562 extern void smp_init_cpus(void);
6663
6764 /*
68
- * Provide a function to raise an IPI cross call on CPUs in callmap.
65
+ * Register IPI interrupts with the arch SMP code
6966 */
70
-extern void set_smp_cross_call(void (*)(const struct cpumask *, unsigned int));
71
-
72
-extern void (*__smp_cross_call)(const struct cpumask *, unsigned int);
73
-
74
-/*
75
- * Provide a function to set a callback function pointer for updating the ipi
76
- * history.
77
- */
78
-extern void set_update_ipi_history_callback(void (*fn)(int));
67
+extern void set_smp_ipi_range(int ipi_base, int nr_ipi);
7968
8069 /*
8170 * Called from the secondary holding pen, this is the secondary CPU entry point.
....@@ -100,6 +89,8 @@
10089
10190 extern void arch_send_call_function_single_ipi(int cpu);
10291 extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
92
+extern int nr_ipi_get(void);
93
+extern struct irq_desc **ipi_desc_get(void);
10394
10495 #ifdef CONFIG_ARM64_ACPI_PARKING_PROTOCOL
10596 extern void arch_send_wakeup_ipi_mask(const struct cpumask *mask);