arm64: record register state at kernel mode page fault (for eclair)

Change-Id: I066bceecc0377110faaca0b21d45a476d000e684
This commit is contained in:
Balazs Gerofi
2020-08-12 07:43:45 +09:00
committed by Masamichi Takagi
parent 92902d36fc
commit 623d6f8bc3
3 changed files with 7 additions and 0 deletions

View File

@ -143,6 +143,11 @@ void arch_save_panic_regs(void *irq_regs)
clv = get_arm64_this_cpu_local();
/* If kernel mode PF occurred, unroll the causing call stack */
if (cpu_local_var(kernel_mode_pf_regs)) {
regs = cpu_local_var(kernel_mode_pf_regs);
}
/* For user-space, use saved kernel context */
if (regs->pc < USER_END) {
memset(clv->arm64_cpu_local_thread.panic_regs,

View File

@ -79,6 +79,7 @@ struct cpu_local_var {
ihk_spinlock_t runq_lock;
unsigned long runq_irqstate;
struct thread *current;
void *kernel_mode_pf_regs;
int prevpid;
struct list_head runq;
size_t runq_len;

View File

@ -1323,6 +1323,7 @@ static void unhandled_page_fault(struct thread *thread, void *fault_addr,
ihk_mc_debug_show_interrupt_context(regs);
if (!(reason & PF_USER)) {
cpu_local_var(kernel_mode_pf_regs) = regs;
panic("panic: kernel mode PF");
}