ARC: ARCv2: jump label: implement jump label patching
authorEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Fri, 8 Nov 2019 16:20:22 +0000 (19:20 +0300)
committerVineet Gupta <vgupta@synopsys.com>
Sat, 9 Nov 2019 00:14:32 +0000 (16:14 -0800)
commitf091d5a426447cc427680bdd3adc7773aa2867df
treee255dd3806463334c58d03aff06dee6e3b3268c3
parent2f4ecf68a048de44d72157d637bf9cbbbdb357b0
ARC: ARCv2: jump label: implement jump label patching

Implement jump label patching for ARC. Jump labels provide
an interface to generate dynamic branches using
self-modifying code.

This allows us to implement conditional branches where
changing branch direction is expensive but branch selection
is basically 'free'

This implementation uses 32-bit NOP and BRANCH instructions
which forced to be aligned by 4 to guarantee that they don't
cross L1 cache line boundary and can be update atomically.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
arch/arc/Kconfig
arch/arc/include/asm/cache.h
arch/arc/include/asm/jump_label.h [new file with mode: 0644]
arch/arc/kernel/Makefile
arch/arc/kernel/jump_label.c [new file with mode: 0644]