powerpc/lib: Add helper to check if offset is within conditional branch range
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Mon, 15 Nov 2021 11:06:27 +0000 (16:36 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 13:04:29 +0000 (14:04 +0100)
commit51cf71d5cb03c38fed74588ea79ed8673a8446f9
tree384143ad6e65d5b76e02b46b8310b684686efdf0
parent74293225f50391620aaef3507ebd6fd17e0003e1
powerpc/lib: Add helper to check if offset is within conditional branch range

upstream commit 4549c3ea3160fa8b3f37dfe2f957657bb265eda9

Add a helper to check if a given offset is within the branch range for a
powerpc conditional branch instruction, and update some sites to use the
new helper.

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/442b69a34ced32ca346a0d9a855f3f6cfdbbbd41.1633464148.git.naveen.n.rao@linux.vnet.ibm.com
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/include/asm/code-patching.h
arch/powerpc/lib/code-patching.c
arch/powerpc/net/bpf_jit.h