Skip to content

Commit 056600f

Browse files
Anshuman Khandualctmarinas
authored andcommitted
arm64/cpufeature: Replace custom macros with fields from ID_AA64PFR0_EL1
This replaces custom macros usage (i.e ID_AA64PFR0_EL1_ELx_64BIT_ONLY and ID_AA64PFR0_EL1_ELx_32BIT_64BIT) and instead directly uses register fields from ID_AA64PFR0_EL1 sysreg definition. Finally let's drop off both these custom macros as they are now redundant. Cc: Will Deacon <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Mark Brown <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Anshuman Khandual <[email protected]> Acked-by: Mark Rutland <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 42b9fed commit 056600f

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

arch/arm64/include/asm/cpufeature.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,14 +588,14 @@ static inline bool id_aa64pfr0_32bit_el1(u64 pfr0)
588588
{
589589
u32 val = cpuid_feature_extract_unsigned_field(pfr0, ID_AA64PFR0_EL1_EL1_SHIFT);
590590

591-
return val == ID_AA64PFR0_EL1_ELx_32BIT_64BIT;
591+
return val == ID_AA64PFR0_EL1_EL1_AARCH32;
592592
}
593593

594594
static inline bool id_aa64pfr0_32bit_el0(u64 pfr0)
595595
{
596596
u32 val = cpuid_feature_extract_unsigned_field(pfr0, ID_AA64PFR0_EL1_EL0_SHIFT);
597597

598-
return val == ID_AA64PFR0_EL1_ELx_32BIT_64BIT;
598+
return val == ID_AA64PFR0_EL1_EL0_AARCH32;
599599
}
600600

601601
static inline bool id_aa64pfr0_sve(u64 pfr0)

arch/arm64/include/asm/sysreg.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -872,10 +872,6 @@
872872
/* Position the attr at the correct index */
873873
#define MAIR_ATTRIDX(attr, idx) ((attr) << ((idx) * 8))
874874

875-
/* id_aa64pfr0 */
876-
#define ID_AA64PFR0_EL1_ELx_64BIT_ONLY 0x1
877-
#define ID_AA64PFR0_EL1_ELx_32BIT_64BIT 0x2
878-
879875
/* id_aa64mmfr0 */
880876
#define ID_AA64MMFR0_EL1_TGRAN4_SUPPORTED_MIN 0x0
881877
#define ID_AA64MMFR0_EL1_TGRAN4_LPA2 ID_AA64MMFR0_EL1_TGRAN4_52_BIT

arch/arm64/kernel/cpufeature.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,8 @@ static const struct arm64_ftr_bits ftr_id_aa64pfr0[] = {
285285
S_ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64PFR0_EL1_FP_SHIFT, 4, ID_AA64PFR0_EL1_FP_NI),
286286
ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64PFR0_EL1_EL3_SHIFT, 4, 0),
287287
ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64PFR0_EL1_EL2_SHIFT, 4, 0),
288-
ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64PFR0_EL1_EL1_SHIFT, 4, ID_AA64PFR0_EL1_ELx_64BIT_ONLY),
289-
ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64PFR0_EL1_EL0_SHIFT, 4, ID_AA64PFR0_EL1_ELx_64BIT_ONLY),
288+
ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64PFR0_EL1_EL1_SHIFT, 4, ID_AA64PFR0_EL1_EL1_IMP),
289+
ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64PFR0_EL1_EL0_SHIFT, 4, ID_AA64PFR0_EL1_EL0_IMP),
290290
ARM64_FTR_END,
291291
};
292292

0 commit comments

Comments
 (0)