• Mark Rutland's avatar
    arm64: Rework setup_cpu_features() · 075f48c9
    Mark Rutland authored
    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: default avatarMark Rutland <mark.rutland@arm.com>
    Reviewed-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
    Cc: Marc Zyngier <maz@kernel.org>
    Cc: Mark Brown <broonie@kernel.org>
    Cc: Will Deacon <will@kernel.org>
    Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
    075f48c9
smp.c 24.4 KB