blob: 0ccdcbbef3c20ce0b4afa9874eb128cf55beb683 [file] [log] [blame]
Marc Zyngier55c74012012-12-10 16:40:18 +00001/*
2 * Copyright (C) 2012,2013 - ARM Ltd
3 * Author: Marc Zyngier <marc.zyngier@arm.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include <linux/linkage.h>
Marc Zyngier55c74012012-12-10 16:40:18 +000019
Mark Rutlandc6d01a92014-11-24 13:59:30 +000020#include <asm/assembler.h>
Marc Zyngier55c74012012-12-10 16:40:18 +000021
Marc Zyngierb20c9f22014-02-26 18:47:36 +000022/*
23 * u64 kvm_call_hyp(void *hypfn, ...);
24 *
25 * This is not really a variadic function in the classic C-way and care must
26 * be taken when calling this to ensure parameters are passed in registers
27 * only, since the stack will change between the caller and the callee.
28 *
29 * Call the function with the first argument containing a pointer to the
30 * function you wish to call in Hyp mode, and subsequent arguments will be
31 * passed as x0, x1, and x2 (a maximum of 3 arguments in addition to the
32 * function pointer can be passed). The function being called must be mapped
33 * in Hyp mode (see init_hyp_mode in arch/arm/kvm/arm.c). Return values are
Marc Zyngier1ea66d22015-10-25 15:51:41 +000034 * passed in x0.
Marc Zyngierb20c9f22014-02-26 18:47:36 +000035 *
36 * A function pointer with a value of 0 has a special meaning, and is
37 * used to implement __hyp_get_vectors in the same way as in
38 * arch/arm64/kernel/hyp_stub.S.
39 */
Marc Zyngier55c74012012-12-10 16:40:18 +000040ENTRY(kvm_call_hyp)
41 hvc #0
42 ret
43ENDPROC(kvm_call_hyp)