ia64/xen-unstable

view xen/include/asm-ia64/vmx_vpd.h @ 5797:ca44d2dbb273

Intel's pre-bk->hg transition patches
Signed-off-by Eddie Dong <Eddie.dong@intel.com>
Signed-off-by Anthony Xu <Anthony.xu@intel.com>
Signed-off-by Kevin Tian <Kevin.tian@intel.com>
author djm@kirby.fc.hp.com
date Sat Jul 09 07:58:56 2005 -0700 (2005-07-09)
parents 649cd37aa1ab
children a83ac0806d6b
line source
1 /* -*- Mode:C; c-basic-offset:4; tab-width:4; indent-tabs-mode:nil -*- */
2 /*
3 * vmx.h: prototype for generial vmx related interface
4 * Copyright (c) 2004, Intel Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
17 * Place - Suite 330, Boston, MA 02111-1307 USA.
18 *
19 * Kun Tian (Kevin Tian) (kevin.tian@intel.com)
20 */
22 #ifndef _ASM_IA64_VMX_VPD_H_
23 #define _ASM_IA64_VMX_VPD_H_
25 #ifndef __ASSEMBLY__
27 #include <asm/vtm.h>
28 #include <asm/vmx_platform.h>
29 #include <public/arch-ia64.h>
31 #define VPD_SHIFT 17 /* 128K requirement */
32 #define VPD_SIZE (1 << VPD_SHIFT)
33 typedef union {
34 unsigned long value;
35 struct {
36 int a_int:1;
37 int a_from_int_cr:1;
38 int a_to_int_cr:1;
39 int a_from_psr:1;
40 int a_from_cpuid:1;
41 int a_cover:1;
42 int a_bsw:1;
43 long reserved:57;
44 };
45 } vac_t;
47 typedef union {
48 unsigned long value;
49 struct {
50 int d_vmsw:1;
51 int d_extint:1;
52 int d_ibr_dbr:1;
53 int d_pmc:1;
54 int d_to_pmd:1;
55 int d_itm:1;
56 long reserved:58;
57 };
58 } vdc_t;
60 typedef struct {
61 unsigned long dcr; // CR0
62 unsigned long itm;
63 unsigned long iva;
64 unsigned long rsv1[5];
65 unsigned long pta; // CR8
66 unsigned long rsv2[7];
67 unsigned long ipsr; // CR16
68 unsigned long isr;
69 unsigned long rsv3;
70 unsigned long iip;
71 unsigned long ifa;
72 unsigned long itir;
73 unsigned long iipa;
74 unsigned long ifs;
75 unsigned long iim; // CR24
76 unsigned long iha;
77 unsigned long rsv4[38];
78 unsigned long lid; // CR64
79 unsigned long ivr;
80 unsigned long tpr;
81 unsigned long eoi;
82 unsigned long irr[4];
83 unsigned long itv; // CR72
84 unsigned long pmv;
85 unsigned long cmcv;
86 unsigned long rsv5[5];
87 unsigned long lrr0; // CR80
88 unsigned long lrr1;
89 unsigned long rsv6[46];
90 } cr_t;
92 typedef struct vpd {
93 vac_t vac;
94 vdc_t vdc;
95 unsigned long virt_env_vaddr;
96 unsigned long reserved1[29];
97 unsigned long vhpi;
98 unsigned long reserved2[95];
99 unsigned long vgr[16];
100 unsigned long vbgr[16];
101 unsigned long vnat;
102 unsigned long vbnat;
103 unsigned long vcpuid[5];
104 unsigned long reserved3[11];
105 unsigned long vpsr;
106 unsigned long vpr;
107 unsigned long reserved4[76];
108 unsigned long vcr[128];
109 unsigned long reserved5[128];
110 unsigned long reserved6[3456];
111 unsigned long vmm_avail[128];
112 unsigned long reserved7[4096];
113 } vpd_t;
115 void vmx_enter_scheduler(void);
117 //FIXME: Map for LID to vcpu, Eddie
118 #define MAX_NUM_LPS (1UL<<16)
119 extern struct vcpu *lid_edt[MAX_NUM_LPS];
121 struct arch_vmx_struct {
122 // struct virutal_platform_def vmx_platform;
123 vpd_t *vpd;
124 vtime_t vtm;
125 unsigned long vrr[8];
126 unsigned long vkr[8];
127 unsigned long mrr5;
128 unsigned long mrr6;
129 unsigned long mrr7;
130 unsigned long mpta;
131 unsigned long rfi_pfs;
132 unsigned long rfi_iip;
133 unsigned long rfi_ipsr;
134 unsigned long rfi_ifs;
135 unsigned long in_service[4]; // vLsapic inservice IRQ bits
136 struct virutal_platform_def vmx_platform;
137 unsigned long flags;
138 };
140 #define vmx_schedule_tail(next) \
141 (next)->thread.arch_vmx.arch_vmx_schedule_tail((next))
143 #define VMX_DOMAIN(d) d->arch.arch_vmx.flags
145 #define ARCH_VMX_VMCS_LOADED 0 /* VMCS has been loaded and active */
146 #define ARCH_VMX_VMCS_LAUNCH 1 /* Needs VMCS launch */
147 #define ARCH_VMX_VMCS_RESUME 2 /* Needs VMCS resume */
148 #define ARCH_VMX_IO_WAIT 3 /* Waiting for I/O completion */
149 #define ARCH_VMX_INTR_ASSIST 4 /* Need DM's assist to issue intr */
152 #define VMX_DEBUG 1
153 #if VMX_DEBUG
154 #define DBG_LEVEL_0 (1 << 0)
155 #define DBG_LEVEL_1 (1 << 1)
156 #define DBG_LEVEL_2 (1 << 2)
157 #define DBG_LEVEL_3 (1 << 3)
158 #define DBG_LEVEL_IO (1 << 4)
159 #define DBG_LEVEL_VMMU (1 << 5)
161 extern unsigned int opt_vmx_debug_level;
162 #define VMX_DBG_LOG(level, _f, _a...) \
163 if ((level) & opt_vmx_debug_level) \
164 printk("[VMX]" _f "\n", ## _a )
165 #else
166 #define VMX_DBG_LOG(level, _f, _a...)
167 #endif
169 #define __vmx_bug(regs) \
170 do { \
171 printk("__vmx_bug at %s:%d\n", __FILE__, __LINE__); \
172 show_registers(regs); \
173 domain_crash(); \
174 } while (0)
176 #endif //__ASSEMBLY__
179 // VPD field offset
180 #define VPD_VAC_START_OFFSET 0
181 #define VPD_VDC_START_OFFSET 8
182 #define VPD_VHPI_START_OFFSET 256
183 #define VPD_VGR_START_OFFSET 1024
184 #define VPD_VBGR_START_OFFSET 1152
185 #define VPD_VNAT_START_OFFSET 1280
186 #define VPD_VBNAT_START_OFFSET 1288
187 #define VPD_VCPUID_START_OFFSET 1296
188 #define VPD_VPSR_START_OFFSET 1424
189 #define VPD_VPR_START_OFFSET 1432
190 #define VPD_VRSE_CFLE_START_OFFSET 1440
191 #define VPD_VCR_START_OFFSET 2048
192 #define VPD_VRR_START_OFFSET 3072
193 #define VPD_VMM_VAIL_START_OFFSET 31744
196 #endif /* _ASM_IA64_VMX_VPD_H_ */