Skip to content
  • Suzuki Poulose's avatar
    BACKPORT: arm64: errata: Add workaround for TSB flush failures · 420405b4
    Suzuki Poulose authored and Qais Yousef's avatar Qais Yousef committed
    
    
    Arm Neoverse-N2 (#2067961) and Cortex-A710 (#2054223) suffers
    from errata, where a TSB (trace synchronization barrier)
    fails to flush the trace data completely, when executed from
    a trace prohibited region. In Linux we always execute it
    after we have moved the PE to trace prohibited region. So,
    we can apply the workaround every time a TSB is executed.
    
    The work around is to issue two TSB consecutively.
    
    NOTE: This errata is defined as LOCAL_CPU_ERRATUM, implying
    that a late CPU could be blocked from booting if it is the
    first CPU that requires the workaround. This is because we
    do not allow setting a cpu_hwcaps after the SMP boot. The
    other alternative is to use "this_cpu_has_cap()" instead
    of the faster system wide check, which may be a bit of an
    overhead, given we may have to do this in nvhe KVM host
    before a guest entry.
    
    Cc: Will Deacon <will@kernel.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
    Cc: Mike Leach <mike.leach@linaro.org>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Anshuman Khandual <anshuman.khandual@arm.com>
    Cc: Marc Zyngier <maz@kernel.org>
    Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
    Reviewed-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
    Reviewed-by: default avatarAnshuman Khandual <anshuman.khandual@arm.com>
    Signed-off-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
    Link: https://lore.kernel.org/r/20211019163153.3692640-4-suzuki.poulose@arm.com
    
    
    Signed-off-by: default avatarWill Deacon <will@kernel.org>
    (cherry picked from commit fa82d0b4
    
    )
    [Fix conflict due to another workaround that is not backported
    (TRBE_OVERWRITE). Also manually update cpucaps.h which is autogenerated
    in upstream from arch/arm64/tools/cpucaps which we ignored as part of
    the conflict resolution]
    Signed-off-by: default avatarQais Yousef <qais.yousef@arm.com>
    Change-Id: I37403e5a51de2b7015ee6e3e94ee690e66010890
    420405b4