]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: Check Loongson3 LL/SC errata workaround correctness
authorPaul Burton <paul.burton@mips.com>
Tue, 1 Oct 2019 21:53:44 +0000 (21:53 +0000)
committerPaul Burton <paul.burton@mips.com>
Mon, 7 Oct 2019 16:43:13 +0000 (09:43 -0700)
commita745f7ecb449052b3ee4d5f26d13012035f539dd
tree6b6024d6dbbedd60e17018adc13e7bbeae0127e4
parentd2410fd3905e060a27616769eae4930a2981cb40
MIPS: Check Loongson3 LL/SC errata workaround correctness

When Loongson3 LL/SC errata workarounds are enabled (ie.
CONFIG_CPU_LOONGSON3_WORKAROUNDS=y) run a tool to scan through the
compiled kernel & ensure that the workaround is applied correctly. That
is, ensure that:

  - Every LL or LLD instruction is preceded by a sync instruction.

  - Any branches from within an LL/SC loop to outside of that loop
    target a sync instruction.

Reasoning for these conditions can be found by reading the comment above
the definition of __SYNC_loongson3_war in arch/mips/include/asm/sync.h.

This tool will help ensure that we don't inadvertently introduce code
paths that miss the required workarounds.

Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: linux-mips@vger.kernel.org
Cc: Huacai Chen <chenhc@lemote.com>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: linux-kernel@vger.kernel.org
arch/mips/Makefile
arch/mips/Makefile.postlink
arch/mips/tools/.gitignore
arch/mips/tools/Makefile
arch/mips/tools/loongson3-llsc-check.c [new file with mode: 0644]