arm64: capabilities: Move errata work around check on boot CPU
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Wed, 6 Apr 2022 16:45:08 +0000 (17:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Apr 2022 05:52:14 +0000 (07:52 +0200)
[ Upstream commit 5e91107b06811f0ca147cebbedce53626c9c4443 ]

We trigger CPU errata work around check on the boot CPU from
smp_prepare_boot_cpu() to make sure that we run the checks only
after the CPU feature infrastructure is initialised. While this
is correct, we can also do this from init_cpu_features() which
initilises the infrastructure, and is called only on the
Boot CPU. This helps to consolidate the CPU capability handling
to cpufeature.c. No functional changes.

Cc: Will Deacon <will.deacon@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Dave Martin <dave.martin@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/smp.c

index 8e037a519e02db1918a5e95089ec464ffbe8b044..65779a1644d1d02a3c62681b77ab2b7000b103d9 100644 (file)
@@ -476,6 +476,11 @@ void __init init_cpu_features(struct cpuinfo_arm64 *info)
                init_cpu_ftr_reg(SYS_MVFR2_EL1, info->reg_mvfr2);
        }
 
+       /*
+        * Run the errata work around checks on the boot CPU, once we have
+        * initialised the cpu feature infrastructure.
+        */
+       update_cpu_errata_workarounds();
 }
 
 static void update_cpu_ftr_reg(struct arm64_ftr_reg *reg, u64 new)
index 13b9c20a84b5c1244d1fa2607ea9fbe0fad70f05..ea4aedb6bbdcacea3f7047785ab81d5daa044ee0 100644 (file)
@@ -444,12 +444,6 @@ void __init smp_prepare_boot_cpu(void)
        jump_label_init();
        cpuinfo_store_boot_cpu();
        save_boot_cpu_run_el();
-       /*
-        * Run the errata work around checks on the boot CPU, once we have
-        * initialised the cpu feature infrastructure from
-        * cpuinfo_store_boot_cpu() above.
-        */
-       update_cpu_errata_workarounds();
 }
 
 static u64 __init of_get_cpu_mpidr(struct device_node *dn)