1#ifndef __ASM_IA64_KVM_H
2#define __ASM_IA64_KVM_H
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24#include <linux/types.h>
25#include <linux/ioctl.h>
26
27
28#define __KVM_HAVE_IOAPIC
29#define __KVM_HAVE_IRQ_LINE
30#define __KVM_HAVE_DEVICE_ASSIGNMENT
31
32
33#define KVM_NR_INTERRUPTS 256
34
35#define KVM_IOAPIC_NUM_PINS 48
36
37struct kvm_ioapic_state {
38 __u64 base_address;
39 __u32 ioregsel;
40 __u32 id;
41 __u32 irr;
42 __u32 pad;
43 union {
44 __u64 bits;
45 struct {
46 __u8 vector;
47 __u8 delivery_mode:3;
48 __u8 dest_mode:1;
49 __u8 delivery_status:1;
50 __u8 polarity:1;
51 __u8 remote_irr:1;
52 __u8 trig_mode:1;
53 __u8 mask:1;
54 __u8 reserve:7;
55 __u8 reserved[4];
56 __u8 dest_id;
57 } fields;
58 } redirtbl[KVM_IOAPIC_NUM_PINS];
59};
60
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
65
66#define KVM_CONTEXT_SIZE 8*1024
67
68struct kvm_fpreg {
69 union {
70 unsigned long bits[2];
71 long double __dummy;
72 } u;
73};
74
75union context {
76
77 char dummy[KVM_CONTEXT_SIZE];
78 struct {
79 unsigned long psr;
80 unsigned long pr;
81 unsigned long caller_unat;
82 unsigned long pad;
83 unsigned long gr[32];
84 unsigned long ar[128];
85 unsigned long br[8];
86 unsigned long cr[128];
87 unsigned long rr[8];
88 unsigned long ibr[8];
89 unsigned long dbr[8];
90 unsigned long pkr[8];
91 struct kvm_fpreg fr[128];
92 };
93};
94
95struct thash_data {
96 union {
97 struct {
98 unsigned long p : 1;
99 unsigned long rv1 : 1;
100 unsigned long ma : 3;
101 unsigned long a : 1;
102 unsigned long d : 1;
103 unsigned long pl : 2;
104 unsigned long ar : 3;
105 unsigned long ppn : 38;
106 unsigned long rv2 : 2;
107 unsigned long ed : 1;
108 unsigned long ig1 : 11;
109 };
110 struct {
111 unsigned long __rv1 : 53;
112 unsigned long contiguous : 1;
113 unsigned long tc : 1;
114 unsigned long cl : 1;
115
116 unsigned long len : 4;
117 unsigned long io : 1;
118 unsigned long nomap : 1;
119
120 unsigned long checked : 1;
121
122 unsigned long invalid : 1;
123
124 };
125 unsigned long page_flags;
126 };
127
128 union {
129 struct {
130 unsigned long rv3 : 2;
131 unsigned long ps : 6;
132 unsigned long key : 24;
133 unsigned long rv4 : 32;
134 };
135 unsigned long itir;
136 };
137 union {
138 struct {
139 unsigned long ig2 : 12;
140 unsigned long vpn : 49;
141 unsigned long vrn : 3;
142 };
143 unsigned long ifa;
144 unsigned long vadr;
145 struct {
146 unsigned long tag : 63;
147 unsigned long ti : 1;
148 };
149 unsigned long etag;
150 };
151 union {
152 struct thash_data *next;
153 unsigned long rid;
154 unsigned long gpaddr;
155 };
156};
157
158#define NITRS 8
159#define NDTRS 8
160
161struct saved_vpd {
162 unsigned long vhpi;
163 unsigned long vgr[16];
164 unsigned long vbgr[16];
165 unsigned long vnat;
166 unsigned long vbnat;
167 unsigned long vcpuid[5];
168 unsigned long vpsr;
169 unsigned long vpr;
170 union {
171 unsigned long vcr[128];
172 struct {
173 unsigned long dcr;
174 unsigned long itm;
175 unsigned long iva;
176 unsigned long rsv1[5];
177 unsigned long pta;
178 unsigned long rsv2[7];
179 unsigned long ipsr;
180 unsigned long isr;
181 unsigned long rsv3;
182 unsigned long iip;
183 unsigned long ifa;
184 unsigned long itir;
185 unsigned long iipa;
186 unsigned long ifs;
187 unsigned long iim;
188 unsigned long iha;
189 unsigned long rsv4[38];
190 unsigned long lid;
191 unsigned long ivr;
192 unsigned long tpr;
193 unsigned long eoi;
194 unsigned long irr[4];
195 unsigned long itv;
196 unsigned long pmv;
197 unsigned long cmcv;
198 unsigned long rsv5[5];
199 unsigned long lrr0;
200 unsigned long lrr1;
201 unsigned long rsv6[46];
202 };
203 };
204};
205
206struct kvm_regs {
207 struct saved_vpd vpd;
208
209 int mp_state;
210 unsigned long vmm_rr;
211
212 struct thash_data itrs[NITRS];
213 struct thash_data dtrs[NDTRS];
214
215 unsigned char itr_regions;
216 unsigned char dtr_regions;
217 unsigned char tc_regions;
218
219 char irq_check;
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;
225
226 unsigned long vrr[8];
227 unsigned long ibr[8];
228 unsigned long dbr[8];
229 unsigned long insvc[4];
230 unsigned long xtp;
231
232 unsigned long metaphysical_rr0;
233 unsigned long metaphysical_rr4;
234 unsigned long metaphysical_saved_rr0;
235 unsigned long metaphysical_saved_rr4;
236 unsigned long fp_psr;
237 unsigned long saved_gp;
238
239
240 union context saved_guest;
241
242 unsigned long reserved[64];
243};
244
245struct kvm_sregs {
246};
247
248struct kvm_fpu {
249};
250
251#define KVM_IA64_VCPU_STACK_SHIFT 16
252#define KVM_IA64_VCPU_STACK_SIZE (1UL << KVM_IA64_VCPU_STACK_SHIFT)
253
254struct kvm_ia64_vcpu_stack {
255 unsigned char stack[KVM_IA64_VCPU_STACK_SIZE];
256};
257
258struct kvm_debug_exit_arch {
259};
260
261
262struct kvm_guest_debug_arch {
263};
264
265
266struct kvm_sync_regs {
267};
268
269#endif
270