Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/borntraeger...
[cascardo/linux.git] / arch / s390 / kvm / gaccess.c
index 8b9ccf0..8a1be90 100644 (file)
@@ -227,12 +227,10 @@ static void ipte_lock_simple(struct kvm_vcpu *vcpu)
                goto out;
        ic = &vcpu->kvm->arch.sca->ipte_control;
        do {
-               old = *ic;
-               barrier();
+               old = READ_ONCE(*ic);
                while (old.k) {
                        cond_resched();
-                       old = *ic;
-                       barrier();
+                       old = READ_ONCE(*ic);
                }
                new = old;
                new.k = 1;
@@ -251,8 +249,7 @@ static void ipte_unlock_simple(struct kvm_vcpu *vcpu)
                goto out;
        ic = &vcpu->kvm->arch.sca->ipte_control;
        do {
-               old = *ic;
-               barrier();
+               old = READ_ONCE(*ic);
                new = old;
                new.k = 0;
        } while (cmpxchg(&ic->val, old.val, new.val) != old.val);
@@ -267,12 +264,10 @@ static void ipte_lock_siif(struct kvm_vcpu *vcpu)
 
        ic = &vcpu->kvm->arch.sca->ipte_control;
        do {
-               old = *ic;
-               barrier();
+               old = READ_ONCE(*ic);
                while (old.kg) {
                        cond_resched();
-                       old = *ic;
-                       barrier();
+                       old = READ_ONCE(*ic);
                }
                new = old;
                new.k = 1;
@@ -286,8 +281,7 @@ static void ipte_unlock_siif(struct kvm_vcpu *vcpu)
 
        ic = &vcpu->kvm->arch.sca->ipte_control;
        do {
-               old = *ic;
-               barrier();
+               old = READ_ONCE(*ic);
                new = old;
                new.kh--;
                if (!new.kh)