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