Go to the documentation of this file.
23 #ifndef __ASM_KVM_HOST_H
24 #define __ASM_KVM_HOST_H
26 #define KVM_MEMORY_SLOTS 32
28 #define KVM_PRIVATE_MEM_SLOTS 4
30 #define KVM_COALESCED_MMIO_PAGE_OFFSET 1
33 #define EXIT_REASON_VM_PANIC 0
34 #define EXIT_REASON_MMIO_INSTRUCTION 1
35 #define EXIT_REASON_PAL_CALL 2
36 #define EXIT_REASON_SAL_CALL 3
37 #define EXIT_REASON_SWITCH_RR6 4
38 #define EXIT_REASON_VM_DESTROY 5
39 #define EXIT_REASON_EXTERNAL_INTERRUPT 6
40 #define EXIT_REASON_IPI 7
41 #define EXIT_REASON_PTC_G 8
42 #define EXIT_REASON_DEBUG 20
45 #define KVM_VMM_SIZE (__IA64_UL_CONST(16)<<20)
46 #define KVM_VMM_SHIFT 24
47 #define KVM_VMM_BASE 0xD000000000000000
48 #define VMM_SIZE (__IA64_UL_CONST(8)<<20)
54 #define KVM_VM_BUFFER_BASE (KVM_VMM_BASE + VMM_SIZE)
55 #define KVM_VM_BUFFER_SIZE (__IA64_UL_CONST(8)<<20)
94 #define KVM_VM_DATA_SHIFT 26
95 #define KVM_VM_DATA_SIZE (__IA64_UL_CONST(1) << KVM_VM_DATA_SHIFT)
96 #define KVM_VM_DATA_BASE (KVM_VMM_BASE + KVM_VM_DATA_SIZE)
98 #define KVM_P2M_BASE KVM_VM_DATA_BASE
99 #define KVM_P2M_SIZE (__IA64_UL_CONST(24) << 20)
101 #define VHPT_SHIFT 16
102 #define VHPT_SIZE (__IA64_UL_CONST(1) << VHPT_SHIFT)
103 #define VHPT_NUM_ENTRIES (__IA64_UL_CONST(1) << (VHPT_SHIFT-5))
105 #define VTLB_SHIFT 16
106 #define VTLB_SIZE (__IA64_UL_CONST(1) << VTLB_SHIFT)
107 #define VTLB_NUM_ENTRIES (1UL << (VHPT_SHIFT-5))
110 #define VPD_SIZE (__IA64_UL_CONST(1) << VPD_SHIFT)
112 #define VCPU_STRUCT_SHIFT 16
113 #define VCPU_STRUCT_SIZE (__IA64_UL_CONST(1) << VCPU_STRUCT_SHIFT)
118 #define KVM_STK_SHIFT 16
119 #define KVM_STK_OFFSET (__IA64_UL_CONST(1)<< KVM_STK_SHIFT)
121 #define KVM_VM_STRUCT_SHIFT 19
122 #define KVM_VM_STRUCT_SIZE (__IA64_UL_CONST(1) << KVM_VM_STRUCT_SHIFT)
124 #define KVM_MEM_DIRY_LOG_SHIFT 19
125 #define KVM_MEM_DIRTY_LOG_SIZE (__IA64_UL_CONST(1) << KVM_MEM_DIRY_LOG_SHIFT)
130 #define KVM_MAX_VCPUS (KVM_VM_DATA_SIZE - KVM_P2M_SIZE - KVM_VM_STRUCT_SIZE -\
131 KVM_MEM_DIRTY_LOG_SIZE) / sizeof(struct kvm_vcpu_data)
132 #define KVM_MAX_MEM_SIZE (KVM_P2M_SIZE >> 3 << PAGE_SHIFT)
134 #define VMM_LOG_LEN 256
136 #include <linux/types.h>
139 #include <linux/kvm_para.h>
144 #include <asm/page.h>
160 #define VCPU_BASE(n) (KVM_VM_DATA_BASE + \
161 offsetof(struct kvm_vm_data, vcpu_data[n]))
162 #define KVM_VM_BASE (KVM_VM_DATA_BASE + \
163 offsetof(struct kvm_vm_data, kvm_vm_struct))
164 #define KVM_MEM_DIRTY_LOG_BASE KVM_VM_DATA_BASE + \
165 offsetof(struct kvm_vm_data, kvm_mem_dirty_log)
167 #define VHPT_BASE(n) (VCPU_BASE(n) + offsetof(struct kvm_vcpu_data, vcpu_vhpt))
168 #define VTLB_BASE(n) (VCPU_BASE(n) + offsetof(struct kvm_vcpu_data, vcpu_vtlb))
169 #define VPD_BASE(n) (VCPU_BASE(n) + offsetof(struct kvm_vcpu_data, vcpu_vpd))
170 #define VCPU_STRUCT_BASE(n) (VCPU_BASE(n) + \
171 offsetof(struct kvm_vcpu_data, vcpu_struct))
175 #define IOREQ_WRITE 0
177 #define STATE_IOREQ_NONE 0
178 #define STATE_IOREQ_READY 1
179 #define STATE_IOREQ_INPROCESS 2
180 #define STATE_IORESP_READY 3
183 #define GPFN_MEM (0UL << 60)
184 #define GPFN_FRAME_BUFFER (1UL << 60)
185 #define GPFN_LOW_MMIO (2UL << 60)
186 #define GPFN_PIB (3UL << 60)
187 #define GPFN_IOSAPIC (4UL << 60)
188 #define GPFN_LEGACY_IO (5UL << 60)
189 #define GPFN_GFW (6UL << 60)
190 #define GPFN_PHYS_MMIO (7UL << 60)
192 #define GPFN_IO_MASK (7UL << 60)
193 #define GPFN_INV_MASK (1UL << 63)
194 #define INVALID_MFN (~0UL)
195 #define MEM_G (1UL << 30)
196 #define MEM_M (1UL << 20)
197 #define MMIO_START (3 * MEM_G)
198 #define MMIO_SIZE (512 * MEM_M)
199 #define VGA_IO_START 0xA0000UL
200 #define VGA_IO_SIZE 0x20000
201 #define LEGACY_IO_START (MMIO_START + MMIO_SIZE)
202 #define LEGACY_IO_SIZE (64 * MEM_M)
203 #define IO_SAPIC_START 0xfec00000UL
204 #define IO_SAPIC_SIZE 0x100000
205 #define PIB_START 0xfee00000UL
206 #define PIB_SIZE 0x200000
207 #define GFW_START (4 * MEM_G - 16 * MEM_M)
208 #define GFW_SIZE (16 * MEM_M)
211 #define dest_Fixed IOSAPIC_FIXED
212 #define dest_LowestPrio IOSAPIC_LOWEST_PRIORITY
215 #define ExtINT_VECTOR 0
216 #define NULL_VECTOR (-1)
217 #define IA64_SPURIOUS_INT_VECTOR 0x0f
219 #define VCPU_LID(v) (((u64)(v)->vcpu_id) << 24)
224 #define SAPIC_DELIV_SHIFT 8
225 #define SAPIC_FIXED 0x0
226 #define SAPIC_LOWEST_PRIORITY 0x1
227 #define SAPIC_PMI 0x2
228 #define SAPIC_NMI 0x4
229 #define SAPIC_INIT 0x5
230 #define SAPIC_EXTINT 0x7
235 #define KVM_REQ_PTC_G 32
236 #define KVM_REQ_RESUME 33
238 #define KVM_HPAGE_GFN_SHIFT(x) 0
239 #define KVM_NR_PAGE_SIZES 1
240 #define KVM_PAGES_PER_HPAGE(x) 1
287 unsigned long rv : 3;
288 unsigned long ir : 1;
290 unsigned long id : 8;
299 unsigned long dm : 3;
300 unsigned long ig : 53;
337 unsigned long ma : 3;
340 unsigned long pl : 2;
341 unsigned long ar : 3;
344 unsigned long ed : 1;
351 unsigned long ve : 1;
354 unsigned long vf : 1;
379 #define KVM_MP_STATE_RUNNABLE 0
380 #define KVM_MP_STATE_UNINITIALIZED 1
381 #define KVM_MP_STATE_INIT_RECEIVED 2
382 #define KVM_MP_STATE_HALTED 3
385 #define MAX_PTC_G_NUM 3
599 #define __KVM_HAVE_ARCH_VM_ALLOC 1