]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
arm64: cpufeature: Add HAFT to cpucap_is_possible()
authorMark Rutland <mark.rutland@arm.com>
Mon, 9 Dec 2024 15:59:48 +0000 (15:59 +0000)
committerWill Deacon <will@kernel.org>
Tue, 10 Dec 2024 12:10:09 +0000 (12:10 +0000)
For consistency with other cpucaps, handle the configuration check for
ARM64_HAFT in cpucap_is_possible() rather than this being explicit in
system_supports_haft(). The configuration check will now happen
implicitly as cpus_have_final_cap() uses cpucap_is_possible() via
alternative_has_cap_unlikely().

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20241209155948.2124393-1-mark.rutland@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/cpucaps.h
arch/arm64/include/asm/cpufeature.h

index cbbf70e0f204856683da207f38e9472afe6c26bc..0b5ca6e0eb0932f90eeb8db1971849102dcdafd7 100644 (file)
@@ -46,6 +46,8 @@ cpucap_is_possible(const unsigned int cap)
                return IS_ENABLED(CONFIG_ARM64_POE);
        case ARM64_HAS_GCS:
                return IS_ENABLED(CONFIG_ARM64_GCS);
+       case ARM64_HAFT:
+               return IS_ENABLED(CONFIG_ARM64_HAFT);
        case ARM64_UNMAP_KERNEL_AT_EL0:
                return IS_ENABLED(CONFIG_UNMAP_KERNEL_AT_EL0);
        case ARM64_WORKAROUND_843419:
index 8b4e5a3cd24c801e13a1339b7b748c513b12c6f4..a4d0b77a68d9565bdfe116c99c801b10122d3ed1 100644 (file)
@@ -852,8 +852,7 @@ static inline bool system_supports_gcs(void)
 
 static inline bool system_supports_haft(void)
 {
-       return IS_ENABLED(CONFIG_ARM64_HAFT) &&
-               cpus_have_final_cap(ARM64_HAFT);
+       return cpus_have_final_cap(ARM64_HAFT);
 }
 
 static __always_inline bool system_supports_mpam(void)