Skip to content

Commit

Permalink
arm64: Read system wide CPUID value
Browse files Browse the repository at this point in the history
Add an API for reading the safe CPUID value across the
system from the new infrastructure.

Signed-off-by: Suzuki K. Poulose <suzuki.poulose@arm.com>
Tested-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
  • Loading branch information
Suzuki K. Poulose authored and Catalin Marinas committed Oct 21, 2015
1 parent 3086d39 commit b3f1537
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/arm64/include/asm/cpufeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ void check_local_cpu_features(void);
bool cpu_supports_mixed_endian_el0(void);
bool system_supports_mixed_endian_el0(void);

u64 read_system_reg(u32 id);

#endif /* __ASSEMBLY__ */

#endif
9 changes: 9 additions & 0 deletions arch/arm64/kernel/cpufeature.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,15 @@ void update_cpu_features(int cpu,
update_mixed_endian_el0_support(info);
}

u64 read_system_reg(u32 id)
{
struct arm64_ftr_reg *regp = get_arm64_ftr_reg(id);

/* We shouldn't get a request for an unsupported register */
BUG_ON(!regp);
return regp->sys_val;
}

static bool
feature_matches(u64 reg, const struct arm64_cpu_capabilities *entry)
{
Expand Down

0 comments on commit b3f1537

Please sign in to comment.