2019-06-03 12:44:50 +07:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2012-12-10 23:40:18 +07:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2012,2013 - ARM Ltd
|
|
|
|
* Author: Marc Zyngier <marc.zyngier@arm.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/linkage.h>
|
|
|
|
|
2015-01-29 20:52:12 +07:00
|
|
|
#include <asm/alternative.h>
|
2014-11-24 20:59:30 +07:00
|
|
|
#include <asm/assembler.h>
|
2015-01-29 20:52:12 +07:00
|
|
|
#include <asm/cpufeature.h>
|
2012-12-10 23:40:18 +07:00
|
|
|
|
2014-02-27 01:47:36 +07:00
|
|
|
/*
|
2016-02-16 19:52:39 +07:00
|
|
|
* u64 __kvm_call_hyp(void *hypfn, ...);
|
2014-02-27 01:47:36 +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 x0, x1, and x2 (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
|
2015-10-25 22:51:41 +07:00
|
|
|
* passed in x0.
|
2014-02-27 01:47:36 +07:00
|
|
|
*
|
2016-04-27 23:47:03 +07:00
|
|
|
* A function pointer with a value less than 0xfff has a special meaning,
|
2017-04-04 01:38:04 +07:00
|
|
|
* and is used to implement hyp stubs in the same way as in
|
2014-02-27 01:47:36 +07:00
|
|
|
* arch/arm64/kernel/hyp_stub.S.
|
|
|
|
*/
|
2020-02-19 02:58:37 +07:00
|
|
|
SYM_FUNC_START(__kvm_call_hyp)
|
2012-12-10 23:40:18 +07:00
|
|
|
hvc #0
|
|
|
|
ret
|
2020-02-19 02:58:37 +07:00
|
|
|
SYM_FUNC_END(__kvm_call_hyp)
|