Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba4f4cb0 authored by Dave Martin's avatar Dave Martin Committed by Marc Zyngier
Browse files

KVM: arm64: Remove redundant *exit_code changes in fpsimd_guest_exit()



In fixup_guest_exit(), there are a couple of cases where after
checking what the exit code was, we assign it explicitly with the
value it already had.

Assuming this is not indicative of a bug, these assignments are not
needed.

This patch removes the redundant assignments, and simplifies some
if-nesting that becomes trivial as a result.

No functional change.

Signed-off-by: default avatarDave Martin <Dave.Martin@arm.com>
Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
Acked-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Acked-by: default avatarChristoffer Dall <christoffer.dall@arm.com>
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
parent 21cdd7fd
Loading
Loading
Loading
Loading
+4 −12
Original line number Original line Diff line number Diff line
@@ -403,12 +403,8 @@ static bool __hyp_text fixup_guest_exit(struct kvm_vcpu *vcpu, u64 *exit_code)
		if (valid) {
		if (valid) {
			int ret = __vgic_v2_perform_cpuif_access(vcpu);
			int ret = __vgic_v2_perform_cpuif_access(vcpu);


			if (ret == 1) {
			if (ret ==  1 && __skip_instr(vcpu))
				if (__skip_instr(vcpu))
				return true;
				return true;
				else
					*exit_code = ARM_EXCEPTION_TRAP;
			}


			if (ret == -1) {
			if (ret == -1) {
				/* Promote an illegal access to an
				/* Promote an illegal access to an
@@ -430,12 +426,8 @@ static bool __hyp_text fixup_guest_exit(struct kvm_vcpu *vcpu, u64 *exit_code)
	     kvm_vcpu_trap_get_class(vcpu) == ESR_ELx_EC_CP15_32)) {
	     kvm_vcpu_trap_get_class(vcpu) == ESR_ELx_EC_CP15_32)) {
		int ret = __vgic_v3_perform_cpuif_access(vcpu);
		int ret = __vgic_v3_perform_cpuif_access(vcpu);


		if (ret == 1) {
		if (ret == 1 && __skip_instr(vcpu))
			if (__skip_instr(vcpu))
			return true;
			return true;
			else
				*exit_code = ARM_EXCEPTION_TRAP;
		}
	}
	}


	/* Return to the host kernel and handle the exit */
	/* Return to the host kernel and handle the exit */