ia64/xen-unstable

view xen/arch/ia64/pal_emul.c @ 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
children a83ac0806d6b
line source
1 /* PAL/SAL call delegation
2 *
3 * Copyright (c) 2004 Li Susie <susie.li@intel.com>
4 * Copyright (c) 2005 Yu Ke <ke.yu@intel.com>
5 */
7 #include <asm/vmx_vcpu.h>
9 static void
10 get_pal_parameters (VCPU *vcpu, UINT64 *gr29,
11 UINT64 *gr30, UINT64 *gr31) {
13 vmx_vcpu_get_gr(vcpu,29,gr29);
14 vmx_vcpu_get_gr(vcpu,30,gr30);
15 vmx_vcpu_get_gr(vcpu,31,gr31);
16 }
18 static void
19 set_pal_result (VCPU *vcpu,struct ia64_pal_retval result) {
21 vmx_vcpu_set_gr(vcpu,8, result.status,0);
22 vmx_vcpu_set_gr(vcpu,9, result.v0,0);
23 vmx_vcpu_set_gr(vcpu,10, result.v1,0);
24 vmx_vcpu_set_gr(vcpu,11, result.v2,0);
25 }
28 static struct ia64_pal_retval
29 pal_cache_flush (VCPU *vcpu) {
30 UINT64 gr28,gr29, gr30, gr31;
31 struct ia64_pal_retval result;
33 get_pal_parameters (vcpu, &gr29, &gr30, &gr31);
34 vmx_vcpu_get_gr(vcpu,28,&gr28);
36 /* Always call Host Pal in int=1 */
37 gr30 = gr30 &(~(0x2UL));
39 /* call Host PAL cache flush */
40 result=ia64_pal_call_static(gr28 ,gr29, gr30,gr31,1); // Clear psr.ic when call PAL_CACHE_FLUSH
42 /* If host PAL call is interrupted, then loop to complete it */
43 // while (result.status == 1) {
44 // ia64_pal_call_static(gr28 ,gr29, gr30,
45 // result.v1,1LL);
46 // }
47 while (result.status != 0) {
48 panic("PAL_CACHE_FLUSH ERROR, status %d", result.status);
49 }
51 return result;
52 }
54 static struct ia64_pal_retval
55 pal_vm_tr_read (VCPU *vcpu ) {
56 #warning pal_vm_tr_read: to be implemented
57 struct ia64_pal_retval result;
59 result.status= -1; //unimplemented
61 return result;
62 }
65 static struct ia64_pal_retval
66 pal_prefetch_visibility (VCPU *vcpu) {
67 /* Due to current MM virtualization algorithm,
68 * We do not allow guest to change mapping attribute.
69 * Thus we will not support PAL_PREFETCH_VISIBILITY
70 */
71 struct ia64_pal_retval result;
73 result.status= -1; //unimplemented
75 return result;
76 }
78 static struct ia64_pal_retval
79 pal_platform_addr(VCPU *vcpu) {
80 struct ia64_pal_retval result;
82 result.status= 0; //success
84 return result;
85 }
87 static struct ia64_pal_retval
88 pal_halt (VCPU *vcpu) {
89 #warning pal_halt: to be implemented
90 //bugbug: to be implement.
91 struct ia64_pal_retval result;
93 result.status= -1; //unimplemented
95 return result;
96 }
99 static struct ia64_pal_retval
100 pal_halt_light (VCPU *vcpu) {
101 #if 0
102 // GVMM will go back to HVMM and ask HVMM to call yield().
103 vmmdata.p_ctlblk->status = VM_OK;
104 vmmdata.p_ctlblk->ctlcode = ExitVM_YIELD;
106 vmm_transition((UINT64)&vmmdata.p_gsa->guest,
107 (UINT64)&vmmdata.p_gsa->host,
108 (UINT64) vmmdata.p_tramp,0,0);
111 result.status = 0;
112 result.pal_result[0]=0;
113 result.pal_result[1]=0;
114 result.pal_result[2]=0;
116 return result;
117 #endif
118 struct ia64_pal_retval result;
120 result.status= -1; //unimplemented
122 return result;
123 }
125 static struct ia64_pal_retval
126 pal_cache_read (VCPU *vcpu) {
127 struct ia64_pal_retval result;
129 result.status= -1; //unimplemented
131 return result;
132 }
134 static struct ia64_pal_retval
135 pal_cache_write (VCPU *vcpu) {
136 struct ia64_pal_retval result;
138 result.status= -1; //unimplemented
140 return result;
141 }
143 static struct ia64_pal_retval
144 pal_bus_get_features(VCPU *vcpu){
146 }
148 static struct ia64_pal_retval
149 pal_cache_summary(VCPU *vcpu){
151 }
153 static struct ia64_pal_retval
154 pal_cache_init(VCPU *vcpu){
155 struct ia64_pal_retval result;
156 result.status=0;
157 return result;
158 }
160 static struct ia64_pal_retval
161 pal_cache_info(VCPU *vcpu){
162 }
164 static struct ia64_pal_retval
165 pal_cache_prot_info(VCPU *vcpu){
166 }
168 static struct ia64_pal_retval
169 pal_cache_shared_info(VCPU *vcpu){
170 }
172 static struct ia64_pal_retval
173 pal_mem_attrib(VCPU *vcpu){
174 }
176 static struct ia64_pal_retval
177 pal_debug_info(VCPU *vcpu){
178 }
180 static struct ia64_pal_retval
181 pal_fixed_addr(VCPU *vcpu){
182 }
184 static struct ia64_pal_retval
185 pal_freq_base(VCPU *vcpu){
186 }
188 static struct ia64_pal_retval
189 pal_freq_ratios(VCPU *vcpu){
190 }
192 static struct ia64_pal_retval
193 pal_halt_info(VCPU *vcpu){
194 }
196 static struct ia64_pal_retval
197 pal_logical_to_physica(VCPU *vcpu){
198 }
200 static struct ia64_pal_retval
201 pal_perf_mon_info(VCPU *vcpu){
202 }
204 static struct ia64_pal_retval
205 pal_proc_get_features(VCPU *vcpu){
206 }
208 static struct ia64_pal_retval
209 pal_ptce_info(VCPU *vcpu){
210 }
212 static struct ia64_pal_retval
213 pal_register_info(VCPU *vcpu){
214 }
216 static struct ia64_pal_retval
217 pal_rse_info(VCPU *vcpu){
218 }
220 static struct ia64_pal_retval
221 pal_test_info(VCPU *vcpu){
222 }
224 static struct ia64_pal_retval
225 pal_vm_summary(VCPU *vcpu){
226 }
228 static struct ia64_pal_retval
229 pal_vm_info(VCPU *vcpu){
230 }
232 static struct ia64_pal_retval
233 pal_vm_page_size(VCPU *vcpu){
234 }
236 void
237 pal_emul( VCPU *vcpu) {
238 UINT64 gr28;
239 struct ia64_pal_retval result;
242 vmx_vcpu_get_gr(vcpu,28,&gr28); //bank1
244 switch (gr28) {
245 case PAL_CACHE_FLUSH:
246 result = pal_cache_flush (vcpu);
247 break;
249 case PAL_PREFETCH_VISIBILITY:
250 result = pal_prefetch_visibility (vcpu);
251 break;
253 case PAL_VM_TR_READ:
254 result = pal_vm_tr_read (vcpu);
255 break;
257 case PAL_HALT:
258 result = pal_halt (vcpu);
259 break;
261 case PAL_HALT_LIGHT:
262 result = pal_halt_light (vcpu);
263 break;
265 case PAL_CACHE_READ:
266 result = pal_cache_read (vcpu);
267 break;
269 case PAL_CACHE_WRITE:
270 result = pal_cache_write (vcpu);
271 break;
273 case PAL_PLATFORM_ADDR:
274 result = pal_platform_addr (vcpu);
275 break;
277 default:
278 panic("pal_emul(): guest call unsupported pal" );
279 }
280 set_pal_result (vcpu, result);
281 }