Skip to content

Commit bf394b5

Browse files
committed
KVM: s390: Remove unneeded srcu lock
JIRA: https://issues.redhat.com/browse/RHEL-113440 commit 7e42ad6 Author: Claudio Imbrenda <imbrenda@linux.ibm.com> Date: Wed May 28 11:55:00 2025 +0200 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 <nsg@linux.ibm.com> Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com> Reviewed-by: Christoph Schlameuss <schlameuss@linux.ibm.com> Reviewed-by: Steffen Eiden <seiden@linux.ibm.com> Link: https://lore.kernel.org/r/20250528095502.226213-3-imbrenda@linux.ibm.com Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Message-ID: <20250528095502.226213-3-imbrenda@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
1 parent 757f1be commit bf394b5

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)