]> pilppa.org Git - linux-2.6-omap-h63xx.git/blob - include/asm-ia64/kvm.h
Merge branch 'audit.b50' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit...
[linux-2.6-omap-h63xx.git] / include / asm-ia64 / kvm.h
1 #ifndef __ASM_IA64_KVM_H
2 #define __ASM_IA64_KVM_H
3
4 /*
5  * asm-ia64/kvm.h: kvm structure definitions  for ia64
6  *
7  * Copyright (C) 2007 Xiantao Zhang <xiantao.zhang@intel.com>
8  *
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.
12  *
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
16  * more details.
17  *
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.
21  *
22  */
23
24 #include <asm/types.h>
25 #include <asm/fpu.h>
26
27 #include <linux/ioctl.h>
28
29 /* Architectural interrupt line count. */
30 #define KVM_NR_INTERRUPTS 256
31
32 #define KVM_IOAPIC_NUM_PINS  24
33
34 struct kvm_ioapic_state {
35         __u64 base_address;
36         __u32 ioregsel;
37         __u32 id;
38         __u32 irr;
39         __u32 pad;
40         union {
41                 __u64 bits;
42                 struct {
43                         __u8 vector;
44                         __u8 delivery_mode:3;
45                         __u8 dest_mode:1;
46                         __u8 delivery_status:1;
47                         __u8 polarity:1;
48                         __u8 remote_irr:1;
49                         __u8 trig_mode:1;
50                         __u8 mask:1;
51                         __u8 reserve:7;
52                         __u8 reserved[4];
53                         __u8 dest_id;
54                 } fields;
55         } redirtbl[KVM_IOAPIC_NUM_PINS];
56 };
57
58 #define KVM_IRQCHIP_PIC_MASTER   0
59 #define KVM_IRQCHIP_PIC_SLAVE    1
60 #define KVM_IRQCHIP_IOAPIC       2
61
62 #define KVM_CONTEXT_SIZE        8*1024
63
64 union context {
65         /* 8K size */
66         char    dummy[KVM_CONTEXT_SIZE];
67         struct {
68                 unsigned long       psr;
69                 unsigned long       pr;
70                 unsigned long       caller_unat;
71                 unsigned long       pad;
72                 unsigned long       gr[32];
73                 unsigned long       ar[128];
74                 unsigned long       br[8];
75                 unsigned long       cr[128];
76                 unsigned long       rr[8];
77                 unsigned long       ibr[8];
78                 unsigned long       dbr[8];
79                 unsigned long       pkr[8];
80                 struct ia64_fpreg   fr[128];
81         };
82 };
83
84 struct thash_data {
85         union {
86                 struct {
87                         unsigned long p    :  1; /* 0 */
88                         unsigned long rv1  :  1; /* 1 */
89                         unsigned long ma   :  3; /* 2-4 */
90                         unsigned long a    :  1; /* 5 */
91                         unsigned long d    :  1; /* 6 */
92                         unsigned long pl   :  2; /* 7-8 */
93                         unsigned long ar   :  3; /* 9-11 */
94                         unsigned long ppn  : 38; /* 12-49 */
95                         unsigned long rv2  :  2; /* 50-51 */
96                         unsigned long ed   :  1; /* 52 */
97                         unsigned long ig1  : 11; /* 53-63 */
98                 };
99                 struct {
100                         unsigned long __rv1 : 53;     /* 0-52 */
101                         unsigned long contiguous : 1; /*53 */
102                         unsigned long tc : 1;         /* 54 TR or TC */
103                         unsigned long cl : 1;
104                         /* 55 I side or D side cache line */
105                         unsigned long len  :  4;      /* 56-59 */
106                         unsigned long io  : 1;  /* 60 entry is for io or not */
107                         unsigned long nomap : 1;
108                         /* 61 entry cann't be inserted into machine TLB.*/
109                         unsigned long checked : 1;
110                         /* 62 for VTLB/VHPT sanity check */
111                         unsigned long invalid : 1;
112                         /* 63 invalid entry */
113                 };
114                 unsigned long page_flags;
115         };                  /* same for VHPT and TLB */
116
117         union {
118                 struct {
119                         unsigned long rv3  :  2;
120                         unsigned long ps   :  6;
121                         unsigned long key  : 24;
122                         unsigned long rv4  : 32;
123                 };
124                 unsigned long itir;
125         };
126         union {
127                 struct {
128                         unsigned long ig2  :  12;
129                         unsigned long vpn  :  49;
130                         unsigned long vrn  :   3;
131                 };
132                 unsigned long ifa;
133                 unsigned long vadr;
134                 struct {
135                         unsigned long tag  :  63;
136                         unsigned long ti   :  1;
137                 };
138                 unsigned long etag;
139         };
140         union {
141                 struct thash_data *next;
142                 unsigned long rid;
143                 unsigned long gpaddr;
144         };
145 };
146
147 #define NITRS   8
148 #define NDTRS   8
149
150 struct saved_vpd {
151         unsigned long  vhpi;
152         unsigned long  vgr[16];
153         unsigned long  vbgr[16];
154         unsigned long  vnat;
155         unsigned long  vbnat;
156         unsigned long  vcpuid[5];
157         unsigned long  vpsr;
158         unsigned long  vpr;
159         unsigned long  vcr[128];
160 };
161
162 struct kvm_regs {
163         char *saved_guest;
164         char *saved_stack;
165         struct saved_vpd vpd;
166         /*Arch-regs*/
167         int mp_state;
168         unsigned long vmm_rr;
169         /* TR and TC.  */
170         struct thash_data itrs[NITRS];
171         struct thash_data dtrs[NDTRS];
172         /* Bit is set if there is a tr/tc for the region.  */
173         unsigned char itr_regions;
174         unsigned char dtr_regions;
175         unsigned char tc_regions;
176
177         char irq_check;
178         unsigned long saved_itc;
179         unsigned long itc_check;
180         unsigned long timer_check;
181         unsigned long timer_pending;
182         unsigned long last_itc;
183
184         unsigned long vrr[8];
185         unsigned long ibr[8];
186         unsigned long dbr[8];
187         unsigned long insvc[4];         /* Interrupt in service.  */
188         unsigned long xtp;
189
190         unsigned long metaphysical_rr0; /* from kvm_arch (so is pinned) */
191         unsigned long metaphysical_rr4; /* from kvm_arch (so is pinned) */
192         unsigned long metaphysical_saved_rr0; /* from kvm_arch          */
193         unsigned long metaphysical_saved_rr4; /* from kvm_arch          */
194         unsigned long fp_psr;       /*used for lazy float register */
195         unsigned long saved_gp;
196         /*for phycial  emulation */
197 };
198
199 struct kvm_sregs {
200 };
201
202 struct kvm_fpu {
203 };
204
205 #endif