From: Chao Du <duchao@eswincomputing.com>
To: kvm@vger.kernel.org, kvm-riscv@lists.infradead.org,
anup@brainfault.org, atishp@atishpatra.org,
dbarboza@ventanamicro.com
Subject: [PATCH] RISC-V: KVM: remove a redundant condition in kvm_arch_vcpu_ioctl_run()
Date: Mon, 11 Dec 2023 09:40:14 +0000 [thread overview]
Message-ID: <20231211094014.4041-1-duchao@eswincomputing.com> (raw)
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>
---
arch/riscv/kvm/vcpu.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/riscv/kvm/vcpu.c b/arch/riscv/kvm/vcpu.c
index e087c809073c..bf3952d1a621 100644
--- a/arch/riscv/kvm/vcpu.c
+++ b/arch/riscv/kvm/vcpu.c
@@ -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;
--
2.17.1
next reply other threads:[~2023-12-11 9:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-11 9:40 Chao Du [this message]
2023-12-11 12:06 ` [PATCH] RISC-V: KVM: remove a redundant condition in kvm_arch_vcpu_ioctl_run() Daniel Henrique Barboza
2023-12-12 7:12 ` Chao Du
2023-12-13 12:22 ` Anup Patel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231211094014.4041-1-duchao@eswincomputing.com \
--to=duchao@eswincomputing.com \
--cc=anup@brainfault.org \
--cc=atishp@atishpatra.org \
--cc=dbarboza@ventanamicro.com \
--cc=kvm-riscv@lists.infradead.org \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox