xref: /freebsd/sys/arm64/vmm/vmm_vhe.c (revision bbe97db3c211bd0a89a5b9c1a58857625b763475)
1*bbe97db3SAndrew Turner /*-
2*bbe97db3SAndrew Turner  * SPDX-License-Identifier: BSD-2-Clause
3*bbe97db3SAndrew Turner  *
4*bbe97db3SAndrew Turner  * Copyright (c) 2024 Arm Ltd
5*bbe97db3SAndrew Turner  *
6*bbe97db3SAndrew Turner  * Redistribution and use in source and binary forms, with or without
7*bbe97db3SAndrew Turner  * modification, are permitted provided that the following conditions
8*bbe97db3SAndrew Turner  * are met:
9*bbe97db3SAndrew Turner  * 1. Redistributions of source code must retain the above copyright
10*bbe97db3SAndrew Turner  *    notice, this list of conditions and the following disclaimer.
11*bbe97db3SAndrew Turner  * 2. Redistributions in binary form must reproduce the above copyright
12*bbe97db3SAndrew Turner  *    notice, this list of conditions and the following disclaimer in the
13*bbe97db3SAndrew Turner  *    documentation and/or other materials provided with the distribution.
14*bbe97db3SAndrew Turner  *
15*bbe97db3SAndrew Turner  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16*bbe97db3SAndrew Turner  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17*bbe97db3SAndrew Turner  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18*bbe97db3SAndrew Turner  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19*bbe97db3SAndrew Turner  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20*bbe97db3SAndrew Turner  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21*bbe97db3SAndrew Turner  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22*bbe97db3SAndrew Turner  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23*bbe97db3SAndrew Turner  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24*bbe97db3SAndrew Turner  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25*bbe97db3SAndrew Turner  * SUCH DAMAGE.
26*bbe97db3SAndrew Turner  */
27*bbe97db3SAndrew Turner 
28*bbe97db3SAndrew Turner #include "vmm_handlers.h"
29*bbe97db3SAndrew Turner 
30*bbe97db3SAndrew Turner #define	VMM_VHE
31*bbe97db3SAndrew Turner 
32*bbe97db3SAndrew Turner #define	VMM_STATIC
33*bbe97db3SAndrew Turner #define	VMM_HYP_FUNC(func)	vmm_vhe_ ## func
34*bbe97db3SAndrew Turner 
35*bbe97db3SAndrew Turner #define	guest_or_nonvhe(guest)	(guest)
36*bbe97db3SAndrew Turner #define	EL1_REG(reg)		MRS_REG_ALT_NAME(reg ## _EL12)
37*bbe97db3SAndrew Turner #define	EL0_REG(reg)		MRS_REG_ALT_NAME(reg ## _EL02)
38*bbe97db3SAndrew Turner 
39*bbe97db3SAndrew Turner #include "vmm_hyp.c"
40