Skip to content

Commit 042446a

Browse files
Suzuki K Poulosewildea01
authored andcommitted
arm64: cpufeature: Track 32bit EL0 support
Add cpu_hwcap bit for keeping track of the support for 32bit EL0. Tested-by: Yury Norov <ynorov@caviumnetworks.com> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
1 parent a6dc3cd commit 042446a

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

arch/arm64/include/asm/cpufeature.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@
3535
#define ARM64_ALT_PAN_NOT_UAO 10
3636
#define ARM64_HAS_VIRT_HOST_EXTN 11
3737
#define ARM64_WORKAROUND_CAVIUM_27456 12
38+
#define ARM64_HAS_32BIT_EL0 13
3839

39-
#define ARM64_NCAPS 13
40+
#define ARM64_NCAPS 14
4041

4142
#ifndef __ASSEMBLY__
4243

@@ -192,6 +193,11 @@ static inline bool cpu_supports_mixed_endian_el0(void)
192193
return id_aa64mmfr0_mixed_endian_el0(read_cpuid(ID_AA64MMFR0_EL1));
193194
}
194195

196+
static inline bool system_supports_32bit_el0(void)
197+
{
198+
return cpus_have_cap(ARM64_HAS_32BIT_EL0);
199+
}
200+
195201
static inline bool system_supports_mixed_endian_el0(void)
196202
{
197203
return id_aa64mmfr0_mixed_endian_el0(read_system_reg(SYS_ID_AA64MMFR0_EL1));

arch/arm64/kernel/cpufeature.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,15 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
737737
.capability = ARM64_HAS_VIRT_HOST_EXTN,
738738
.matches = runs_at_el2,
739739
},
740+
{
741+
.desc = "32-bit EL0 Support",
742+
.capability = ARM64_HAS_32BIT_EL0,
743+
.matches = has_cpuid_feature,
744+
.sys_reg = SYS_ID_AA64PFR0_EL1,
745+
.sign = FTR_UNSIGNED,
746+
.field_pos = ID_AA64PFR0_EL0_SHIFT,
747+
.min_field_value = ID_AA64PFR0_EL0_32BIT_64BIT,
748+
},
740749
{},
741750
};
742751

0 commit comments

Comments
 (0)