• Mark Brown's avatar
    arm64/sve: Use accessor functions for vector lengths in thread_struct · 0423eedc
    Mark Brown authored
    In a system with SME there are parallel vector length controls for SVE and
    SME vectors which function in much the same way so it is desirable to
    share the code for handling them as much as possible. In order to prepare
    for doing this add a layer of accessor functions for the various VL related
    operations on tasks.
    
    Since almost all current interactions are actually via task->thread rather
    than directly with the thread_info the accessors use that. Accessors are
    provided for both generic and SVE specific usage, the generic accessors
    should be used for cases where register state is being manipulated since
    the registers are shared between streaming and regular SVE so we know that
    when SME support is implemented we will always have to be in the appropriate
    mode already and hence can generalise now.
    
    Since we are using task_struct and we don't want to cause widespread
    inclusion of sched.h the acessors are all out of line, it is hoped that
    none of the uses are in a sufficiently critical path for this to be an
    issue. Those that are most likely to present an issue are in the same
    translation unit so hopefully the compiler may be able to inline anyway.
    
    This is purely adding the layer of abstraction, additional work will be
    needed to support tasks using SME.
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    Link: https://lore.kernel.org/r/20211019172247.3045838-7-broonie@kernel.orgSigned-off-by: default avatarWill Deacon <will@kernel.org>
    0423eedc
ptrace.c 46.6 KB