From: Oliver Upton <oliver.upton@linux.dev>
To: kvmarm@lists.linux.dev
Cc: Marc Zyngier <maz@kernel.org>, James Morse <james.morse@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>,
Oliver Upton <oliver.upton@linux.dev>
Subject: [PATCH v2 1/4] KVM: arm64: Delete pointless switch statement in kvm_reset_vcpu()
Date: Mon, 10 Jul 2023 19:31:37 +0000 [thread overview]
Message-ID: <20230710193140.1706399-2-oliver.upton@linux.dev> (raw)
In-Reply-To: <20230710193140.1706399-1-oliver.upton@linux.dev>
The vCPU target hasn't mattered for quite a long time now. Delete the
useless switch statement in kvm_reset_vcpu(), which hilariously only had
a default case in it.
Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
---
arch/arm64/kvm/reset.c | 25 ++++++++++---------------
1 file changed, 10 insertions(+), 15 deletions(-)
diff --git a/arch/arm64/kvm/reset.c b/arch/arm64/kvm/reset.c
index bc8556b6f459..7a65a35ee4ac 100644
--- a/arch/arm64/kvm/reset.c
+++ b/arch/arm64/kvm/reset.c
@@ -248,21 +248,16 @@ int kvm_reset_vcpu(struct kvm_vcpu *vcpu)
}
}
- switch (vcpu->arch.target) {
- default:
- if (vcpu_el1_is_32bit(vcpu)) {
- pstate = VCPU_RESET_PSTATE_SVC;
- } else if (vcpu_has_nv(vcpu)) {
- pstate = VCPU_RESET_PSTATE_EL2;
- } else {
- pstate = VCPU_RESET_PSTATE_EL1;
- }
-
- if (kvm_vcpu_has_pmu(vcpu) && !kvm_arm_support_pmu_v3()) {
- ret = -EINVAL;
- goto out;
- }
- break;
+ if (vcpu_el1_is_32bit(vcpu))
+ pstate = VCPU_RESET_PSTATE_SVC;
+ else if (vcpu_has_nv(vcpu))
+ pstate = VCPU_RESET_PSTATE_EL2;
+ else
+ pstate = VCPU_RESET_PSTATE_EL1;
+
+ if (kvm_vcpu_has_pmu(vcpu) && !kvm_arm_support_pmu_v3()) {
+ ret = -EINVAL;
+ goto out;
}
/* Reset core registers */
--
2.41.0.255.g8b1d071c50-goog
next prev parent reply other threads:[~2023-07-10 19:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-10 19:31 [PATCH v2 0/4] KVM: arm64: Use 'generic' vCPU target across all uarches Oliver Upton
2023-07-10 19:31 ` Oliver Upton [this message]
2023-07-11 13:00 ` [PATCH v2 1/4] KVM: arm64: Delete pointless switch statement in kvm_reset_vcpu() Shaoqin Huang
2023-07-10 19:31 ` [PATCH v2 2/4] KVM: arm64: Remove pointless check for changed init target Oliver Upton
2023-07-11 4:55 ` Zenghui Yu
2023-07-11 13:37 ` Shaoqin Huang
2023-07-10 19:31 ` [PATCH v2 3/4] KVM: arm64: Replace vCPU target with a configuration flag Oliver Upton
2023-07-11 13:30 ` Shaoqin Huang
2023-07-10 19:31 ` [PATCH v2 4/4] KVM: arm64: Always return generic v8 as the preferred target Oliver Upton
2023-07-11 13:22 ` Shaoqin Huang
2023-07-11 7:27 ` [PATCH v2 0/4] KVM: arm64: Use 'generic' vCPU target across all uarches Marc Zyngier
2023-07-11 7:29 ` Oliver Upton
2023-07-28 8:47 ` Marc Zyngier
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=20230710193140.1706399-2-oliver.upton@linux.dev \
--to=oliver.upton@linux.dev \
--cc=james.morse@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=maz@kernel.org \
--cc=suzuki.poulose@arm.com \
--cc=yuzenghui@huawei.com \
/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