1 #ifndef __ASM_IA64_KVM_H
2 #define __ASM_IA64_KVM_H
5 * kvm structure definitions for ia64
7 * Copyright (C) 2007 Xiantao Zhang <xiantao.zhang@intel.com>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms and conditions of the GNU General Public License,
11 * version 2, as published by the Free Software Foundation.
13 * This program is distributed in the hope it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18 * You should have received a copy of the GNU General Public License along with
19 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20 * Place - Suite 330, Boston, MA 02111-1307 USA.
24 #include <linux/types.h>
25 #include <linux/ioctl.h>
27 /* Select x86 specific features in <linux/kvm.h> */
28 #define __KVM_HAVE_IOAPIC
29 #define __KVM_HAVE_IRQ_LINE
30 #define __KVM_HAVE_DEVICE_ASSIGNMENT
32 /* Architectural interrupt line count. */
33 #define KVM_NR_INTERRUPTS 256
35 #define KVM_IOAPIC_NUM_PINS 48
37 struct kvm_ioapic_state
{
49 __u8 delivery_status
:1;
58 } redirtbl
[KVM_IOAPIC_NUM_PINS
];
61 #define KVM_IRQCHIP_PIC_MASTER 0
62 #define KVM_IRQCHIP_PIC_SLAVE 1
63 #define KVM_IRQCHIP_IOAPIC 2
64 #define KVM_NR_IRQCHIPS 3
66 #define KVM_CONTEXT_SIZE 8*1024
70 unsigned long bits
[2];
71 long double __dummy
; /* force 16-byte alignment */
77 char dummy
[KVM_CONTEXT_SIZE
];
81 unsigned long caller_unat
;
84 unsigned long ar
[128];
86 unsigned long cr
[128];
91 struct kvm_fpreg fr
[128];
98 unsigned long p
: 1; /* 0 */
99 unsigned long rv1
: 1; /* 1 */
100 unsigned long ma
: 3; /* 2-4 */
101 unsigned long a
: 1; /* 5 */
102 unsigned long d
: 1; /* 6 */
103 unsigned long pl
: 2; /* 7-8 */
104 unsigned long ar
: 3; /* 9-11 */
105 unsigned long ppn
: 38; /* 12-49 */
106 unsigned long rv2
: 2; /* 50-51 */
107 unsigned long ed
: 1; /* 52 */
108 unsigned long ig1
: 11; /* 53-63 */
111 unsigned long __rv1
: 53; /* 0-52 */
112 unsigned long contiguous
: 1; /*53 */
113 unsigned long tc
: 1; /* 54 TR or TC */
114 unsigned long cl
: 1;
115 /* 55 I side or D side cache line */
116 unsigned long len
: 4; /* 56-59 */
117 unsigned long io
: 1; /* 60 entry is for io or not */
118 unsigned long nomap
: 1;
119 /* 61 entry cann't be inserted into machine TLB.*/
120 unsigned long checked
: 1;
121 /* 62 for VTLB/VHPT sanity check */
122 unsigned long invalid
: 1;
123 /* 63 invalid entry */
125 unsigned long page_flags
;
126 }; /* same for VHPT and TLB */
130 unsigned long rv3
: 2;
131 unsigned long ps
: 6;
132 unsigned long key
: 24;
133 unsigned long rv4
: 32;
139 unsigned long ig2
: 12;
140 unsigned long vpn
: 49;
141 unsigned long vrn
: 3;
146 unsigned long tag
: 63;
147 unsigned long ti
: 1;
152 struct thash_data
*next
;
154 unsigned long gpaddr
;
163 unsigned long vgr
[16];
164 unsigned long vbgr
[16];
167 unsigned long vcpuid
[5];
171 unsigned long vcr
[128];
176 unsigned long rsv1
[5];
178 unsigned long rsv2
[7];
189 unsigned long rsv4
[38];
194 unsigned long irr
[4];
198 unsigned long rsv5
[5];
201 unsigned long rsv6
[46];
207 struct saved_vpd vpd
;
210 unsigned long vmm_rr
;
212 struct thash_data itrs
[NITRS
];
213 struct thash_data dtrs
[NDTRS
];
214 /* Bit is set if there is a tr/tc for the region. */
215 unsigned char itr_regions
;
216 unsigned char dtr_regions
;
217 unsigned char tc_regions
;
220 unsigned long saved_itc
;
221 unsigned long itc_check
;
222 unsigned long timer_check
;
223 unsigned long timer_pending
;
224 unsigned long last_itc
;
226 unsigned long vrr
[8];
227 unsigned long ibr
[8];
228 unsigned long dbr
[8];
229 unsigned long insvc
[4]; /* Interrupt in service. */
232 unsigned long metaphysical_rr0
; /* from kvm_arch (so is pinned) */
233 unsigned long metaphysical_rr4
; /* from kvm_arch (so is pinned) */
234 unsigned long metaphysical_saved_rr0
; /* from kvm_arch */
235 unsigned long metaphysical_saved_rr4
; /* from kvm_arch */
236 unsigned long fp_psr
; /*used for lazy float register */
237 unsigned long saved_gp
;
238 /*for phycial emulation */
240 union context saved_guest
;
242 unsigned long reserved
[64]; /* for future use */
251 #define KVM_IA64_VCPU_STACK_SHIFT 16
252 #define KVM_IA64_VCPU_STACK_SIZE (1UL << KVM_IA64_VCPU_STACK_SHIFT)
254 struct kvm_ia64_vcpu_stack
{
255 unsigned char stack
[KVM_IA64_VCPU_STACK_SIZE
];
258 struct kvm_debug_exit_arch
{
261 /* for KVM_SET_GUEST_DEBUG */
262 struct kvm_guest_debug_arch
{
265 /* definition of registers in kvm_run */
266 struct kvm_sync_regs
{