Skip to content

Commit 8049164

Browse files
Marc Zyngieroupton
authored andcommitted
arm64: Add capability denoting FEAT_RASv1p1
Detecting FEAT_RASv1p1 is rather complicated, as there are two ways for the architecture to advertise the same thing (always a delight...). Add a capability that will advertise this in a synthetic way to the rest of the kernel. Acked-by: Catalin Marinas <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Reviewed-by: Cornelia Huck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
1 parent e9abe31 commit 8049164

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

arch/arm64/kernel/cpufeature.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2235,6 +2235,24 @@ static void cpu_clear_disr(const struct arm64_cpu_capabilities *__unused)
22352235
/* Firmware may have left a deferred SError in this register. */
22362236
write_sysreg_s(0, SYS_DISR_EL1);
22372237
}
2238+
static bool has_rasv1p1(const struct arm64_cpu_capabilities *__unused, int scope)
2239+
{
2240+
const struct arm64_cpu_capabilities rasv1p1_caps[] = {
2241+
{
2242+
ARM64_CPUID_FIELDS(ID_AA64PFR0_EL1, RAS, V1P1)
2243+
},
2244+
{
2245+
ARM64_CPUID_FIELDS(ID_AA64PFR0_EL1, RAS, IMP)
2246+
},
2247+
{
2248+
ARM64_CPUID_FIELDS(ID_AA64PFR1_EL1, RAS_frac, RASv1p1)
2249+
},
2250+
};
2251+
2252+
return (has_cpuid_feature(&rasv1p1_caps[0], scope) ||
2253+
(has_cpuid_feature(&rasv1p1_caps[1], scope) &&
2254+
has_cpuid_feature(&rasv1p1_caps[2], scope)));
2255+
}
22382256
#endif /* CONFIG_ARM64_RAS_EXTN */
22392257

22402258
#ifdef CONFIG_ARM64_PTR_AUTH
@@ -2653,6 +2671,12 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
26532671
.cpu_enable = cpu_clear_disr,
26542672
ARM64_CPUID_FIELDS(ID_AA64PFR0_EL1, RAS, IMP)
26552673
},
2674+
{
2675+
.desc = "RASv1p1 Extension Support",
2676+
.capability = ARM64_HAS_RASV1P1_EXTN,
2677+
.type = ARM64_CPUCAP_SYSTEM_FEATURE,
2678+
.matches = has_rasv1p1,
2679+
},
26562680
#endif /* CONFIG_ARM64_RAS_EXTN */
26572681
#ifdef CONFIG_ARM64_AMU_EXTN
26582682
{

arch/arm64/tools/cpucaps

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ HAS_S1PIE
5252
HAS_S1POE
5353
HAS_SCTLR2
5454
HAS_RAS_EXTN
55+
HAS_RASV1P1_EXTN
5556
HAS_RNG
5657
HAS_SB
5758
HAS_STAGE2_FWB

0 commit comments

Comments
 (0)