xref: /linux/arch/powerpc/include/asm/kvm_asm.h (revision b8b572e1015f81b4e748417be2629dfe51ab99f9)
1*b8b572e1SStephen Rothwell /*
2*b8b572e1SStephen Rothwell  * This program is free software; you can redistribute it and/or modify
3*b8b572e1SStephen Rothwell  * it under the terms of the GNU General Public License, version 2, as
4*b8b572e1SStephen Rothwell  * published by the Free Software Foundation.
5*b8b572e1SStephen Rothwell  *
6*b8b572e1SStephen Rothwell  * This program is distributed in the hope that it will be useful,
7*b8b572e1SStephen Rothwell  * but WITHOUT ANY WARRANTY; without even the implied warranty of
8*b8b572e1SStephen Rothwell  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9*b8b572e1SStephen Rothwell  * GNU General Public License for more details.
10*b8b572e1SStephen Rothwell  *
11*b8b572e1SStephen Rothwell  * You should have received a copy of the GNU General Public License
12*b8b572e1SStephen Rothwell  * along with this program; if not, write to the Free Software
13*b8b572e1SStephen Rothwell  * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
14*b8b572e1SStephen Rothwell  *
15*b8b572e1SStephen Rothwell  * Copyright IBM Corp. 2008
16*b8b572e1SStephen Rothwell  *
17*b8b572e1SStephen Rothwell  * Authors: Hollis Blanchard <hollisb@us.ibm.com>
18*b8b572e1SStephen Rothwell  */
19*b8b572e1SStephen Rothwell 
20*b8b572e1SStephen Rothwell #ifndef __POWERPC_KVM_ASM_H__
21*b8b572e1SStephen Rothwell #define __POWERPC_KVM_ASM_H__
22*b8b572e1SStephen Rothwell 
23*b8b572e1SStephen Rothwell /* IVPR must be 64KiB-aligned. */
24*b8b572e1SStephen Rothwell #define VCPU_SIZE_ORDER 4
25*b8b572e1SStephen Rothwell #define VCPU_SIZE_LOG   (VCPU_SIZE_ORDER + 12)
26*b8b572e1SStephen Rothwell #define VCPU_TLB_PGSZ   PPC44x_TLB_64K
27*b8b572e1SStephen Rothwell #define VCPU_SIZE_BYTES (1<<VCPU_SIZE_LOG)
28*b8b572e1SStephen Rothwell 
29*b8b572e1SStephen Rothwell #define BOOKE_INTERRUPT_CRITICAL 0
30*b8b572e1SStephen Rothwell #define BOOKE_INTERRUPT_MACHINE_CHECK 1
31*b8b572e1SStephen Rothwell #define BOOKE_INTERRUPT_DATA_STORAGE 2
32*b8b572e1SStephen Rothwell #define BOOKE_INTERRUPT_INST_STORAGE 3
33*b8b572e1SStephen Rothwell #define BOOKE_INTERRUPT_EXTERNAL 4
34*b8b572e1SStephen Rothwell #define BOOKE_INTERRUPT_ALIGNMENT 5
35*b8b572e1SStephen Rothwell #define BOOKE_INTERRUPT_PROGRAM 6
36*b8b572e1SStephen Rothwell #define BOOKE_INTERRUPT_FP_UNAVAIL 7
37*b8b572e1SStephen Rothwell #define BOOKE_INTERRUPT_SYSCALL 8
38*b8b572e1SStephen Rothwell #define BOOKE_INTERRUPT_AP_UNAVAIL 9
39*b8b572e1SStephen Rothwell #define BOOKE_INTERRUPT_DECREMENTER 10
40*b8b572e1SStephen Rothwell #define BOOKE_INTERRUPT_FIT 11
41*b8b572e1SStephen Rothwell #define BOOKE_INTERRUPT_WATCHDOG 12
42*b8b572e1SStephen Rothwell #define BOOKE_INTERRUPT_DTLB_MISS 13
43*b8b572e1SStephen Rothwell #define BOOKE_INTERRUPT_ITLB_MISS 14
44*b8b572e1SStephen Rothwell #define BOOKE_INTERRUPT_DEBUG 15
45*b8b572e1SStephen Rothwell #define BOOKE_MAX_INTERRUPT 15
46*b8b572e1SStephen Rothwell 
47*b8b572e1SStephen Rothwell #define RESUME_FLAG_NV          (1<<0)  /* Reload guest nonvolatile state? */
48*b8b572e1SStephen Rothwell #define RESUME_FLAG_HOST        (1<<1)  /* Resume host? */
49*b8b572e1SStephen Rothwell 
50*b8b572e1SStephen Rothwell #define RESUME_GUEST            0
51*b8b572e1SStephen Rothwell #define RESUME_GUEST_NV         RESUME_FLAG_NV
52*b8b572e1SStephen Rothwell #define RESUME_HOST             RESUME_FLAG_HOST
53*b8b572e1SStephen Rothwell #define RESUME_HOST_NV          (RESUME_FLAG_HOST|RESUME_FLAG_NV)
54*b8b572e1SStephen Rothwell 
55*b8b572e1SStephen Rothwell #endif /* __POWERPC_KVM_ASM_H__ */
56