diff options
| author | Heiko Carstens <hca@linux.ibm.com> | 2026-07-31 18:50:02 +0200 |
|---|---|---|
| committer | Vasily Gorbik <gor@linux.ibm.com> | 2026-08-05 15:16:54 +0200 |
| commit | 97d86fc8479eb47b95cc01ddec969c693da287fc (patch) | |
| tree | aa7e562a52a3cdf396069912acf6bd65a6b9ff80 | |
| parent | e11733826f9779eb954abdcd2b60b273558f1a77 (diff) | |
| download | linux-97d86fc8479eb47b95cc01ddec969c693da287fc.tar.gz linux-97d86fc8479eb47b95cc01ddec969c693da287fc.zip | |
KVM: s390: Remove cond_resched() calls
Since [1] cond_resched() is a no-op on s390. Remove all calls.
This also entirely removes uv_call_sched() and replaces all call sites
with uv_call(), since both functions are identical after the removal
of cond_resched().
[1] commit 7dadeaa6e851 ("sched: Further restrict the preemption modes")
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
| -rw-r--r-- | arch/s390/include/asm/uv.h | 16 | ||||
| -rw-r--r-- | arch/s390/kernel/uv.c | 2 | ||||
| -rw-r--r-- | arch/s390/kvm/gaccess.c | 8 | ||||
| -rw-r--r-- | arch/s390/kvm/gmap.c | 4 | ||||
| -rw-r--r-- | arch/s390/kvm/kvm-s390.c | 1 | ||||
| -rw-r--r-- | arch/s390/kvm/pv.c | 11 | ||||
| -rw-r--r-- | arch/s390/kvm/vsie.c | 1 | ||||
| -rw-r--r-- | arch/s390/mm/gmap_helpers.c | 1 | ||||
| -rw-r--r-- | drivers/s390/char/uvdevice.c | 6 |
9 files changed, 13 insertions, 37 deletions
diff --git a/arch/s390/include/asm/uv.h b/arch/s390/include/asm/uv.h index 153fed63adda..508075e9e8a9 100644 --- a/arch/s390/include/asm/uv.h +++ b/arch/s390/include/asm/uv.h @@ -454,18 +454,6 @@ static inline int uv_call(unsigned long r1, unsigned long r2) return cc; } -/* Low level uv_call that avoids stalls for long running busy conditions */ -static inline int uv_call_sched(unsigned long r1, unsigned long r2) -{ - int cc; - - do { - cc = __uv_call(r1, r2); - cond_resched(); - } while (cc > 1); - return cc; -} - /* * special variant of uv_call that only transports the cpu or guest * handle and the command, like destroy or verify. @@ -480,7 +468,7 @@ static inline int uv_cmd_nodata(u64 handle, u16 cmd, u16 *rc, u16 *rrc) int cc; WARN(!handle, "No handle provided to Ultravisor call cmd %x\n", cmd); - cc = uv_call_sched(0, (u64)&uvcb); + cc = uv_call(0, (u64)&uvcb); *rc = uvcb.header.rc; *rrc = uvcb.header.rrc; return cc ? -EINVAL : 0; @@ -518,7 +506,7 @@ static inline int uv_list_secrets(struct uv_secret_list *buf, u16 start_idx, .start_idx = start_idx, .list_addr = (u64)buf, }; - int cc = uv_call_sched(0, (u64)&uvcb); + int cc = uv_call(0, (u64)&uvcb); if (rc) *rc = uvcb.header.rc; diff --git a/arch/s390/kernel/uv.c b/arch/s390/kernel/uv.c index d1cdc5ae5e27..dc14ebc0105b 100644 --- a/arch/s390/kernel/uv.c +++ b/arch/s390/kernel/uv.c @@ -896,7 +896,7 @@ int uv_retrieve_secret(u16 secret_idx, u8 *buf, size_t buf_size) .buf_size = buf_size, }; - uv_call_sched(0, (u64)&uvcb); + uv_call(0, (u64)&uvcb); switch (uvcb.header.rc) { case UVC_RC_EXECUTED: diff --git a/arch/s390/kvm/gaccess.c b/arch/s390/kvm/gaccess.c index 36102b2727fb..0d389a302a70 100644 --- a/arch/s390/kvm/gaccess.c +++ b/arch/s390/kvm/gaccess.c @@ -151,10 +151,8 @@ retry: ic = &kvm->arch.sca->ipte_control; old = READ_ONCE(*ic); do { - if (old.k) { - cond_resched(); + if (old.k) goto retry; - } new = old; new.k = 1; } while (!try_cmpxchg(&ic->val, &old.val, new.val)); @@ -189,10 +187,8 @@ retry: ic = &kvm->arch.sca->ipte_control; old = READ_ONCE(*ic); do { - if (old.kg) { - cond_resched(); + if (old.kg) goto retry; - } new = old; new.k = 1; new.kh++; diff --git a/arch/s390/kvm/gmap.c b/arch/s390/kvm/gmap.c index 298fbaecec28..0ae0635a4f4c 100644 --- a/arch/s390/kvm/gmap.c +++ b/arch/s390/kvm/gmap.c @@ -941,7 +941,6 @@ void gmap_split_huge_pages(struct gmap *gmap) scoped_guard(read_lock, &gmap->kvm->mmu_lock) start = _dat_walk_gfn_range(start, asce_end(gmap->asce), gmap->asce, &ops, DAT_WALK_IGN_HOLES, gmap); - cond_resched(); } while (start); } @@ -963,7 +962,6 @@ static int _gmap_enable_skeys(struct gmap *gmap) do { scoped_guard(write_lock, &gmap->kvm->mmu_lock) start = dat_reset_skeys(gmap->asce, start); - cond_resched(); } while (start); return 0; } @@ -1019,7 +1017,6 @@ int gmap_pv_destroy_range(struct gmap *gmap, gfn_t start, gfn_t end, bool interr DAT_WALK_IGN_HOLES, NULL); if (interruptible && fatal_signal_pending(current)) return -EINTR; - cond_resched(); } while (start && start < end); return 0; } @@ -1138,7 +1135,6 @@ void _gmap_set_cmma_all(struct gmap *gmap, bool dirty) gfn = _dat_walk_gfn_range(gfn, asce_end(gmap->asce), gmap->asce, &ops, DAT_WALK_IGN_HOLES, &gmap->kvm->arch.cmma_dirty_pages); - cond_resched(); } while (gfn); } diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 23c817595e28..17ebb02acea2 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -1027,7 +1027,6 @@ static int kvm_s390_set_mem_control(struct kvm *kvm, struct kvm_device_attr *att do { scoped_guard(read_lock, &kvm->mmu_lock) start_gfn = dat_reset_cmma(kvm->arch.gmap->asce, start_gfn); - cond_resched(); } while (start_gfn); ret = 0; break; diff --git a/arch/s390/kvm/pv.c b/arch/s390/kvm/pv.c index dc5ac29b4c31..3992a9f9f118 100644 --- a/arch/s390/kvm/pv.c +++ b/arch/s390/kvm/pv.c @@ -429,7 +429,7 @@ static int kvm_s390_pv_deinit_vm_fast(struct kvm *kvm, u16 *rc, u16 *rrc) }; int cc; - cc = uv_call_sched(0, (u64)&uvcb); + cc = uv_call(0, (u64)&uvcb); if (rc) *rc = uvcb.header.rc; if (rrc) @@ -746,7 +746,7 @@ int kvm_s390_pv_init_vm(struct kvm *kvm, u16 *rc, u16 *rrc) } gmap_split_huge_pages(kvm->arch.gmap); - cc = uv_call_sched(0, (u64)&uvcb); + cc = uv_call(0, (u64)&uvcb); *rc = uvcb.header.rc; *rrc = uvcb.header.rrc; KVM_UV_EVENT(kvm, 3, "PROTVIRT CREATE VM: handle %llx len %llx rc %x rrc %x flags %04x", @@ -832,7 +832,6 @@ int kvm_s390_pv_unpack(struct kvm *kvm, unsigned long addr, unsigned long size, while (offset < size) { ret = unpack_one(kvm, addr, tweak, offset, rc, rrc); if (ret == -EAGAIN) { - cond_resched(); if (fatal_signal_pending(current)) break; continue; @@ -875,7 +874,7 @@ int kvm_s390_pv_dump_cpu(struct kvm_vcpu *vcpu, void *buff, u16 *rc, u16 *rrc) }; int cc; - cc = uv_call_sched(0, (u64)&uvcb); + cc = uv_call(0, (u64)&uvcb); *rc = uvcb.header.rc; *rrc = uvcb.header.rrc; return cc; @@ -959,7 +958,7 @@ int kvm_s390_pv_dump_stor_state(struct kvm *kvm, void __user *buff_user, /* We will loop until the user buffer is filled or an error occurs */ do { /* Get 1MB worth of guest storage state data */ - cc = uv_call_sched(0, (u64)&uvcb); + cc = uv_call(0, (u64)&uvcb); /* All or nothing */ if (cc) { @@ -1037,7 +1036,7 @@ int kvm_s390_pv_dump_complete(struct kvm *kvm, void __user *buff_user, return -ENOMEM; complete.dump_area_origin = (u64)compl_data; - ret = uv_call_sched(0, (u64)&complete); + ret = uv_call(0, (u64)&complete); *rc = complete.header.rc; *rrc = complete.header.rrc; KVM_UV_EVENT(kvm, 3, "PROTVIRT DUMP COMPLETE: rc %x rrc %x", diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c index eea24562e7db..6dcd3b110c17 100644 --- a/arch/s390/kvm/vsie.c +++ b/arch/s390/kvm/vsie.c @@ -1434,7 +1434,6 @@ static int vsie_run(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page) } if (sg) sg = gmap_put(sg); - cond_resched(); } if (sg) sg = gmap_put(sg); diff --git a/arch/s390/mm/gmap_helpers.c b/arch/s390/mm/gmap_helpers.c index 4bf7c9012feb..d564cdefb90f 100644 --- a/arch/s390/mm/gmap_helpers.c +++ b/arch/s390/mm/gmap_helpers.c @@ -272,7 +272,6 @@ retry: * truncation. In that case, the shared zeropage would be gone * and we can simply retry and make progress. */ - cond_resched(); goto retry; } diff --git a/drivers/s390/char/uvdevice.c b/drivers/s390/char/uvdevice.c index e6a264c996ce..4d274a2ee84d 100644 --- a/drivers/s390/char/uvdevice.c +++ b/drivers/s390/char/uvdevice.c @@ -224,7 +224,7 @@ static int uvio_attestation(struct uvio_ioctl_cb *uv_ioctl) if (ret) goto out; - uv_call_sched(0, (u64)uvcb_attest); + uv_call(0, (u64)uvcb_attest); uv_ioctl->uv_rc = uvcb_attest->header.rc; uv_ioctl->uv_rrc = uvcb_attest->header.rrc; @@ -291,7 +291,7 @@ static int uvio_add_secret(struct uvio_ioctl_cb *uv_ioctl) ret = 0; uvcb.addr = (u64)asrcb; - uv_call_sched(0, (u64)&uvcb); + uv_call(0, (u64)&uvcb); uv_ioctl->uv_rc = uvcb.header.rc; uv_ioctl->uv_rrc = uvcb.header.rrc; @@ -457,7 +457,7 @@ static int uvio_retr_secret(struct uvio_ioctl_cb *uv_ioctl) uvcb.buf_addr = (u64)buf; uvcb.buf_size = buf_len; - uv_call_sched(0, (u64)&uvcb); + uv_call(0, (u64)&uvcb); if (copy_to_user((__user void *)uv_ioctl->argument_addr, buf, buf_len)) goto err; |
