Skip to content

Commit 8f3873a

Browse files
ptosioupton
authored andcommitted
KVM: arm64: Introduce print_nvhe_hyp_panic helper
Add a helper to display a panic banner soon to also be used for kCFI failures, to ensure that we remain consistent. Signed-off-by: Pierre-Clément Tosi <[email protected]> Acked-by: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
1 parent 7a928b3 commit 8f3873a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

arch/arm64/kvm/handle_exit.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,12 @@ void handle_exit_early(struct kvm_vcpu *vcpu, int exception_index)
411411
kvm_handle_guest_serror(vcpu, kvm_vcpu_get_esr(vcpu));
412412
}
413413

414+
static void print_nvhe_hyp_panic(const char *name, u64 panic_addr)
415+
{
416+
kvm_err("nVHE hyp %s at: [<%016llx>] %pB!\n", name, panic_addr,
417+
(void *)(panic_addr + kaslr_offset()));
418+
}
419+
414420
void __noreturn __cold nvhe_hyp_panic_handler(u64 esr, u64 spsr,
415421
u64 elr_virt, u64 elr_phys,
416422
u64 par, uintptr_t vcpu,
@@ -439,11 +445,9 @@ void __noreturn __cold nvhe_hyp_panic_handler(u64 esr, u64 spsr,
439445
if (file)
440446
kvm_err("nVHE hyp BUG at: %s:%u!\n", file, line);
441447
else
442-
kvm_err("nVHE hyp BUG at: [<%016llx>] %pB!\n", panic_addr,
443-
(void *)(panic_addr + kaslr_offset()));
448+
print_nvhe_hyp_panic("BUG", panic_addr);
444449
} else {
445-
kvm_err("nVHE hyp panic at: [<%016llx>] %pB!\n", panic_addr,
446-
(void *)(panic_addr + kaslr_offset()));
450+
print_nvhe_hyp_panic("panic", panic_addr);
447451
}
448452

449453
/* Dump the nVHE hypervisor backtrace */

0 commit comments

Comments
 (0)