Skip to content

Commit 3673d01

Browse files
Marc Zyngieroupton
authored andcommitted
arm64: cpufeatures: Only check for NV1 if NV is present
We handle ID_AA64MMFR4_EL1.E2H0 being 0 as NV1 being present. However, this is only true if FEAT_NV is implemented. Add the required check to has_nv1(), avoiding spuriously advertising NV1 on HW that doesn't have NV at all. Fixes: da9af50 ("arm64: cpufeature: Detect HCR_EL2.NV1 being RES0") Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
1 parent 87b8cf2 commit 3673d01

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arch/arm64/kernel/cpufeature.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1812,8 +1812,9 @@ static bool has_nv1(const struct arm64_cpu_capabilities *entry, int scope)
18121812
{}
18131813
};
18141814

1815-
return !(has_cpuid_feature(entry, scope) ||
1816-
is_midr_in_range_list(read_cpuid_id(), nv1_ni_list));
1815+
return (this_cpu_has_cap(ARM64_HAS_NESTED_VIRT) &&
1816+
!(has_cpuid_feature(entry, scope) ||
1817+
is_midr_in_range_list(read_cpuid_id(), nv1_ni_list)));
18171818
}
18181819

18191820
#if defined(ID_AA64MMFR0_EL1_TGRAN_LPA2) && defined(ID_AA64MMFR0_EL1_TGRAN_2_SUPPORTED_LPA2)

0 commit comments

Comments
 (0)