• Anshuman Khandual's avatar
    coresight: trbe: Work around the invalid prohibited states · f209e9fe
    Anshuman Khandual authored
    TRBE implementations affected by Arm erratum #2038923 might get TRBE into
    an inconsistent view on whether trace is prohibited within the CPU. As a
    result, the trace buffer or trace buffer state might be corrupted. This
    happens after TRBE buffer has been enabled by setting TRBLIMITR_EL1.E,
    followed by just a single context synchronization event before execution
    changes from a context, in which trace is prohibited to one where it isn't,
    or vice versa. In these mentioned conditions, the view of whether trace is
    prohibited is inconsistent between parts of the CPU, and the trace buffer
    or the trace buffer state might be corrupted.
    
    Work around this problem in the TRBE driver by preventing an inconsistent
    view of whether the trace is prohibited or not based on TRBLIMITR_EL1.E by
    immediately following a change to TRBLIMITR_EL1.E with at least one ISB
    instruction before an ERET, or two ISB instructions if no ERET is to take
    place. This just updates the TRBE driver as required.
    
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Will Deacon <will@kernel.org>
    Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
    Cc: Suzuki Poulose <suzuki.poulose@arm.com>
    Cc: coresight@lists.linaro.org
    Cc: linux-doc@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-kernel@vger.kernel.org
    Reviewed-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
    Signed-off-by: default avatarAnshuman Khandual <anshuman.khandual@arm.com>
    Link: https://lore.kernel.org/r/1643120437-14352-7-git-send-email-anshuman.khandual@arm.comSigned-off-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
    Signed-off-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
    f209e9fe
coresight-trbe.c 46.3 KB