[PATCH] KVM: arm64: Drop %pB on nVHE panic when stage-2 is active
Vincent Donnefort
vdonnefort at google.com
Fri Jul 31 11:22:31 PDT 2026
Currently, the host stage-2 is lazily mapped. kallsyms, accessed with
the modifier %pB is therefore potentially unmapped. If the hyp panic
occured with the host stage-2 lock taken, a dead lock will occur.
Fixes: 6ccf9cb557bd ("KVM: arm64: Symbolize the nVHE HYP addresses")
Signed-off-by: Vincent Donnefort <vdonnefort at google.com>
diff --git a/arch/arm64/kvm/handle_exit.c b/arch/arm64/kvm/handle_exit.c
index 54aedf93c78b..2e1951c215ae 100644
--- a/arch/arm64/kvm/handle_exit.c
+++ b/arch/arm64/kvm/handle_exit.c
@@ -509,8 +509,12 @@ void handle_exit_early(struct kvm_vcpu *vcpu, int exception_index)
static void print_nvhe_hyp_panic(const char *name, u64 panic_addr)
{
- kvm_err("nVHE hyp %s at: [<%016llx>] %pB!\n", name, panic_addr,
- (void *)(panic_addr + kaslr_offset()));
+ /* Kallsyms might not be mapped in the host stage-2 */
+ if (is_protected_kvm_enabled() && !IS_ENABLED(CONFIG_PKVM_DISABLE_STAGE2_ON_PANIC))
+ kvm_err("nVHE hyp %s at: %016llx!\n", name, panic_addr);
+ else
+ kvm_err("nVHE hyp %s at: [<%016llx>] %pB!\n", name, panic_addr,
+ (void *)(panic_addr + kaslr_offset()));
}
static void kvm_nvhe_report_cfi_failure(u64 panic_addr)
base-commit: f5098b6bae761e346ebcd9da7f95622c04733cff
--
2.55.0.508.g3f0d502094-goog
More information about the linux-arm-kernel
mailing list