]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
KVM: arm64: VHE: Mark __hyp_call_panic __noreturn
authorPierre-Clément Tosi <ptosi@google.com>
Mon, 10 Jun 2024 06:32:34 +0000 (07:32 +0100)
committerOliver Upton <oliver.upton@linux.dev>
Thu, 20 Jun 2024 17:40:54 +0000 (17:40 +0000)
Given that the sole purpose of __hyp_call_panic() is to call panic(), a
__noreturn function, give it the __noreturn attribute, removing the need
for its caller to use unreachable().

Signed-off-by: Pierre-Clément Tosi <ptosi@google.com>
Acked-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20240610063244.2828978-6-ptosi@google.com
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/kvm/hyp/vhe/switch.c

index 8fbb6a2e0559d7e7d8d90ce11b618f35a723c46e..ee1e1c5847e730425cf4b3b7f30db1bad83f6846 100644 (file)
@@ -388,7 +388,7 @@ int __kvm_vcpu_run(struct kvm_vcpu *vcpu)
        return ret;
 }
 
-static void __hyp_call_panic(u64 spsr, u64 elr, u64 par)
+static void __noreturn __hyp_call_panic(u64 spsr, u64 elr, u64 par)
 {
        struct kvm_cpu_context *host_ctxt;
        struct kvm_vcpu *vcpu;
@@ -413,7 +413,6 @@ void __noreturn hyp_panic(void)
        u64 par = read_sysreg_par();
 
        __hyp_call_panic(spsr, elr, par);
-       unreachable();
 }
 
 asmlinkage void kvm_unexpected_el2_exception(void)