• M
    arm64: move sve_user_{enable,disable} to <asm/fpsimd.h> · f9209e26
    Mark Rutland 提交于
    In subsequent patches, we'll want to make use of sve_user_enable() and
    sve_user_disable() outside of kernel/fpsimd.c. Let's move these to
    <asm/fpsimd.h> where we can make use of them.
    
    To avoid ifdeffery in sequences like:
    
    if (system_supports_sve() && some_condition)
    	sve_user_disable();
    
    ... empty stubs are provided when support for SVE is not enabled. Note
    that system_supports_sve() contains as IS_ENABLED(CONFIG_ARM64_SVE), so
    the sve_user_disable() call should be optimized away entirely when
    CONFIG_ARM64_SVE is not selected.
    
    To ensure that this is the case, the stub definitions contain a
    BUILD_BUG(), as we do for other stubs for which calls should always be
    optimized away when the relevant config option is not selected.
    
    At the same time, the include list of <asm/fpsimd.h> is sorted while
    adding <asm/sysreg.h>.
    Signed-off-by: NMark Rutland <mark.rutland@arm.com>
    Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
    Reviewed-by: NDave Martin <dave.martin@arm.com>
    Cc: Will Deacon <will.deacon@arm.com>
    Signed-off-by: NWill Deacon <will.deacon@arm.com>
    f9209e26
fpsimd.c 33.9 KB