Skip to content

Commit 05d557a

Browse files
arndbctmarinas
authored andcommitted
arm64: kvm: add prototypes for functions called in asm
A lot of kvm specific functions are called only from assembler and have no extern prototype, but that causes a W=1 warnings: arch/arm64/kvm/handle_exit.c:365:24: error: no previous prototype for 'nvhe_hyp_panic_handler' [-Werror=missing-prototypes] arch/arm64/kvm/va_layout.c:188:6: error: no previous prototype for 'kvm_patch_vector_branch' [-Werror=mi ssing-prototypes] arch/arm64/kvm/va_layout.c:287:6: error: no previous prototype for 'kvm_get_kimage_voffset' [-Werror=mis sing-prototypes] arch/arm64/kvm/va_layout.c:293:6: error: no previous prototype for 'kvm_compute_final_ctr_el0' [-Werror= missing-prototypes] arch/arm64/kvm/hyp/vhe/switch.c:259:17: error: no previous prototype for 'hyp_panic' [-Werror=missing-pr arch/arm64/kvm/hyp/nvhe/switch.c:389:17: error: no previous prototype for 'kvm_unexpected_el2_exception' arch/arm64/kvm/hyp/nvhe/switch.c:384:28: error: no previous prototype for 'hyp_panic_bad_stack' [-Werror arch/arm64/kvm/hyp/nvhe/hyp-main.c:383:6: error: no previous prototype for 'handle_trap' [-Werror=missin arch/arm64/kvm/hyp/nvhe/psci-relay.c:203:28: error: no previous prototype for 'kvm_host_psci_cpu_entry' [-Werror=missing-prototypes] Declare those in asm/kvm_asm.h, which already has related declarations. Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Kees Cook <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 010089e commit 05d557a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

arch/arm64/include/asm/kvm_asm.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,24 @@ extern u64 __kvm_get_mdcr_el2(void);
267267
__kvm_at_err; \
268268
} )
269269

270+
void __noreturn hyp_panic(void);
271+
asmlinkage void kvm_unexpected_el2_exception(void);
272+
asmlinkage void __noreturn hyp_panic(void);
273+
asmlinkage void __noreturn hyp_panic_bad_stack(void);
274+
asmlinkage void kvm_unexpected_el2_exception(void);
275+
struct kvm_cpu_context;
276+
void handle_trap(struct kvm_cpu_context *host_ctxt);
277+
asmlinkage void __noreturn kvm_host_psci_cpu_entry(bool is_cpu_on);
278+
void __noreturn __pkvm_init_finalise(void);
279+
void kvm_nvhe_prepare_backtrace(unsigned long fp, unsigned long pc);
280+
void kvm_patch_vector_branch(struct alt_instr *alt,
281+
__le32 *origptr, __le32 *updptr, int nr_inst);
282+
void kvm_get_kimage_voffset(struct alt_instr *alt,
283+
__le32 *origptr, __le32 *updptr, int nr_inst);
284+
void kvm_compute_final_ctr_el0(struct alt_instr *alt,
285+
__le32 *origptr, __le32 *updptr, int nr_inst);
286+
void __noreturn __cold nvhe_hyp_panic_handler(u64 esr, u64 spsr, u64 elr_virt,
287+
u64 elr_phys, u64 par, uintptr_t vcpu, u64 far, u64 hpfar);
270288

271289
#else /* __ASSEMBLY__ */
272290

0 commit comments

Comments
 (0)