diff mbox series

[2/3] arm64: cpufeature: Expose get_arm64_ftr_reg() outside cpufeature.c

Message ID 20220909165938.3931307-3-james.morse@arm.com (mailing list archive)
State New, archived
Headers show
Series arm64: errata: remove BF16 HWCAP due to incorrect result on Cortex-A510 | expand

Commit Message

James Morse Sept. 9, 2022, 4:59 p.m. UTC
get_arm64_ftr_reg() returns the properties of a system register based
on its instruction encoding.

This is needed by erratum workaround in cpu_errata.c to modify the
user-space visible view of id registers.

Signed-off-by: James Morse <james.morse@arm.com>
---
 arch/arm64/include/asm/cpufeature.h | 2 ++
 arch/arm64/kernel/cpufeature.c      | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

Comments

Suzuki K Poulose Sept. 12, 2022, 3:22 p.m. UTC | #1
On 09/09/2022 17:59, James Morse wrote:
> get_arm64_ftr_reg() returns the properties of a system register based
> on its instruction encoding.
> 
> This is needed by erratum workaround in cpu_errata.c to modify the
> user-space visible view of id registers.
> 
> Signed-off-by: James Morse <james.morse@arm.com>

Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
diff mbox series

Patch

diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h
index fd7d75a275f6..5c3317bc06c7 100644
--- a/arch/arm64/include/asm/cpufeature.h
+++ b/arch/arm64/include/asm/cpufeature.h
@@ -907,6 +907,8 @@  static inline unsigned int get_vmid_bits(u64 mmfr1)
 	return 8;
 }
 
+struct arm64_ftr_reg *get_arm64_ftr_reg(u32 sys_id);
+
 extern struct arm64_ftr_override id_aa64mmfr1_override;
 extern struct arm64_ftr_override id_aa64pfr0_override;
 extern struct arm64_ftr_override id_aa64pfr1_override;
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index b6a4e97805a4..24f43ad02cd3 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -750,7 +750,7 @@  static struct arm64_ftr_reg *get_arm64_ftr_reg_nowarn(u32 sys_id)
  * returns - Upon success,  matching ftr_reg entry for id.
  *         - NULL on failure but with an WARN_ON().
  */
-static struct arm64_ftr_reg *get_arm64_ftr_reg(u32 sys_id)
+struct arm64_ftr_reg *get_arm64_ftr_reg(u32 sys_id)
 {
 	struct arm64_ftr_reg *reg;