Lines 35-51
Link Here
|
35 |
.xdata4 ".data.patch.brl_fsys_bubble_down", 1b-. |
35 |
.xdata4 ".data.patch.brl_fsys_bubble_down", 1b-. |
36 |
|
36 |
|
37 |
#ifdef CONFIG_XEN_IA64_VDSO_PARAVIRT |
37 |
#ifdef CONFIG_XEN_IA64_VDSO_PARAVIRT |
38 |
// The page in which hyperprivop lives must be pinned by ITR. |
|
|
39 |
// However vDSO area isn't pinned. So issuing hyperprivop |
40 |
// from vDSO page causes trouble that Kevin pointed out. |
41 |
// After clearing vpsr.ic, the vcpu is pre-empted and the itlb |
42 |
// is flushed. Then vcpu get cpu again, tlb miss fault occures. |
43 |
// However it results in nested dtlb fault because vpsr.ic is off. |
44 |
// To avoid such a situation, we jump into the kernel text area |
45 |
// which is pinned, and then issue hyperprivop and return back |
46 |
// to vDSO page. |
47 |
// This is Dan Magenheimer's idea. |
48 |
|
49 |
// Currently is_running_on_xen() is defined as running_on_xen. |
38 |
// Currently is_running_on_xen() is defined as running_on_xen. |
50 |
// If is_running_on_xen() is a real function, we must update |
39 |
// If is_running_on_xen() is a real function, we must update |
51 |
// according to it. |
40 |
// according to it. |
Lines 55-72
Link Here
|
55 |
[1:] movl reg=0; \ |
44 |
[1:] movl reg=0; \ |
56 |
.xdata4 ".data.patch.running_on_xen", 1b-. |
45 |
.xdata4 ".data.patch.running_on_xen", 1b-. |
57 |
|
46 |
|
58 |
.section ".data.patch.brl_xen_ssm_i_0", "a" |
47 |
#endif /* CONFIG_XEN_IA64_VDSO_PARAVIRT */ |
59 |
.previous |
|
|
60 |
#define BRL_COND_XEN_SSM_I_0(pr) \ |
61 |
[1:](pr)brl.cond.sptk 0; \ |
62 |
.xdata4 ".data.patch.brl_xen_ssm_i_0", 1b-. |
63 |
|
64 |
.section ".data.patch.brl_xen_ssm_i_1", "a" |
65 |
.previous |
66 |
#define BRL_COND_XEN_SSM_I_1(pr) \ |
67 |
[1:](pr)brl.cond.sptk 0; \ |
68 |
.xdata4 ".data.patch.brl_xen_ssm_i_1", 1b-. |
69 |
#endif |
70 |
|
48 |
|
71 |
GLOBAL_ENTRY(__kernel_syscall_via_break) |
49 |
GLOBAL_ENTRY(__kernel_syscall_via_break) |
72 |
.prologue |
50 |
.prologue |
Lines 111-121
GLOBAL_ENTRY(__kernel_syscall_via_epc)
Link Here
|
111 |
mov r10=0 // A default to successful syscall execution |
89 |
mov r10=0 // A default to successful syscall execution |
112 |
epc // B causes split-issue |
90 |
epc // B causes split-issue |
113 |
} |
91 |
} |
114 |
;; |
|
|
115 |
#ifdef CONFIG_XEN_IA64_VDSO_PARAVIRT |
92 |
#ifdef CONFIG_XEN_IA64_VDSO_PARAVIRT |
116 |
// r20 = 1 |
93 |
// r20 = 1 |
117 |
// r22 = &vcpu->vcpu_info->evtchn_upcall_mask |
94 |
// r22 = &vcpu->vcpu_info->evtchn_upcall_mask |
118 |
// r23 = &vpsr.ic |
|
|
119 |
// r24 = &vcpu->vcpu_info->evtchn_upcall_pending |
95 |
// r24 = &vcpu->vcpu_info->evtchn_upcall_pending |
120 |
// r25 = tmp |
96 |
// r25 = tmp |
121 |
// r28 = &running_on_xen |
97 |
// r28 = &running_on_xen |
Lines 130-151
GLOBAL_ENTRY(__kernel_syscall_via_epc)
Link Here
|
130 |
#define isRaw p13 |
106 |
#define isRaw p13 |
131 |
LOAD_RUNNING_ON_XEN(r28) |
107 |
LOAD_RUNNING_ON_XEN(r28) |
132 |
movl r22=XSI_PSR_I_ADDR |
108 |
movl r22=XSI_PSR_I_ADDR |
133 |
;; |
|
|
134 |
ld8 r22=[r22] |
135 |
;; |
136 |
movl r23=XSI_PSR_IC |
137 |
adds r24=-1,r22 |
138 |
mov r20=1 |
109 |
mov r20=1 |
139 |
;; |
110 |
;; |
140 |
ld4 r30=[r28] |
111 |
ld4 r30=[r28] |
141 |
;; |
112 |
;; |
142 |
cmp.ne isXen,isRaw=r0,r30 |
113 |
cmp.ne isXen,isRaw=r0,r30 |
143 |
;; |
114 |
;; |
|
|
115 |
(isXen) ld8 r22=[r22] |
116 |
;; |
144 |
(isRaw) rsm psr.be | psr.i |
117 |
(isRaw) rsm psr.be | psr.i |
|
|
118 |
(isXen) adds r24=-1,r22 |
145 |
(isXen) st1 [r22]=r20 |
119 |
(isXen) st1 [r22]=r20 |
146 |
(isXen) rum psr.be |
120 |
(isXen) rum psr.be |
147 |
;; |
|
|
148 |
#else |
121 |
#else |
|
|
122 |
;; |
149 |
rsm psr.be | psr.i // M2 (5 cyc to srlz.d) |
123 |
rsm psr.be | psr.i // M2 (5 cyc to srlz.d) |
150 |
#endif |
124 |
#endif |
151 |
LOAD_FSYSCALL_TABLE(r14) // X |
125 |
LOAD_FSYSCALL_TABLE(r14) // X |
Lines 177-191
GLOBAL_ENTRY(__kernel_syscall_via_epc)
Link Here
|
177 |
nop.m 0 |
151 |
nop.m 0 |
178 |
(p6) tbit.z.unc p8,p0=r18,0 // I0 (dual-issues with "mov b7=r18"!) |
152 |
(p6) tbit.z.unc p8,p0=r18,0 // I0 (dual-issues with "mov b7=r18"!) |
179 |
#ifdef CONFIG_XEN_IA64_VDSO_PARAVIRT |
153 |
#ifdef CONFIG_XEN_IA64_VDSO_PARAVIRT |
180 |
;; |
154 |
|
|
|
155 |
#define XEN_SET_PSR_I(pred) \ |
156 |
(pred) ld1 r31=[r22]; \ |
157 |
;; ; \ |
158 |
(pred) st1 [r22]=r0; \ |
159 |
(pred) cmp.ne.unc p14,p0=r0,r31; \ |
160 |
;; ; \ |
161 |
(p14) ld1 r25=[r24]; \ |
162 |
;; ; \ |
163 |
(p14) cmp.ne.unc p11,p0=r0,r25; \ |
164 |
;; ; \ |
165 |
(p11) XEN_HYPER_SSM_I; |
166 |
|
167 |
;; |
181 |
// p14 = running_on_xen && p8 |
168 |
// p14 = running_on_xen && p8 |
182 |
// p15 = !running_on_xen && p8 |
169 |
// p15 = !running_on_xen && p8 |
183 |
(p8) cmp.ne.unc p14,p15=r0,r30 |
170 |
(p8) cmp.ne.unc p14,p15=r0,r30 |
184 |
;; |
171 |
;; |
185 |
(p15) ssm psr.i |
172 |
(p15) ssm psr.i |
186 |
BRL_COND_XEN_SSM_I_0(p14) |
173 |
XEN_SET_PSR_I(p14) |
187 |
.global .vdso_ssm_i_0_ret |
|
|
188 |
.vdso_ssm_i_0_ret: |
189 |
#else |
174 |
#else |
190 |
nop.i 0 |
175 |
nop.i 0 |
191 |
;; |
176 |
;; |
Lines 213-231
GLOBAL_ENTRY(__kernel_syscall_via_epc)
Link Here
|
213 |
#endif |
198 |
#endif |
214 |
#ifdef CONFIG_XEN_IA64_VDSO_PARAVIRT |
199 |
#ifdef CONFIG_XEN_IA64_VDSO_PARAVIRT |
215 |
(isRaw) ssm psr.i |
200 |
(isRaw) ssm psr.i |
216 |
BRL_COND_XEN_SSM_I_1(isXen) |
201 |
XEN_SET_PSR_I(isXen) |
217 |
.global .vdso_ssm_i_1_ret |
|
|
218 |
.vdso_ssm_i_1_ret: |
219 |
#else |
202 |
#else |
220 |
ssm psr.i |
203 |
ssm psr.i |
221 |
#endif |
204 |
#endif |
222 |
mov r10=-1 |
205 |
mov r10=-1 |
223 |
(p10) mov r8=EINVAL |
206 |
(p10) mov r8=EINVAL |
224 |
#ifdef CONFIG_XEN_IA64_VDSO_PARAVIRT |
|
|
225 |
dv_serialize_data // shut up gas warning. |
226 |
// we know xen_hyper_ssm_i_0 or xen_hyper_ssm_i_1 |
227 |
// doesn't change p9 and p10 |
228 |
#endif |
229 |
(p9) mov r8=ENOSYS |
207 |
(p9) mov r8=ENOSYS |
230 |
FSYS_RETURN |
208 |
FSYS_RETURN |
231 |
END(__kernel_syscall_via_epc) |
209 |
END(__kernel_syscall_via_epc) |