Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: Add cpu_panic_kernel helper

During the activation of a secondary CPU, we could report serious
configuration issues and hence request to crash the kernel. We do
this for CPU ASID bit check now. We will need it also for handling
mismatched exception levels for the CPUs with VHE. Hence, add a
helper to do the same for reusability.

Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>

authored by

Suzuki K Poulose and committed by
Will Deacon
17eebd1a 6afedcd2

+12 -2
+11
arch/arm64/include/asm/smp.h
··· 113 113 dsb(ishst); 114 114 } 115 115 116 + /* 117 + * The calling secondary CPU has detected serious configuration mismatch, 118 + * which calls for a kernel panic. Update the boot status and park the calling 119 + * CPU. 120 + */ 121 + static inline void cpu_panic_kernel(void) 122 + { 123 + update_cpu_boot_status(CPU_PANIC_KERNEL); 124 + cpu_park_loop(); 125 + } 126 + 116 127 #endif /* ifndef __ASSEMBLY__ */ 117 128 118 129 #endif /* ifndef __ASM_SMP_H */
+1 -2
arch/arm64/mm/context.c
··· 75 75 */ 76 76 pr_crit("CPU%d: smaller ASID size(%u) than boot CPU (%u)\n", 77 77 smp_processor_id(), asid, asid_bits); 78 - update_cpu_boot_status(CPU_PANIC_KERNEL); 79 - cpu_park_loop(); 78 + cpu_panic_kernel(); 80 79 } 81 80 } 82 81