aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/s390/kvm/gaccess.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/arch/s390/kvm/gaccess.c b/arch/s390/kvm/gaccess.c
index 6dc0ad9c7050..8f195fa904a1 100644
--- a/arch/s390/kvm/gaccess.c
+++ b/arch/s390/kvm/gaccess.c
@@ -229,12 +229,10 @@ static void ipte_lock_simple(struct kvm_vcpu *vcpu)
229 goto out; 229 goto out;
230 ic = &vcpu->kvm->arch.sca->ipte_control; 230 ic = &vcpu->kvm->arch.sca->ipte_control;
231 do { 231 do {
232 old = *ic; 232 old = READ_ONCE(*ic);
233 barrier();
234 while (old.k) { 233 while (old.k) {
235 cond_resched(); 234 cond_resched();
236 old = *ic; 235 old = READ_ONCE(*ic);
237 barrier();
238 } 236 }
239 new = old; 237 new = old;
240 new.k = 1; 238 new.k = 1;
@@ -253,8 +251,7 @@ static void ipte_unlock_simple(struct kvm_vcpu *vcpu)
253 goto out; 251 goto out;
254 ic = &vcpu->kvm->arch.sca->ipte_control; 252 ic = &vcpu->kvm->arch.sca->ipte_control;
255 do { 253 do {
256 old = *ic; 254 old = READ_ONCE(*ic);
257 barrier();
258 new = old; 255 new = old;
259 new.k = 0; 256 new.k = 0;
260 } while (cmpxchg(&ic->val, old.val, new.val) != old.val); 257 } while (cmpxchg(&ic->val, old.val, new.val) != old.val);
@@ -269,12 +266,10 @@ static void ipte_lock_siif(struct kvm_vcpu *vcpu)
269 266
270 ic = &vcpu->kvm->arch.sca->ipte_control; 267 ic = &vcpu->kvm->arch.sca->ipte_control;
271 do { 268 do {
272 old = *ic; 269 old = READ_ONCE(*ic);
273 barrier();
274 while (old.kg) { 270 while (old.kg) {
275 cond_resched(); 271 cond_resched();
276 old = *ic; 272 old = READ_ONCE(*ic);
277 barrier();
278 } 273 }
279 new = old; 274 new = old;
280 new.k = 1; 275 new.k = 1;
@@ -288,8 +283,7 @@ static void ipte_unlock_siif(struct kvm_vcpu *vcpu)
288 283
289 ic = &vcpu->kvm->arch.sca->ipte_control; 284 ic = &vcpu->kvm->arch.sca->ipte_control;
290 do { 285 do {
291 old = *ic; 286 old = READ_ONCE(*ic);
292 barrier();
293 new = old; 287 new = old;
294 new.kh--; 288 new.kh--;
295 if (!new.kh) 289 if (!new.kh)