Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Ben Horgan <ben.horgan@arm.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Acked-by: Oliver Upton <oupton@kernel.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

authored by

Ben Horgan and committed by
Catalin Marinas
4138cc63 bf09ee91

+1 -1
+1 -1
tools/testing/selftests/kvm/arm64/set_id_regs.c
··· 673 673 clidr = vcpu_get_reg(vcpu, KVM_ARM64_SYS_REG(SYS_CLIDR_EL1)); 674 674 675 675 /* find the first empty level in the cache hierarchy */ 676 - for (level = 1; level < 7; level++) { 676 + for (level = 1; level <= 7; level++) { 677 677 if (!CLIDR_CTYPE(clidr, level)) 678 678 break; 679 679 }