Skip to content

Commit b620ba5

Browse files
Zhenyu Yectmarinas
authored andcommitted
arm64: tlb: Detect the ARMv8.4 TLBI RANGE feature
ARMv8.4-TLBI provides TLBI invalidation instruction that apply to a range of input addresses. This patch detect this feature. Signed-off-by: Zhenyu Ye <[email protected]> Link: https://lore.kernel.org/r/[email protected] [[email protected]: some renaming for consistency] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 61c1165 commit b620ba5

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

arch/arm64/include/asm/cpucaps.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@
6363
#define ARM64_HAS_32BIT_EL1 53
6464
#define ARM64_BTI 54
6565
#define ARM64_HAS_ARMv8_4_TTL 55
66+
#define ARM64_HAS_TLB_RANGE 56
6667

67-
#define ARM64_NCAPS 56
68+
#define ARM64_NCAPS 57
6869

6970
#endif /* __ASM_CPUCAPS_H */

arch/arm64/include/asm/sysreg.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,9 @@
617617
#define ID_AA64ISAR0_SHA1_SHIFT 8
618618
#define ID_AA64ISAR0_AES_SHIFT 4
619619

620+
#define ID_AA64ISAR0_TLB_RANGE_NI 0x0
621+
#define ID_AA64ISAR0_TLB_RANGE 0x2
622+
620623
/* id_aa64isar1 */
621624
#define ID_AA64ISAR1_I8MM_SHIFT 52
622625
#define ID_AA64ISAR1_DGH_SHIFT 48

arch/arm64/kernel/cpufeature.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1893,6 +1893,16 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
18931893
.min_field_value = 1,
18941894
.matches = has_cpuid_feature,
18951895
},
1896+
{
1897+
.desc = "TLB range maintenance instructions",
1898+
.capability = ARM64_HAS_TLB_RANGE,
1899+
.type = ARM64_CPUCAP_SYSTEM_FEATURE,
1900+
.matches = has_cpuid_feature,
1901+
.sys_reg = SYS_ID_AA64ISAR0_EL1,
1902+
.field_pos = ID_AA64ISAR0_TLB_SHIFT,
1903+
.sign = FTR_UNSIGNED,
1904+
.min_field_value = ID_AA64ISAR0_TLB_RANGE,
1905+
},
18961906
#ifdef CONFIG_ARM64_HW_AFDBM
18971907
{
18981908
/*

0 commit comments

Comments
 (0)