安庆

导航

cpu的errata

芯片如果流片后,产生一些需要软件workaround的bug怎么处理呢?

在linux中,对于pci,有pci的quirk,对于cpu,有cpu的errata。

以arm为例,针对cpu执行 errata 的代码为:arch/arm64/kernel/cpu_errata.c

以arm较新的armN2 为例:
arch/arm64/kernel/cpu_errata.c
392: MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N2),
405: MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N2),
417: MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N2),
具体其中一个可以看到:

commit b9d216fcef4298de76519e2baeed69ba482467bd
Author: Suzuki K Poulose <suzuki.poulose@arm.com>
Date:   Tue Oct 19 17:31:40 2021 +0100

    arm64: errata: Add detection for TRBE overwrite in FILL mode

    Arm Neoverse-N2 and the Cortex-A710 cores are affected
    by a CPU erratum where the TRBE will overwrite the trace buffer
    in FILL mode. The TRBE doesn't stop (as expected in FILL mode)
    when it reaches the limit and wraps to the base to continue
    writing upto 3 cache lines. This will overwrite any trace that
    was written previously.

    Add the Neoverse-N2 erratum(#2139208) and Cortex-A710 erratum
    (#2119858) to the detection logic.

    This will be used by the TRBE driver in later patches to work
    around the issue. The detection has been kept with the core
    arm64 errata framework list to make sure :
      - We don't duplicate the framework in TRBE driver
      - The errata detection is advertised like the rest
        of the CPU errata.

    Note that the Kconfig entries are not fully active until the
    TRBE driver implements the work around.

posted on 2023-09-05 19:18  _备忘录  阅读(55)  评论(0编辑  收藏  举报