xref: /haiku/headers/private/kernel/arch/arm64/arch_hypervisor.h (revision 46b7da1f4f40f7157d74fc7fb26ff9ec7f2416f2)
1*f9412d9fSurnenfeld /*-
2*f9412d9fSurnenfeld  * Copyright (c) 2013, 2014 Andrew Turner
3*f9412d9fSurnenfeld  * All rights reserved.
4*f9412d9fSurnenfeld  *
5*f9412d9fSurnenfeld  * Redistribution and use in source and binary forms, with or without
6*f9412d9fSurnenfeld  * modification, are permitted provided that the following conditions
7*f9412d9fSurnenfeld  * are met:
8*f9412d9fSurnenfeld  * 1. Redistributions of source code must retain the above copyright
9*f9412d9fSurnenfeld  *    notice, this list of conditions and the following disclaimer.
10*f9412d9fSurnenfeld  * 2. Redistributions in binary form must reproduce the above copyright
11*f9412d9fSurnenfeld  *    notice, this list of conditions and the following disclaimer in the
12*f9412d9fSurnenfeld  *    documentation and/or other materials provided with the distribution.
13*f9412d9fSurnenfeld  *
14*f9412d9fSurnenfeld  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15*f9412d9fSurnenfeld  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16*f9412d9fSurnenfeld  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17*f9412d9fSurnenfeld  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18*f9412d9fSurnenfeld  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19*f9412d9fSurnenfeld  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20*f9412d9fSurnenfeld  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21*f9412d9fSurnenfeld  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22*f9412d9fSurnenfeld  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23*f9412d9fSurnenfeld  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24*f9412d9fSurnenfeld  * SUCH DAMAGE.
25*f9412d9fSurnenfeld  *
26*f9412d9fSurnenfeld  * $FreeBSD$
27*f9412d9fSurnenfeld  */
28*f9412d9fSurnenfeld 
29*f9412d9fSurnenfeld #ifndef _MACHINE_HYPERVISOR_H_
30*f9412d9fSurnenfeld #define _MACHINE_HYPERVISOR_H_
31*f9412d9fSurnenfeld 
32*f9412d9fSurnenfeld /*
33*f9412d9fSurnenfeld  * These registers are only useful when in hypervisor context,
34*f9412d9fSurnenfeld  * e.g. specific to EL2, or controlling the hypervisor.
35*f9412d9fSurnenfeld  */
36*f9412d9fSurnenfeld 
37*f9412d9fSurnenfeld /*
38*f9412d9fSurnenfeld  * Architecture feature trap register
39*f9412d9fSurnenfeld  */
40*f9412d9fSurnenfeld #define	CPTR_RES0	0x7fefc800
41*f9412d9fSurnenfeld #define	CPTR_RES1	0x000033ff
42*f9412d9fSurnenfeld #define	CPTR_TFP	0x00000400
43*f9412d9fSurnenfeld #define	CPTR_TTA	0x00100000
44*f9412d9fSurnenfeld #define	CPTR_TCPAC	0x80000000
45*f9412d9fSurnenfeld 
46*f9412d9fSurnenfeld /*
47*f9412d9fSurnenfeld  * Hypervisor Config Register
48*f9412d9fSurnenfeld  */
49*f9412d9fSurnenfeld 
50*f9412d9fSurnenfeld #define	HCR_VM		0x0000000000000001
51*f9412d9fSurnenfeld #define	HCR_SWIO	0x0000000000000002
52*f9412d9fSurnenfeld #define	HCR_PTW		0x0000000000000004
53*f9412d9fSurnenfeld #define	HCR_FMO		0x0000000000000008
54*f9412d9fSurnenfeld #define	HCR_IMO		0x0000000000000010
55*f9412d9fSurnenfeld #define	HCR_AMO		0x0000000000000020
56*f9412d9fSurnenfeld #define	HCR_VF		0x0000000000000040
57*f9412d9fSurnenfeld #define	HCR_VI		0x0000000000000080
58*f9412d9fSurnenfeld #define	HCR_VSE		0x0000000000000100
59*f9412d9fSurnenfeld #define	HCR_FB		0x0000000000000200
60*f9412d9fSurnenfeld #define	HCR_BSU_MASK	0x0000000000000c00
61*f9412d9fSurnenfeld #define	HCR_DC		0x0000000000001000
62*f9412d9fSurnenfeld #define	HCR_TWI		0x0000000000002000
63*f9412d9fSurnenfeld #define	HCR_TWE		0x0000000000004000
64*f9412d9fSurnenfeld #define	HCR_TID0	0x0000000000008000
65*f9412d9fSurnenfeld #define	HCR_TID1	0x0000000000010000
66*f9412d9fSurnenfeld #define	HCR_TID2	0x0000000000020000
67*f9412d9fSurnenfeld #define	HCR_TID3	0x0000000000040000
68*f9412d9fSurnenfeld #define	HCR_TSC		0x0000000000080000
69*f9412d9fSurnenfeld #define	HCR_TIDCP	0x0000000000100000
70*f9412d9fSurnenfeld #define	HCR_TACR	0x0000000000200000
71*f9412d9fSurnenfeld #define	HCR_TSW		0x0000000000400000
72*f9412d9fSurnenfeld #define	HCR_TPC		0x0000000000800000
73*f9412d9fSurnenfeld #define	HCR_TPU		0x0000000001000000
74*f9412d9fSurnenfeld #define	HCR_TTLB	0x0000000002000000
75*f9412d9fSurnenfeld #define	HCR_TVM		0x0000000004000000
76*f9412d9fSurnenfeld #define	HCR_TGE		0x0000000008000000
77*f9412d9fSurnenfeld #define	HCR_TDZ		0x0000000010000000
78*f9412d9fSurnenfeld #define	HCR_HCD		0x0000000020000000
79*f9412d9fSurnenfeld #define	HCR_TRVM	0x0000000040000000
80*f9412d9fSurnenfeld #define	HCR_RW		0x0000000080000000
81*f9412d9fSurnenfeld #define	HCR_CD		0x0000000100000000
82*f9412d9fSurnenfeld #define	HCR_ID		0x0000000200000000
83*f9412d9fSurnenfeld 
84*f9412d9fSurnenfeld #endif
85*f9412d9fSurnenfeld 
86