• Mark Rutland's avatar
    arm64: Explicitly save/restore CPACR when probing SVE and SME · bc9bbb78
    Mark Rutland authored
    When a CPUs onlined we first probe for supported features and
    propetites, and then we subsequently enable features that have been
    detected. This is a little problematic for SVE and SME, as some
    properties (e.g. vector lengths) cannot be probed while they are
    disabled. Due to this, the code probing for SVE properties has to enable
    SVE for EL1 prior to proving, and the code probing for SME properties
    has to enable SME for EL1 prior to probing. We never disable SVE or SME
    for EL1 after probing.
    
    It would be a little nicer to transiently enable SVE and SME during
    probing, leaving them both disabled unless explicitly enabled, as this
    would make it much easier to catch unintentional usage (e.g. when they
    are not present system-wide).
    
    This patch reworks the SVE and SME feature probing code to only
    transiently enable support at EL1, disabling after probing is complete.
    Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
    Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
    Cc: Will Deacon <will@kernel.org>
    Reviewed-by: default avatarMark Brown <broonie@kernel.org>
    Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
    bc9bbb78
fpsimd.c 57.1 KB