arm: turn off cpu on panic

Since interrupts are disabled on panic, linux cannot reset a
panic'd core when NMI are disabled (for e.g. mcreboot/mcstop)

Just always offline it, so linux can get it back

Change-Id: If8107172375f2924e02bd4c36e24645ec38a8999
This commit is contained in:
Dominique Martinet
2019-02-04 15:58:54 +09:00
committed by Masamichi Takagi
parent 60dcd0e798
commit fe08ac4a67
3 changed files with 21 additions and 4 deletions

View File

@ -1274,7 +1274,7 @@ void ihk_mc_delay_us(int us)
arch_delay(us);
}
void arch_print_stack()
void arch_print_stack(void)
{
}
@ -1310,6 +1310,11 @@ void arch_show_interrupt_context(const void *reg)
kprintf(" syscallno : %016lx\n", regs->syscallno);
}
void arch_cpu_stop(void)
{
psci_cpu_off();
}
/*@
@ behavior fs_base:
@ assumes type == IHK_ASR_X86_FS;

View File

@ -1551,7 +1551,8 @@ void arch_print_pre_interrupt_stack(const struct x86_basic_regs *regs) {
__print_stack(rbp, regs->rip);
}
void arch_print_stack() {
void arch_print_stack(void)
{
struct stack *rbp;
__kprintf("Approximative stack trace:\n");
@ -1599,6 +1600,13 @@ return;
kprintf_unlock(irqflags);
}
void arch_cpu_stop(void)
{
while (1) {
cpu_halt();
}
}
/*@
@ behavior fs_base:
@ assumes type == IHK_ASR_X86_FS;

View File

@ -4,8 +4,9 @@
#include <ihk/monitor.h>
extern struct cpu_local_var *clv;
extern void eventfd(int type);
extern void arch_print_stack();
void eventfd(int type);
void arch_print_stack(void);
void arch_cpu_stop(void);
void panic(const char *msg)
{
@ -21,6 +22,9 @@ void panic(const char *msg)
arch_print_stack();
/* do not assume anything after this is executed */
arch_cpu_stop();
while (1) {
cpu_halt();
}