ia64/xen-unstable

view xen/include/asm-ia64/vmx_vpd.h @ 7720:b2ea26d2099a

Support recent change moving virtual IOAPIC model into Xen for
ia64/VTI. Now ia64/vti will create links to arch/x86/dm/vmx_vioapic.c
and include/x86/vmx_vlapic.h.

Firstly, a small change to common virtual IOAPIC model to be used by
both sides. Also some compilation fix to tools is included in first
one. Secondly, there are ia64-specific changes to hook to common
IOAPIC model.

Based on this patch upon latest xen-ia64-unstable tip, we can see
multiple domains working again on XEN/IA64, including both domU and
VTI domain simultaneously in run-time.

Signed-off-by Kevin Tian <kevin.tian@intel.com>
Signed-off-by Anthony Xu <Anthony.xu@intel.com>
Signed-off-by Yunhong Jiang <yunhong.jiang@intel.com>
Signed-off-by Eddie Dong <eddie.dong@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Nov 09 14:53:12 2005 +0100 (2005-11-09)
parents 06d84bf87159
children bdf1a8039d13
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)
34 typedef struct {
35 unsigned long dcr; // CR0
36 unsigned long itm;
37 unsigned long iva;
38 unsigned long rsv1[5];
39 unsigned long pta; // CR8
40 unsigned long rsv2[7];
41 unsigned long ipsr; // CR16
42 unsigned long isr;
43 unsigned long rsv3;
44 unsigned long iip;
45 unsigned long ifa;
46 unsigned long itir;
47 unsigned long iipa;
48 unsigned long ifs;
49 unsigned long iim; // CR24
50 unsigned long iha;
51 unsigned long rsv4[38];
52 unsigned long lid; // CR64
53 unsigned long ivr;
54 unsigned long tpr;
55 unsigned long eoi;
56 unsigned long irr[4];
57 unsigned long itv; // CR72
58 unsigned long pmv;
59 unsigned long cmcv;
60 unsigned long rsv5[5];
61 unsigned long lrr0; // CR80
62 unsigned long lrr1;
63 unsigned long rsv6[46];
64 } cr_t;
66 struct arch_vmx_struct {
67 // struct virutal_platform_def vmx_platform;
68 // vpd_t *vpd;
69 vtime_t vtm;
70 struct vlapic vlapic;
71 unsigned long vrr[8];
72 unsigned long vkr[8];
73 unsigned long cr_iipa; /* for emulation */
74 unsigned long cr_isr; /* for emulation */
75 unsigned long cause;
76 unsigned long opcode;
78 // unsigned long mrr5;
79 // unsigned long mrr6;
80 // unsigned long mrr7;
81 unsigned long mpta;
82 // unsigned long rfi_pfs;
83 // unsigned long rfi_iip;
84 // unsigned long rfi_ipsr;
85 // unsigned long rfi_ifs;
86 // unsigned long in_service[4]; // vLsapic inservice IRQ bits
87 unsigned long flags;
88 };
90 #define vmx_schedule_tail(next) \
91 (next)->thread.arch_vmx.arch_vmx_schedule_tail((next))
93 #define VMX_DOMAIN(d) d->arch.arch_vmx.flags
95 #define ARCH_VMX_VMCS_LOADED 0 /* VMCS has been loaded and active */
96 #define ARCH_VMX_VMCS_LAUNCH 1 /* Needs VMCS launch */
97 #define ARCH_VMX_VMCS_RESUME 2 /* Needs VMCS resume */
98 #define ARCH_VMX_IO_WAIT 3 /* Waiting for I/O completion */
99 #define ARCH_VMX_INTR_ASSIST 4 /* Need DM's assist to issue intr */
100 #define ARCH_VMX_CONTIG_MEM 5 /* Need contiguous machine pages */
103 #define VMX_DEBUG 1
104 #if VMX_DEBUG
105 #define DBG_LEVEL_0 (1 << 0)
106 #define DBG_LEVEL_1 (1 << 1)
107 #define DBG_LEVEL_2 (1 << 2)
108 #define DBG_LEVEL_3 (1 << 3)
109 #define DBG_LEVEL_IO (1 << 4)
110 #define DBG_LEVEL_VMMU (1 << 5)
111 #define DBG_LEVEL_IOAPIC (1 << 6)
113 extern unsigned int opt_vmx_debug_level;
114 #define VMX_DBG_LOG(level, _f, _a...) \
115 if ((level) & opt_vmx_debug_level) \
116 printk("[VMX]" _f "\n", ## _a )
117 #else
118 #define VMX_DBG_LOG(level, _f, _a...)
119 #endif
121 #define __vmx_bug(regs) \
122 do { \
123 printk("__vmx_bug at %s:%d\n", __FILE__, __LINE__); \
124 show_registers(regs); \
125 domain_crash(); \
126 } while (0)
128 #endif //__ASSEMBLY__
130 // VPD field offset
131 #define VPD_VAC_START_OFFSET 0
132 #define VPD_VDC_START_OFFSET 8
133 #define VPD_VHPI_START_OFFSET 256
134 #define VPD_VGR_START_OFFSET 1024
135 #define VPD_VBGR_START_OFFSET 1152
136 #define VPD_VNAT_START_OFFSET 1280
137 #define VPD_VBNAT_START_OFFSET 1288
138 #define VPD_VCPUID_START_OFFSET 1296
139 #define VPD_VPSR_START_OFFSET 1424
140 #define VPD_VPR_START_OFFSET 1432
141 #define VPD_VRSE_CFLE_START_OFFSET 1440
142 #define VPD_VCR_START_OFFSET 2048
143 #define VPD_VRR_START_OFFSET 3072
144 #define VPD_VMM_VAIL_START_OFFSET 31744
147 #endif /* _ASM_IA64_VMX_VPD_H_ */