]> git.baikalelectronics.ru Git - kernel.git/commit
mips, uasm: Add workaround for Loongson-2F nop CPU errata
authorJohan Almbladh <johan.almbladh@anyfinetworks.com>
Tue, 5 Oct 2021 16:54:03 +0000 (18:54 +0200)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 6 Oct 2021 19:28:09 +0000 (12:28 -0700)
commit7e69fc59d2a6d11ab369080f1a70a31ef7faaa63
treec055560c6ab84e6fa3dd3dd842c89d6887021987
parentb427276abbf1289b73a4248ca7822d7d1486f0ac
mips, uasm: Add workaround for Loongson-2F nop CPU errata

This patch implements a workaround for the Loongson-2F nop in generated,
code, if the existing option CONFIG_CPU_NOP_WORKAROUND is set. Before,
the binutils option -mfix-loongson2f-nop was enabled, but no workaround
was done when emitting MIPS code. Now, the nop pseudo instruction is
emitted as "or ax,ax,zero" instead of the default "sll zero,zero,0". This
is consistent with the workaround implemented by binutils.

Signed-off-by: Johan Almbladh <johan.almbladh@anyfinetworks.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Link: https://sourceware.org/legacy-ml/binutils/2009-11/msg00387.html
Link: https://lore.kernel.org/bpf/20211005165408.2305108-3-johan.almbladh@anyfinetworks.com
arch/mips/include/asm/uasm.h