Skip to content

Commit af93443

Browse files
committed
RISC-V: KVM: Exit run-loop immediately if xfer_to_guest fails
If xfer_to_guest_mode_handle_work() fails in the run-loop then exit the run-loop immediately instead of doing it after some more work. Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Signed-off-by: Anup Patel <[email protected]>
1 parent b3f2575 commit af93443

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arch/riscv/kvm/vcpu.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -984,8 +984,9 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
984984
while (ret > 0) {
985985
/* Check conditions before entering the guest */
986986
ret = xfer_to_guest_mode_handle_work(vcpu);
987-
if (!ret)
988-
ret = 1;
987+
if (ret)
988+
continue;
989+
ret = 1;
989990

990991
kvm_riscv_gstage_vmid_update(vcpu);
991992

0 commit comments

Comments
 (0)