Commit ea55d5a2 authored by Oliver Upton's avatar Oliver Upton Committed by Marc Zyngier
Browse files

KVM: arm64: Delete pointless switch statement in kvm_reset_vcpu()



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: default avatarZenghui Yu <yuzenghui@huawei.com>
Signed-off-by: default avatarOliver Upton <oliver.upton@linux.dev>
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230710193140.1706399-2-oliver.upton@linux.dev
parent 06c2afb8
Loading
Loading
Loading
Loading
+10 −15
Original line number Diff line number Diff line
@@ -248,22 +248,17 @@ int kvm_reset_vcpu(struct kvm_vcpu *vcpu)
		}
	}

	switch (vcpu->arch.target) {
	default:
		if (vcpu_el1_is_32bit(vcpu)) {
	if (vcpu_el1_is_32bit(vcpu))
		pstate = VCPU_RESET_PSTATE_SVC;
		} else if (vcpu_has_nv(vcpu)) {
	else if (vcpu_has_nv(vcpu))
		pstate = VCPU_RESET_PSTATE_EL2;
		} else {
	else
		pstate = VCPU_RESET_PSTATE_EL1;
		}

	if (kvm_vcpu_has_pmu(vcpu) && !kvm_arm_support_pmu_v3()) {
		ret = -EINVAL;
		goto out;
	}
		break;
	}

	/* Reset core registers */
	memset(vcpu_gp_regs(vcpu), 0, sizeof(*vcpu_gp_regs(vcpu)));