RISC-V: KVM: remove a redundant condition in kvm_arch_vcpu_ioctl_run()
authorChao Du <duchao@eswincomputing.com>
Mon, 11 Dec 2023 09:40:14 +0000 (09:40 +0000)
committerAnup Patel <anup@brainfault.org>
Fri, 29 Dec 2023 07:01:36 +0000 (12:31 +0530)
The latest ret value is updated by kvm_riscv_vcpu_aia_update(),
the loop will continue if the ret is less than or equal to zero.
So the later condition will never hit. Thus remove it.

Signed-off-by: Chao Du <duchao@eswincomputing.com>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
arch/riscv/kvm/vcpu.c

index e087c809073c1bbb12956a1f5e4774d3c1db48ed..bf3952d1a621fd2c36f723554fff4094c9d8054d 100644 (file)
@@ -757,8 +757,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
                /* Update HVIP CSR for current CPU */
                kvm_riscv_update_hvip(vcpu);
 
-               if (ret <= 0 ||
-                   kvm_riscv_gstage_vmid_ver_changed(&vcpu->kvm->arch.vmid) ||
+               if (kvm_riscv_gstage_vmid_ver_changed(&vcpu->kvm->arch.vmid) ||
                    kvm_request_pending(vcpu) ||
                    xfer_to_guest_mode_work_pending()) {
                        vcpu->mode = OUTSIDE_GUEST_MODE;