1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2012,2013 - ARM Ltd
4 * Author: Marc Zyngier <marc.zyngier@arm.com>
7 #include <linux/linkage.h>
9 #include <asm/alternative.h>
10 #include <asm/assembler.h>
11 #include <asm/cpufeature.h>
14 * u64 __kvm_call_hyp(void *hypfn, ...);
16 * This is not really a variadic function in the classic C-way and care must
17 * be taken when calling this to ensure parameters are passed in registers
18 * only, since the stack will change between the caller and the callee.
20 * Call the function with the first argument containing a pointer to the
21 * function you wish to call in Hyp mode, and subsequent arguments will be
22 * passed as x0, x1, and x2 (a maximum of 3 arguments in addition to the
23 * function pointer can be passed). The function being called must be mapped
24 * in Hyp mode (see init_hyp_mode in arch/arm/kvm/arm.c). Return values are
27 * A function pointer with a value less than 0xfff has a special meaning,
28 * and is used to implement hyp stubs in the same way as in
29 * arch/arm64/kernel/hyp_stub.S.
34 ENDPROC(__kvm_call_hyp)