KVM: arm64: Fix hypervisor address symbolization
PATCH 1/1 KVM: arm64: Fix hypervisor address symbolization
With CONFIG_RANDOMIZE_BASE=y vmlinux addresses will resolve correctly from kallsyms. Fix this by adding the KASLR offset before printing the symbols.
Based on arm64 for-next/stacktrace.
--- arch/arm64/kvm/handle_exit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/kvm/handle_exit.c +2 -2
@@ -347,10 +347,10 @@ void __noreturn __cold nvhe_hyp_panic_handler(u64 esr, u64 spsr,kvm_err ("nVHE hyp BUG at: %s:%u!\n" , file, line); else kvm_err("nVHE hyp BUG at: [<%016llx>] %pB!\n", panic_addr, - (void *)panic_addr); + (void *)(panic_addr + kaslr_offset())); }else {kvm_err ("nVHE hyp panic at: [<%016llx>] %pB!\n" , panic_addr, - (void *)panic_addr); + (void *)(panic_addr +kaslr_offset ())); }/*
base-commit: 82a592c13b0aeff94d84d54183dae0b26384c95f
Signature · 6 lines
2.37.0.170.g444d1eabd0-goog _______________________________________________ kvmarm mailing list [email protected] https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
Marc Zyngier
maintainerQuoted 2 lines · Kalesh Singh
With
CONFIG_RANDOMIZE_BASE=yvmlinux addresses will resolve correctly
I guess you mean *incorrectly* here, right?
Quoted 4 lines
from kallsyms. Fix this by adding the KASLR offset before printing the symbols.
Based on arm64 for-next/stacktrace.
In general, place these remarks after the '---' line, as they don't really make sense in the commit itself (which is likely to be merged on a different base anyway).
Quoted 16 lines
Fixes 6ccf9cb557bd ("KVM: arm64: Symbolize the nVHE HYP addresses")Reported-by Fuad Tabba <[email protected]>Signed-off-by Kalesh Singh <[email protected]>--- arch/arm64/kvm/handle_exit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/arm64/kvm/handle_exit.c +0
-0@@ -347,10 +347,10 @@ void __noreturn __cold nvhe_hyp_panic_handler(u64 esr, u64 spsr,kvm_err ("nVHE hyp BUG at: %s:%u!\n" , file, line); else
arch/arm64/kvm/handle_exit.c void __noreturn __cold nvhe_hyp_panic_handler(u64 esr, u64 spsr, · line 356
Quoted 10 lines
arch/arm64/kvm/handle_exit.c +2
-2kvm_err ("nVHE hyp BUG at: [<%016llx>] %pB!\n" , panic_addr, - (void *)panic_addr); + (void *)(panic_addr +kaslr_offset ())); }else {kvm_err ("nVHE hyp panic at: [<%016llx>] %pB!\n" , panic_addr, - (void *)panic_addr); + (void *)(panic_addr +kaslr_offset ())); }/*
I'll fix the above as I apply the patch, no need to respin.
Thanks,
M.
Signature · 5 lines
Without deviation from the norm, progress is not possible. _______________________________________________ kvmarm mailing list [email protected] https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
Quoted 7 lines · Marc Zyngier
Quoted 2 lines · Kalesh Singh
With
CONFIG_RANDOMIZE_BASE=yvmlinux addresses will resolve correctlyI guess you mean *incorrectly* here, right?
Yes, sorry. "INcorrectly" I meant to say.
Quoted 34 lines
Quoted 5 lines
from kallsyms. Fix this by adding the KASLR offset before printing the symbols.
Based on arm64 for-next/stacktrace.
In general, place these remarks after the '---' line, as they don't really make sense in the commit itself (which is likely to be merged on a different base anyway).
Quoted 24 lines
Fixes 6ccf9cb557bd ("KVM: arm64: Symbolize the nVHE HYP addresses")Reported-by Fuad Tabba <[email protected]>Signed-off-by Kalesh Singh <[email protected]>--- arch/arm64/kvm/handle_exit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/arm64/kvm/handle_exit.c +2
-2@@ -347,10 +347,10 @@ void __noreturn __cold nvhe_hyp_panic_handler(u64 esr, u64 spsr,kvm_err ("nVHE hyp BUG at: %s:%u!\n" , file, line); else kvm_err("nVHE hyp BUG at: [<%016llx>] %pB!\n", panic_addr, - (void *)panic_addr); + (void *)(panic_addr + kaslr_offset())); }else {kvm_err ("nVHE hyp panic at: [<%016llx>] %pB!\n" , panic_addr, - (void *)panic_addr); + (void *)(panic_addr +kaslr_offset ())); }
Quoted 4 lines
arch/arm64/kvm/handle_exit.c void __noreturn __cold nvhe_hyp_panic_handler(u64 esr, u64 spsr, · line 356
Quoted 2 lines
arch/arm64/kvm/handle_exit.c +0
-0/* I'll fix the above as I apply the patch, no need to respin.
Thanks Marc.
-- Kalesh
Quoted 7 lines
Thanks,
M.--
Without deviation from the norm, progress is not possible.
_______________________________________________
kvmarm mailing list
[email protected]
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
Quoted 5 lines · Kalesh Singh
With
CONFIG_RANDOMIZE_BASE=yvmlinux addresses will resolve correctly from kallsyms. Fix this by adding the KASLR offset before printing the symbols.Based on arm64 for-next/stacktrace.
Applied to next, thanks!
[1/1] KVM: arm64: Fix hypervisor address symbolization
commit: ed6313a93fd11d2015ad17046f3c418bf6a8dab1
Cheers,
M.
Signature · 6 lines
Marc Zyngier <[email protected]> _______________________________________________ kvmarm mailing list [email protected] https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
Hi Kalesh,
Quoted 11 lines · Kalesh Singh
With
CONFIG_RANDOMIZE_BASE=yvmlinux addresses will resolve correctly from kallsyms. Fix this by adding the KASLR offset before printing the symbols.Based on arm64 for-next/stacktrace.
Fixes 6ccf9cb557bd ("KVM: arm64: Symbolize the nVHE HYP addresses")Reported-by Fuad Tabba <[email protected]>Signed-off-by Kalesh Singh <[email protected]>---
Even with this patch applied I still don't get symbolization unless I disable randomization, either by setting CONFIG_RANDOMIZE_BASE=n or pass nokaslr as a kernel parameter. I tried both and in either case it works.
Thanks,
/fuad
Quoted 21 lines
arch/arm64/kvm/handle_exit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/arm64/kvm/handle_exit.c +2
-2@@ -347,10 +347,10 @@ void __noreturn __cold nvhe_hyp_panic_handler(u64 esr, u64 spsr,kvm_err ("nVHE hyp BUG at: %s:%u!\n" , file, line); else kvm_err("nVHE hyp BUG at: [<%016llx>] %pB!\n", panic_addr, - (void *)panic_addr); + (void *)(panic_addr + kaslr_offset())); }else {kvm_err ("nVHE hyp panic at: [<%016llx>] %pB!\n" , panic_addr, - (void *)panic_addr); + (void *)(panic_addr +kaslr_offset ())); }/*
Quoted 4 lines
base-commit:
82a592c13b0aeff94d84d54183dae0b26384c95f--
2.37.0.170.g444d1eabd0-goog
_______________________________________________
kvmarm mailing list
[email protected]
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
Quoted 16 lines · Fuad Tabba
Hi Kalesh,
Quoted 11 lines · Kalesh Singh
With
CONFIG_RANDOMIZE_BASE=yvmlinux addresses will resolve correctly from kallsyms. Fix this by adding the KASLR offset before printing the symbols.Based on arm64 for-next/stacktrace.
Fixes 6ccf9cb557bd ("KVM: arm64: Symbolize the nVHE HYP addresses")Reported-by Fuad Tabba <[email protected]>Signed-off-by Kalesh Singh <[email protected]>---
Quoted 4 lines
Even with this patch applied I still don't get symbolization unless I disable randomization, either by setting
CONFIG_RANDOMIZE_BASE=nor pass nokaslr as a kernel parameter. I tried both and in either case it works.
Hi Fuad,
Thanks for testing it. The fix only addressed the symbolization for the hyp panic address. I plan to fix the symbolization of stacktrace in the next version of this series.
--Kalesh
Quoted 24 lines
Thanks,
/fuadQuoted 19 lines
arch/arm64/kvm/handle_exit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/arm64/kvm/handle_exit.c +2
-2@@ -347,10 +347,10 @@ void __noreturn __cold nvhe_hyp_panic_handler(u64 esr, u64 spsr,kvm_err ("nVHE hyp BUG at: %s:%u!\n" , file, line); else kvm_err("nVHE hyp BUG at: [<%016llx>] %pB!\n", panic_addr, - (void *)panic_addr); + (void *)(panic_addr + kaslr_offset())); }else {kvm_err ("nVHE hyp panic at: [<%016llx>] %pB!\n" , panic_addr, - (void *)panic_addr); + (void *)(panic_addr +kaslr_offset ())); }
Quoted 6 lines
Quoted 6 lines
arch/arm64/kvm/handle_exit.c +0
-0/* base-commit:
82a592c13b0aeff94d84d54183dae0b26384c95f--
2.37.0.170.g444d1eabd0-goog
_______________________________________________
kvmarm mailing list
[email protected]
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm