Skip to content

Commit 7e42ad6

Browse files
author
Claudio Imbrenda
committed
KVM: s390: Remove unneeded srcu lock
All paths leading to handle_essa() already hold the kvm->srcu. Remove unneeded srcu locking from handle_essa(). Add lockdep assertion to make sure we will always be holding kvm->srcu when entering handle_essa(). Reviewed-by: Nina Schoetterl-Glausch <[email protected]> Reviewed-by: Christian Borntraeger <[email protected]> Reviewed-by: Christoph Schlameuss <[email protected]> Reviewed-by: Steffen Eiden <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Claudio Imbrenda <[email protected]> Message-ID: <[email protected]>
1 parent af941f3 commit 7e42ad6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

arch/s390/kvm/priv.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,8 @@ static inline int __do_essa(struct kvm_vcpu *vcpu, const int orc)
12481248

12491249
static int handle_essa(struct kvm_vcpu *vcpu)
12501250
{
1251+
lockdep_assert_held(&vcpu->kvm->srcu);
1252+
12511253
/* entries expected to be 1FF */
12521254
int entries = (vcpu->arch.sie_block->cbrlo & ~PAGE_MASK) >> 3;
12531255
unsigned long *cbrlo;
@@ -1297,12 +1299,8 @@ static int handle_essa(struct kvm_vcpu *vcpu)
12971299
/* Retry the ESSA instruction */
12981300
kvm_s390_retry_instr(vcpu);
12991301
} else {
1300-
int srcu_idx;
1301-
13021302
mmap_read_lock(vcpu->kvm->mm);
1303-
srcu_idx = srcu_read_lock(&vcpu->kvm->srcu);
13041303
i = __do_essa(vcpu, orc);
1305-
srcu_read_unlock(&vcpu->kvm->srcu, srcu_idx);
13061304
mmap_read_unlock(vcpu->kvm->mm);
13071305
if (i < 0)
13081306
return i;

0 commit comments

Comments
 (0)