Step three of removing arch_handle_exit(). There's *no* way the default case can ever occur: The exit reason is a hard-coded constant value inside the interrupt vector that will never have an value outside its limited range. No need for special treatment of the default handler, we can safely remove the arch_dump_exit() call.
With this, arch_dump_exit() only has one single caller left, so fold all constant arguments inside the function itself, and refactor its name to arch_el2_abt(). However, leave the panic_park() for the default handler for now, it's a bug if it is called. Signed-off-by: Ralf Ramsauer <[email protected]> --- hypervisor/arch/arm64/traps.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hypervisor/arch/arm64/traps.c b/hypervisor/arch/arm64/traps.c index ccb86954..18d14ca0 100644 --- a/hypervisor/arch/arm64/traps.c +++ b/hypervisor/arch/arm64/traps.c @@ -182,14 +182,16 @@ static void arch_handle_trap(union registers *guest_regs) } } -static void arch_dump_exit(union registers *regs, const char *reason) +static void arch_el2_abt(union registers *regs) { struct trap_context ctx; fill_trap_context(&ctx, regs); - panic_printk("\nFATAL: Unhandled HYP exception: %s\n", reason); + panic_printk("\nFATAL: Unhandled HYP exception: " + "synchronous abort from EL2\n"); dump_regs(&ctx); dump_hyp_stack(&ctx); + panic_stop(); } union registers *arch_handle_exit(union registers *regs) @@ -204,12 +206,11 @@ union registers *arch_handle_exit(union registers *regs) break; case EXIT_REASON_EL2_ABORT: - arch_dump_exit(regs, "synchronous abort from EL2"); - panic_stop(); + arch_el2_abt(regs); break; default: - arch_dump_exit(regs, "unexpected"); + /* It's a bug if this case is called */ panic_stop(); } -- 2.20.1 -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
