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


Groups > linux.kernel > #1691986

[PATCH 05/11] arm64/cpufeature: detect pointer authentication

From Mark Rutland <mark.rutland@arm.com>
Newsgroups linux.kernel
Subject [PATCH 05/11] arm64/cpufeature: detect pointer authentication
Date 2017-07-19 18:10 +0200
Message-ID <u4ZI2-2x4-87@gated-at.bofh.it> (permalink)
References <u4ZHZ-2x4-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


So that we can dynamically handle the presence of pointer authentication
functionality, wire up probing code in cpufeature.c.

Currently, this only detects the presence of an architected algorithm.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
---
 arch/arm64/include/asm/cpucaps.h |  4 +++-
 arch/arm64/kernel/cpufeature.c   | 22 ++++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/cpucaps.h b/arch/arm64/include/asm/cpucaps.h
index 8d2272c..903b458 100644
--- a/arch/arm64/include/asm/cpucaps.h
+++ b/arch/arm64/include/asm/cpucaps.h
@@ -39,7 +39,9 @@
 #define ARM64_WORKAROUND_QCOM_FALKOR_E1003	18
 #define ARM64_WORKAROUND_858921			19
 #define ARM64_WORKAROUND_CAVIUM_30115		20
+#define ARM64_HAS_ADDRESS_AUTH			21
+#define ARM64_HAS_GENERIC_AUTH			22
 
-#define ARM64_NCAPS				21
+#define ARM64_NCAPS				23
 
 #endif /* __ASM_CPUCAPS_H */
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index b23ad83..4016b1e7 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -892,6 +892,28 @@ static bool has_no_fpsimd(const struct arm64_cpu_capabilities *entry, int __unus
 		.min_field_value = 0,
 		.matches = has_no_fpsimd,
 	},
+#ifdef CONFIG_ARM64_POINTER_AUTHENTICATION
+	{
+		.desc = "Address authentication (architected algorithm)",
+		.capability = ARM64_HAS_ADDRESS_AUTH,
+		.def_scope = SCOPE_SYSTEM,
+		.sys_reg = SYS_ID_AA64ISAR1_EL1,
+		.sign = FTR_UNSIGNED,
+		.field_pos = ID_AA64ISAR1_APA_SHIFT,
+		.min_field_value = ID_AA64ISAR1_APA_ARCHITECTED,
+		.matches = has_cpuid_feature,
+	},
+	{
+		.desc = "Generic authentication (architected algorithm)",
+		.capability = ARM64_HAS_GENERIC_AUTH,
+		.def_scope = SCOPE_SYSTEM,
+		.sys_reg = SYS_ID_AA64ISAR1_EL1,
+		.sign = FTR_UNSIGNED,
+		.field_pos = ID_AA64ISAR1_GPA_SHIFT,
+		.min_field_value = ID_AA64ISAR1_GPA_ARCHITECTED,
+		.matches = has_cpuid_feature
+	},
+#endif /* CONFIG_ARM64_POINTER_AUTHENTICATION */
 	{},
 };
 
-- 
1.9.1

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


Thread

[PATCH 00/11] ARMv8.3 pointer authentication userspace support Mark Rutland <mark.rutland@arm.com> - 2017-07-19 18:10 +0200
  [PATCH 09/11] arm64/kvm: preserve host HCR_EL2 value Mark Rutland <mark.rutland@arm.com> - 2017-07-19 18:10 +0200
  [PATCH 06/11] arm64: Don't trap host pointer auth use to EL2 Mark Rutland <mark.rutland@arm.com> - 2017-07-19 18:10 +0200
    Re: [PATCH 06/11] arm64: Don't trap host pointer auth use to EL2 Dave Martin <Dave.Martin@arm.com> - 2017-07-24 12:40 +0200
  [PATCH 05/11] arm64/cpufeature: detect pointer authentication Mark Rutland <mark.rutland@arm.com> - 2017-07-19 18:10 +0200
  [PATCH 10/11] arm64/kvm: context-switch ptrauth registers Mark Rutland <mark.rutland@arm.com> - 2017-07-19 18:10 +0200
  [PATCH 07/11] arm64: add basic pointer authentication support Mark Rutland <mark.rutland@arm.com> - 2017-07-19 18:10 +0200
    Re: [PATCH 07/11] arm64: add basic pointer authentication support Dave Martin <Dave.Martin@arm.com> - 2017-07-25 17:30 +0200
  [PATCH 08/11] arm64: expose user PAC bit positions via ptrace Mark Rutland <mark.rutland@arm.com> - 2017-07-19 18:10 +0200
  Re: [PATCH 00/11] ARMv8.3 pointer authentication userspace support Dave Martin <Dave.Martin@arm.com> - 2017-07-21 19:10 +0200
    Re: [PATCH 00/11] ARMv8.3 pointer authentication userspace support Mark Rutland <mark.rutland@arm.com> - 2017-07-25 14:10 +0200
      Re: [PATCH 00/11] ARMv8.3 pointer authentication userspace support Jiong Wang <Jiong.Wang@arm.com> - 2017-07-25 16:10 +0200
  Re: [kernel-hardening] [PATCH 00/11] ARMv8.3 pointer authentication  userspace support Li Kun <hw.likun@huawei.com> - 2017-07-25 16:20 +0200
    Re: [kernel-hardening] [PATCH 00/11] ARMv8.3 pointer authentication  userspace support Mark Rutland <mark.rutland@arm.com> - 2017-07-25 17:20 +0200
  Re: [PATCH 00/11] ARMv8.3 pointer authentication userspace support Mark Rutland <mark.rutland@arm.com> - 2017-07-25 18:10 +0200

csiph-web