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:
committed by
Masamichi Takagi
parent
60dcd0e798
commit
fe08ac4a67
@ -1274,7 +1274,7 @@ void ihk_mc_delay_us(int us)
|
|||||||
arch_delay(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);
|
kprintf(" syscallno : %016lx\n", regs->syscallno);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void arch_cpu_stop(void)
|
||||||
|
{
|
||||||
|
psci_cpu_off();
|
||||||
|
}
|
||||||
|
|
||||||
/*@
|
/*@
|
||||||
@ behavior fs_base:
|
@ behavior fs_base:
|
||||||
@ assumes type == IHK_ASR_X86_FS;
|
@ assumes type == IHK_ASR_X86_FS;
|
||||||
|
|||||||
@ -1551,7 +1551,8 @@ void arch_print_pre_interrupt_stack(const struct x86_basic_regs *regs) {
|
|||||||
__print_stack(rbp, regs->rip);
|
__print_stack(rbp, regs->rip);
|
||||||
}
|
}
|
||||||
|
|
||||||
void arch_print_stack() {
|
void arch_print_stack(void)
|
||||||
|
{
|
||||||
struct stack *rbp;
|
struct stack *rbp;
|
||||||
|
|
||||||
__kprintf("Approximative stack trace:\n");
|
__kprintf("Approximative stack trace:\n");
|
||||||
@ -1599,6 +1600,13 @@ return;
|
|||||||
kprintf_unlock(irqflags);
|
kprintf_unlock(irqflags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void arch_cpu_stop(void)
|
||||||
|
{
|
||||||
|
while (1) {
|
||||||
|
cpu_halt();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*@
|
/*@
|
||||||
@ behavior fs_base:
|
@ behavior fs_base:
|
||||||
@ assumes type == IHK_ASR_X86_FS;
|
@ assumes type == IHK_ASR_X86_FS;
|
||||||
|
|||||||
@ -4,8 +4,9 @@
|
|||||||
#include <ihk/monitor.h>
|
#include <ihk/monitor.h>
|
||||||
|
|
||||||
extern struct cpu_local_var *clv;
|
extern struct cpu_local_var *clv;
|
||||||
extern void eventfd(int type);
|
void eventfd(int type);
|
||||||
extern void arch_print_stack();
|
void arch_print_stack(void);
|
||||||
|
void arch_cpu_stop(void);
|
||||||
|
|
||||||
void panic(const char *msg)
|
void panic(const char *msg)
|
||||||
{
|
{
|
||||||
@ -21,6 +22,9 @@ void panic(const char *msg)
|
|||||||
|
|
||||||
arch_print_stack();
|
arch_print_stack();
|
||||||
|
|
||||||
|
/* do not assume anything after this is executed */
|
||||||
|
arch_cpu_stop();
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
cpu_halt();
|
cpu_halt();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user