Commit 4138cc63 authored by Ben Horgan's avatar Ben Horgan Committed by Catalin Marinas
Browse files

KVM: arm64: selftests: Consider all 7 possible levels of cache



In test_clidr() if an empty cache level is not found then the TEST_ASSERT
will not fire. Fix this by considering all 7 possible levels when iterating
through the hierarchy. Found by inspection.

Signed-off-by: default avatarBen Horgan <ben.horgan@arm.com>
Acked-by: default avatarMarc Zyngier <maz@kernel.org>
Acked-by: default avatarOliver Upton <oupton@kernel.org>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent bf09ee91
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -673,7 +673,7 @@ static void test_clidr(struct kvm_vcpu *vcpu)
	clidr = vcpu_get_reg(vcpu, KVM_ARM64_SYS_REG(SYS_CLIDR_EL1));

	/* find the first empty level in the cache hierarchy */
	for (level = 1; level < 7; level++) {
	for (level = 1; level <= 7; level++) {
		if (!CLIDR_CTYPE(clidr, level))
			break;
	}