ia64/xen-unstable

view xen/include/asm-ia64/vmx_pal.h @ 10668:50ed5c116b4d

[IA64] Enable FW accleration for VTi

Signed-off-by: Zhang xiantao <xiantao.zhang@intel.com>
author awilliam@xenbuild.aw
date Fri Jul 07 10:36:31 2006 -0600 (2006-07-07)
parents a9d58ef8e4e7
children
line source
1 #ifndef _ASM_IA64_VT_PAL_H
2 #define _ASM_IA64_VT_PAL_H
4 /* -*- Mode:C; c-basic-offset:4; tab-width:4; indent-tabs-mode:nil -*- */
5 /*
6 * vmx_pal.h: VT-I specific PAL (Processor Abstraction Layer) definitions
7 * Copyright (c) 2004, Intel Corporation.
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 * Xuefei Xu (Anthony Xu) (anthony.xu@intel.com)
23 * Fred Yang (fred.yang@intel.com)
24 * Kun Tian (Kevin Tian) (kevin.tian@intel.com)
25 */
27 #include <xen/types.h>
28 /* PAL PROCEDURE FOR VIRTUALIZATION */
29 #define PAL_VP_CREATE 265
30 /* Stacked Virt. Initializes a new VPD for the operation of
31 * a new virtual processor in the virtual environment.
32 */
33 #define PAL_VP_ENV_INFO 266
34 /*Stacked Virt. Returns the parameters needed to enter a virtual environment.*/
35 #define PAL_VP_EXIT_ENV 267
36 /*Stacked Virt. Allows a logical processor to exit a virtual environment.*/
37 #define PAL_VP_INIT_ENV 268
38 /*Stacked Virt. Allows a logical processor to enter a virtual environment.*/
39 #define PAL_VP_REGISTER 269
40 /*Stacked Virt. Register a different host IVT for the virtual processor.*/
41 #define PAL_VP_RESUME 270
42 /* Renamed from PAL_VP_RESUME */
43 #define PAL_VP_RESTORE 270
44 /*Stacked Virt. Resumes virtual processor operation on the logical processor.*/
45 #define PAL_VP_SUSPEND 271
46 /* Renamed from PAL_VP_SUSPEND */
47 #define PAL_VP_SAVE 271
48 /* Stacked Virt. Suspends operation for the specified virtual processor on
49 * the logical processor.
50 */
51 #define PAL_VP_TERMINATE 272
52 /* Stacked Virt. Terminates operation for the specified virtual processor.*/
54 static inline s64
55 ia64_pal_vp_env_info(u64 *buffer_size, u64 *vp_env_info)
56 {
57 struct ia64_pal_retval iprv;
58 PAL_CALL_STK(iprv, PAL_VP_ENV_INFO, 0, 0, 0);
59 *buffer_size=iprv.v0;
60 *vp_env_info=iprv.v1;
61 return iprv.status;
62 }
64 static inline s64
65 ia64_pal_vp_exit_env(u64 iva)
66 {
67 struct ia64_pal_retval iprv;
68 PAL_CALL_STK(iprv, PAL_VP_EXIT_ENV, (u64)iva, 0, 0);
69 return iprv.status;
70 }
72 /* config_options in pal_vp_init_env */
73 #define VP_INITIALIZE 1UL
74 #define VP_FR_PMC 1UL<<1
75 #define VP_OPCODE 1UL<<8
76 #define VP_CAUSE 1UL<<9
77 #define VP_FW_ACC 1UL<<63
78 /* init vp env with initializing vm_buffer */
79 #define VP_INIT_ENV_INITALIZE VP_INITIALIZE|VP_FR_PMC|VP_OPCODE|VP_CAUSE|VP_FW_ACC
80 /* init vp env without initializing vm_buffer */
81 #define VP_INIT_ENV VP_FR_PMC|VP_OPCODE|VP_CAUSE|VP_FW_ACC
83 static inline s64
84 ia64_pal_vp_init_env (u64 config_options, u64 pbase_addr, \
85 u64 vbase_addr, u64 * vsa_base)
86 {
87 struct ia64_pal_retval iprv;
88 PAL_CALL_STK(iprv, PAL_VP_INIT_ENV, config_options, pbase_addr,\
89 vbase_addr);
90 *vsa_base=iprv.v0;
91 return iprv.status;
92 }
94 static inline s64
95 ia64_pal_vp_create (u64 *vpd, u64 *host_iva, u64* opt_handler)
96 {
97 struct ia64_pal_retval iprv;
98 PAL_CALL_STK(iprv, PAL_VP_CREATE, (u64)vpd, (u64)host_iva,
99 (u64)opt_handler);
100 return iprv.status;
101 }
103 static inline s64
104 ia64_pal_vp_restore (u64 *vpd, u64 pal_proc_vector)
105 {
106 struct ia64_pal_retval iprv;
107 PAL_CALL_STK(iprv, PAL_VP_RESTORE, (u64)vpd, pal_proc_vector, 0);
108 return iprv.status;
109 }
111 static inline s64
112 ia64_pal_vp_save (u64 *vpd, u64 pal_proc_vector)
113 {
114 struct ia64_pal_retval iprv;
115 PAL_CALL_STK(iprv, PAL_VP_SAVE, (u64)vpd, pal_proc_vector, 0);
116 return iprv.status;
117 }
118 extern void pal_emul(struct vcpu *vcpu);
119 extern void sal_emul(struct vcpu *vcpu);
120 #define PAL_PROC_VM_BIT (1UL << 40)
121 #define PAL_PROC_VMSW_BIT (1UL << 54)
122 #endif /* _ASM_IA64_VT_PAL_H */