[PATCH 06/37] arm64: Rework setup_cpu_features()

Suzuki K Poulose suzuki.poulose at arm.com
Mon Sep 25 06:04:55 PDT 2023


On 19/09/2023 10:28, Mark Rutland wrote:
> Currently setup_cpu_features() handles a mixture of one-time kernel
> feature setup (e.g. cpucaps) and one-time user feature setup (e.g. ELF
> hwcaps). Subsequent patches will rework other one-time setup and expand
> the logic currently in setup_cpu_features(), and in preparation for this
> it would be helpful to split the kernel and user setup into separate
> functions.
> 
> This patch splits setup_user_features() out of setup_cpu_features(),
> with a few additional cleanups of note:
> 
> * setup_cpu_features() is renamed to setup_system_features() to make it
>    clear that it handles system-wide feature setup rather than cpu-local
>    feature setup.
> 
> * setup_system_capabilities() is folded into setup_system_features().
> 
> * Presence of TTBR0 pan is logged immediately after
>    update_cpu_capabilities(), so that this is guaranteed to appear
>    alongside all the other detected system cpucaps.
> 
> * The 'cwg' variable is removed as its value is only consumed once and
>    it's simpler to use cache_type_cwg() directly without assigning its
>    return value to a variable.
> 
> * The call to setup_user_features() is moved after alternatives are
>    patched, which will allow user feature setup code to depend on
>    alternative branches and allow for simplifications in subsequent
>    patches.
> 
> Signed-off-by: Mark Rutland <mark.rutland at arm.com>
> Cc: Catalin Marinas <catalin.marinas at arm.com>
> Cc: Marc Zyngier <maz at kernel.org>
> Cc: Mark Brown <broonie at kernel.org>
> Cc: Suzuki K Poulose <suzuki.poulose at arm.com>
> Cc: Will Deacon <will at kernel.org>
> ---

Reviewed-by: Suzuki K Poulose <suzuki.poulose at arm.com>





More information about the linux-arm-kernel mailing list