Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1320586

[PATCH 3/6] arm64: Add helpers for detecting AArch32 support at EL0

From Suzuki K Poulose <suzuki.poulose@arm.com>
Newsgroups linux.kernel
Subject [PATCH 3/6] arm64: Add helpers for detecting AArch32 support at EL0
Date 2016-01-28 12:40 +0100
Message-ID <qVT5E-2Js-7@gated-at.bofh.it> (permalink)
References <qVT5E-2Js-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Adds a helper to extract the support for AArch32 at EL0

Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 arch/arm64/include/asm/cpufeature.h |    7 +++++++
 arch/arm64/include/asm/sysreg.h     |    1 +
 2 files changed, 8 insertions(+)

diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h
index 5444a77..98f83d7 100644
--- a/arch/arm64/include/asm/cpufeature.h
+++ b/arch/arm64/include/asm/cpufeature.h
@@ -165,6 +165,13 @@ static inline bool id_aa64mmfr0_mixed_endian_el0(u64 mmfr0)
 		cpuid_feature_extract_unsigned_field(mmfr0, ID_AA64MMFR0_BIGENDEL0_SHIFT) == 0x1;
 }
 
+static inline bool id_aa64pfr0_32bit_el0(u64 pfr0)
+{
+	u32 val = cpuid_feature_extract_unsigned_field(pfr0, ID_AA64PFR0_EL0_SHIFT);
+
+	return val == ID_AA64PFR0_EL0_32BIT_64BIT;
+}
+
 void __init setup_cpu_features(void);
 
 void update_cpu_capabilities(const struct arm64_cpu_capabilities *caps,
diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h
index 4aeebec..76d2f3e 100644
--- a/arch/arm64/include/asm/sysreg.h
+++ b/arch/arm64/include/asm/sysreg.h
@@ -111,6 +111,7 @@
 #define ID_AA64PFR0_ASIMD_SUPPORTED	0x0
 #define ID_AA64PFR0_EL1_64BIT_ONLY	0x1
 #define ID_AA64PFR0_EL0_64BIT_ONLY	0x1
+#define ID_AA64PFR0_EL0_32BIT_64BIT	0x2
 
 /* id_aa64mmfr0 */
 #define ID_AA64MMFR0_TGRAN4_SHIFT	28
-- 
1.7.9.5

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] Support for systems without AArch32 state Suzuki K Poulose <suzuki.poulose@arm.com> - 2016-01-28 12:40 +0100
  [PATCH 3/6] arm64: Add helpers for detecting AArch32 support at EL0 Suzuki K Poulose <suzuki.poulose@arm.com> - 2016-01-28 12:40 +0100
  [PATCH 2/6] arm64: HWCAP: Split COMPAT HWCAP table entries Suzuki K Poulose <suzuki.poulose@arm.com> - 2016-01-28 12:40 +0100
  [PATCH 1/6] arm64: hwcaps: Cleanup naming Suzuki K Poulose <suzuki.poulose@arm.com> - 2016-01-28 12:40 +0100
  [PATCH 4/6] arm64: cpufeature: Check availability of AArch32 Suzuki K Poulose <suzuki.poulose@arm.com> - 2016-01-28 12:40 +0100
  [PATCH 5/6] arm64: cpufeature: Track 32bit EL0 support Suzuki K Poulose <suzuki.poulose@arm.com> - 2016-01-28 12:40 +0100
  [PATCH 6/6] arm64: compat: Check for AArch32 state Suzuki K Poulose <suzuki.poulose@arm.com> - 2016-01-28 12:40 +0100

csiph-web