diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2009-05-12 11:21:50 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-06-10 04:48:56 -0400 |
commit | b037a4f34ec51b6c8ccb352a04056c04a4bfc269 (patch) | |
tree | 9ae7a04c170ecfca9ac2973c69383454c0aa8e60 /arch/s390/kvm/sigp.c | |
parent | ca8723023f25c9a70d76cbd6101f8fb4ffec2fa0 (diff) |
KVM: s390: optimize float int lock: spin_lock_bh --> spin_lock
The floating interrupt lock is only taken in process context. We can
replace all spin_lock_bh with standard spin_lock calls.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Christian Ehrhardt <ehrhardt@de.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/s390/kvm/sigp.c')
-rw-r--r-- | arch/s390/kvm/sigp.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c index f27dbedf0866..36678835034d 100644 --- a/arch/s390/kvm/sigp.c +++ b/arch/s390/kvm/sigp.c | |||
@@ -52,7 +52,7 @@ static int __sigp_sense(struct kvm_vcpu *vcpu, u16 cpu_addr, | |||
52 | if (cpu_addr >= KVM_MAX_VCPUS) | 52 | if (cpu_addr >= KVM_MAX_VCPUS) |
53 | return 3; /* not operational */ | 53 | return 3; /* not operational */ |
54 | 54 | ||
55 | spin_lock_bh(&fi->lock); | 55 | spin_lock(&fi->lock); |
56 | if (fi->local_int[cpu_addr] == NULL) | 56 | if (fi->local_int[cpu_addr] == NULL) |
57 | rc = 3; /* not operational */ | 57 | rc = 3; /* not operational */ |
58 | else if (atomic_read(fi->local_int[cpu_addr]->cpuflags) | 58 | else if (atomic_read(fi->local_int[cpu_addr]->cpuflags) |
@@ -64,7 +64,7 @@ static int __sigp_sense(struct kvm_vcpu *vcpu, u16 cpu_addr, | |||
64 | *reg |= SIGP_STAT_STOPPED; | 64 | *reg |= SIGP_STAT_STOPPED; |
65 | rc = 1; /* status stored */ | 65 | rc = 1; /* status stored */ |
66 | } | 66 | } |
67 | spin_unlock_bh(&fi->lock); | 67 | spin_unlock(&fi->lock); |
68 | 68 | ||
69 | VCPU_EVENT(vcpu, 4, "sensed status of cpu %x rc %x", cpu_addr, rc); | 69 | VCPU_EVENT(vcpu, 4, "sensed status of cpu %x rc %x", cpu_addr, rc); |
70 | return rc; | 70 | return rc; |
@@ -86,7 +86,7 @@ static int __sigp_emergency(struct kvm_vcpu *vcpu, u16 cpu_addr) | |||
86 | 86 | ||
87 | inti->type = KVM_S390_INT_EMERGENCY; | 87 | inti->type = KVM_S390_INT_EMERGENCY; |
88 | 88 | ||
89 | spin_lock_bh(&fi->lock); | 89 | spin_lock(&fi->lock); |
90 | li = fi->local_int[cpu_addr]; | 90 | li = fi->local_int[cpu_addr]; |
91 | if (li == NULL) { | 91 | if (li == NULL) { |
92 | rc = 3; /* not operational */ | 92 | rc = 3; /* not operational */ |
@@ -102,7 +102,7 @@ static int __sigp_emergency(struct kvm_vcpu *vcpu, u16 cpu_addr) | |||
102 | spin_unlock_bh(&li->lock); | 102 | spin_unlock_bh(&li->lock); |
103 | rc = 0; /* order accepted */ | 103 | rc = 0; /* order accepted */ |
104 | unlock: | 104 | unlock: |
105 | spin_unlock_bh(&fi->lock); | 105 | spin_unlock(&fi->lock); |
106 | VCPU_EVENT(vcpu, 4, "sent sigp emerg to cpu %x", cpu_addr); | 106 | VCPU_EVENT(vcpu, 4, "sent sigp emerg to cpu %x", cpu_addr); |
107 | return rc; | 107 | return rc; |
108 | } | 108 | } |
@@ -123,7 +123,7 @@ static int __sigp_stop(struct kvm_vcpu *vcpu, u16 cpu_addr, int store) | |||
123 | 123 | ||
124 | inti->type = KVM_S390_SIGP_STOP; | 124 | inti->type = KVM_S390_SIGP_STOP; |
125 | 125 | ||
126 | spin_lock_bh(&fi->lock); | 126 | spin_lock(&fi->lock); |
127 | li = fi->local_int[cpu_addr]; | 127 | li = fi->local_int[cpu_addr]; |
128 | if (li == NULL) { | 128 | if (li == NULL) { |
129 | rc = 3; /* not operational */ | 129 | rc = 3; /* not operational */ |
@@ -142,7 +142,7 @@ static int __sigp_stop(struct kvm_vcpu *vcpu, u16 cpu_addr, int store) | |||
142 | spin_unlock_bh(&li->lock); | 142 | spin_unlock_bh(&li->lock); |
143 | rc = 0; /* order accepted */ | 143 | rc = 0; /* order accepted */ |
144 | unlock: | 144 | unlock: |
145 | spin_unlock_bh(&fi->lock); | 145 | spin_unlock(&fi->lock); |
146 | VCPU_EVENT(vcpu, 4, "sent sigp stop to cpu %x", cpu_addr); | 146 | VCPU_EVENT(vcpu, 4, "sent sigp stop to cpu %x", cpu_addr); |
147 | return rc; | 147 | return rc; |
148 | } | 148 | } |
@@ -188,7 +188,7 @@ static int __sigp_set_prefix(struct kvm_vcpu *vcpu, u16 cpu_addr, u32 address, | |||
188 | if (!inti) | 188 | if (!inti) |
189 | return 2; /* busy */ | 189 | return 2; /* busy */ |
190 | 190 | ||
191 | spin_lock_bh(&fi->lock); | 191 | spin_lock(&fi->lock); |
192 | li = fi->local_int[cpu_addr]; | 192 | li = fi->local_int[cpu_addr]; |
193 | 193 | ||
194 | if ((cpu_addr >= KVM_MAX_VCPUS) || (li == NULL)) { | 194 | if ((cpu_addr >= KVM_MAX_VCPUS) || (li == NULL)) { |
@@ -220,7 +220,7 @@ static int __sigp_set_prefix(struct kvm_vcpu *vcpu, u16 cpu_addr, u32 address, | |||
220 | out_li: | 220 | out_li: |
221 | spin_unlock_bh(&li->lock); | 221 | spin_unlock_bh(&li->lock); |
222 | out_fi: | 222 | out_fi: |
223 | spin_unlock_bh(&fi->lock); | 223 | spin_unlock(&fi->lock); |
224 | return rc; | 224 | return rc; |
225 | } | 225 | } |
226 | 226 | ||