[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <89769f8d-2ed0-1eb7-0373-09fc25f8071a@arm.com>
Date: Fri, 25 May 2018 11:00:58 +0100
From: Suzuki K Poulose <Suzuki.Poulose@....com>
To: Julien Thierry <julien.thierry@....com>,
linux-arm-kernel@...ts.infradead.org
Cc: linux-kernel@...r.kernel.org, daniel.thompson@...aro.org,
joel@...lfernandes.org, marc.zyngier@....com, mark.rutland@....com,
christoffer.dall@....com, james.morse@....com,
catalin.marinas@....com, will.deacon@....com,
Christoffer Dall <christoffer.dall@...aro.org>
Subject: Re: [PATCH v4 04/26] arm64: alternative: Apply alternatives early in
boot process
On 25/05/18 10:49, Julien Thierry wrote:
> From: Daniel Thompson <daniel.thompson@...aro.org>
>
> Currently alternatives are applied very late in the boot process (and
> a long time after we enable scheduling). Some alternative sequences,
> such as those that alter the way CPU context is stored, must be applied
> much earlier in the boot sequence.
>
> Introduce apply_boot_alternatives() to allow some alternatives to be
> applied immediately after we detect the CPU features of the boot CPU.
>
> Signed-off-by: Daniel Thompson <daniel.thompson@...aro.org>
> [julien.thierry@....com: rename to fit new cpufeature framework better,
> apply BOOT_SCOPE feature early in boot]
> Signed-off-by: Julien Thierry <julien.thierry@....com>
> Cc: Catalin Marinas <catalin.marinas@....com>
> Cc: Will Deacon <will.deacon@....com>
> Cc: Christoffer Dall <christoffer.dall@...aro.org>
> Cc: Suzuki K Poulose <suzuki.poulose@....com>
> ---
> arch/arm64/include/asm/alternative.h | 3 +--
> arch/arm64/include/asm/cpufeature.h | 2 ++
> arch/arm64/kernel/alternative.c | 30 +++++++++++++++++++++++++++---
> arch/arm64/kernel/cpufeature.c | 5 +++++
> arch/arm64/kernel/smp.c | 7 +++++++
> 5 files changed, 42 insertions(+), 5 deletions(-)
>
...
>
> +unsigned long boot_capabilities;
> +
> /*
> * Flag to indicate if we have computed the system wide
> * capabilities based on the boot time active CPUs. This
> @@ -1370,6 +1372,9 @@ static void __update_cpu_capabilities(const struct arm64_cpu_capabilities *caps,
> if (!cpus_have_cap(caps->capability) && caps->desc)
> pr_info("%s %s\n", info, caps->desc);
> cpus_set_cap(caps->capability);
> +
> + if (scope_mask & SCOPE_BOOT_CPU)
> + __set_bit(caps->capability, &boot_capabilities);
Julien
I think this check is problematic. The scope_mask passed on by the boot CPU
is (SCOPE_BOOT_CPU | SCOPE_LOCAL_CPU) to cover both BOOT CPU capabilities *and*
CPU local capabilites on the boot CPU. So, you might apply the alternatives for
a "local" CPU erratum, which is not intended. You may change the above check to :
if (caps->type & SCOPE_BOOT_CPU)
to make sure you check the "capability" has the SCOPE_BOOT_CPU set.
Suzuki
Powered by blists - more mailing lists