On 04/14/2020 10:31 PM, Will Deacon wrote:
update_cpu_features() is pretty large, so split out the checking of the
AArch32 features into a separate function and call it after checking the
AArch64 features.

Signed-off-by: Will Deacon <w...@kernel.org>
---
  arch/arm64/kernel/cpufeature.c | 108 +++++++++++++++++++--------------
  1 file changed, 61 insertions(+), 47 deletions(-)

diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index 7dfcdd9e75c1..32828a77acc3 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -715,6 +715,65 @@ static int check_update_ftr_reg(u32 sys_id, int cpu, u64 
val, u64 boot)
        return 1;
  }
+static int update_32bit_cpu_features(int cpu, struct cpuinfo_arm64 *info,
+                                    struct cpuinfo_arm64 *boot)
+{

...

-
        if (id_aa64pfr0_sve(info->reg_id_aa64pfr0)) {
                taint |= check_update_ftr_reg(SYS_ZCR_EL1, cpu,
                                        info->reg_zcr, boot->reg_zcr);
@@ -845,6 +857,8 @@ void update_cpu_features(int cpu,
                        sve_update_vq_map();
        }
+ taint |= update_32bit_cpu_features(cpu, info, boot);
+

This relies on the assumption that the id_aa64pfr0 has been sanitised. It may be worth adding a comment to make sure people (hacking the
kernel) don't move this around and break that dependency.

Either ways:

Reviewed-by: Suzuki K Poulose <suzuki.poul...@arm.com>
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

Reply via email to