diff options
author | Andrew Scull <ascull@google.com> | 2021-03-18 14:33:10 +0000 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2021-04-01 09:54:37 +0100 |
commit | f79e616f27ab6cd74deb0995a8eead3d1c9d65af (patch) | |
tree | 7f431057f04a8887299e706bcd8aec5774557258 /arch/arm64/kvm/hyp/nvhe/hyp-main.c | |
parent | bug: Assign values once in bug_get_file_line() (diff) | |
download | linux-dev-f79e616f27ab6cd74deb0995a8eead3d1c9d65af.tar.xz linux-dev-f79e616f27ab6cd74deb0995a8eead3d1c9d65af.zip |
KVM: arm64: Use BUG and BUG_ON in nVHE hyp
hyp_panic() reports the address of the panic by using ELR_EL2, but this
isn't a useful address when hyp_panic() is called directly. Replace such
direct calls with BUG() and BUG_ON() which use BRK to trigger an
exception that then goes to hyp_panic() with the correct address. Also
remove the hyp_panic() declaration from the header file to avoid
accidental misuse.
Signed-off-by: Andrew Scull <ascull@google.com>
Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210318143311.839894-5-ascull@google.com
Diffstat (limited to 'arch/arm64/kvm/hyp/nvhe/hyp-main.c')
-rw-r--r-- | arch/arm64/kvm/hyp/nvhe/hyp-main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm64/kvm/hyp/nvhe/hyp-main.c b/arch/arm64/kvm/hyp/nvhe/hyp-main.c index 936328207bde..821a69601dd9 100644 --- a/arch/arm64/kvm/hyp/nvhe/hyp-main.c +++ b/arch/arm64/kvm/hyp/nvhe/hyp-main.c @@ -178,6 +178,6 @@ void handle_trap(struct kvm_cpu_context *host_ctxt) handle_host_smc(host_ctxt); break; default: - hyp_panic(); + BUG(); } } |