Skip to content

Commit fcd6535

Browse files
Anshuman Khandualwilldeacon
authored andcommitted
arm64/cpufeature: Add remaining feature bits in ID_MMFR4 register
Enable all remaining feature bits like EVT, CCIDX, LSM, HPDS, CnP, XNX, SpecSEI in ID_MMFR4 register per ARM DDI 0487F.a. Cc: Catalin Marinas <[email protected]> Cc: Will Deacon <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Suzuki K Poulose <[email protected]> Cc: [email protected] Cc: [email protected] Suggested-by: Mark Rutland <[email protected]> Signed-off-by: Anshuman Khandual <[email protected]> Reviewed-by: Suzuki K Poulose <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 0ae43a9 commit fcd6535

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

arch/arm64/include/asm/sysreg.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,14 @@
794794
#define ID_ISAR6_DP_SHIFT 4
795795
#define ID_ISAR6_JSCVT_SHIFT 0
796796

797+
#define ID_MMFR4_EVT_SHIFT 28
798+
#define ID_MMFR4_CCIDX_SHIFT 24
799+
#define ID_MMFR4_LSM_SHIFT 20
800+
#define ID_MMFR4_HPDS_SHIFT 16
801+
#define ID_MMFR4_CNP_SHIFT 12
802+
#define ID_MMFR4_XNX_SHIFT 8
803+
#define ID_MMFR4_SPECSEI_SHIFT 0
804+
797805
#define ID_MMFR5_ETS_SHIFT 0
798806

799807
#define ID_PFR0_DIT_SHIFT 24

arch/arm64/kernel/cpufeature.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,20 @@ static const struct arm64_ftr_bits ftr_id_isar5[] = {
392392
};
393393

394394
static const struct arm64_ftr_bits ftr_id_mmfr4[] = {
395+
ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_MMFR4_EVT_SHIFT, 4, 0),
396+
ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_MMFR4_CCIDX_SHIFT, 4, 0),
397+
ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_MMFR4_LSM_SHIFT, 4, 0),
398+
ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_MMFR4_HPDS_SHIFT, 4, 0),
399+
ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_MMFR4_CNP_SHIFT, 4, 0),
400+
ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_MMFR4_XNX_SHIFT, 4, 0),
395401
ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, 4, 4, 0), /* ac2 */
402+
/*
403+
* SpecSEI = 1 indicates that the PE might generate an SError on an
404+
* external abort on speculative read. It is safe to assume that an
405+
* SError might be generated than it will not be. Hence it has been
406+
* classified as FTR_HIGHER_SAFE.
407+
*/
408+
ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_HIGHER_SAFE, ID_MMFR4_SPECSEI_SHIFT, 4, 0),
396409
ARM64_FTR_END,
397410
};
398411

0 commit comments

Comments
 (0)