2019-05-29 21:12:40 +07:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2013-01-21 06:28:06 +07:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2012 - Virtual Open Systems and Columbia University
|
|
|
|
* Author: Christoffer Dall <c.dall@virtualopensystems.com>
|
|
|
|
*/
|
2013-01-21 06:28:06 +07:00
|
|
|
|
|
|
|
#include <linux/linkage.h>
|
|
|
|
|
|
|
|
.text
|
|
|
|
|
|
|
|
/********************************************************************
|
|
|
|
* Call function in Hyp mode
|
|
|
|
*
|
|
|
|
*
|
2016-01-06 19:10:58 +07:00
|
|
|
* unsigned long kvm_call_hyp(void *hypfn, ...);
|
2013-01-21 06:28:06 +07:00
|
|
|
*
|
|
|
|
* This is not really a variadic function in the classic C-way and care must
|
|
|
|
* be taken when calling this to ensure parameters are passed in registers
|
|
|
|
* only, since the stack will change between the caller and the callee.
|
|
|
|
*
|
|
|
|
* Call the function with the first argument containing a pointer to the
|
|
|
|
* function you wish to call in Hyp mode, and subsequent arguments will be
|
|
|
|
* passed as r0, r1, and r2 (a maximum of 3 arguments in addition to the
|
|
|
|
* function pointer can be passed). The function being called must be mapped
|
|
|
|
* in Hyp mode (see init_hyp_mode in arch/arm/kvm/arm.c). Return values are
|
2016-01-06 19:10:58 +07:00
|
|
|
* passed in r0 (strictly 32bit).
|
2013-01-21 06:28:06 +07:00
|
|
|
*
|
|
|
|
* The calling convention follows the standard AAPCS:
|
|
|
|
* r0 - r3: caller save
|
|
|
|
* r12: caller save
|
|
|
|
* rest: callee save
|
|
|
|
*/
|
2019-01-11 21:57:58 +07:00
|
|
|
ENTRY(__kvm_call_hyp)
|
2013-01-21 06:28:06 +07:00
|
|
|
hvc #0
|
|
|
|
bx lr
|
2019-01-11 21:57:58 +07:00
|
|
|
ENDPROC(__kvm_call_hyp)
|