]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
powerpc: Add helper to check if offset is within relative branch range
authorAnju T <anju@linux.vnet.ibm.com>
Wed, 8 Feb 2017 08:57:30 +0000 (14:27 +0530)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 20 Feb 2017 22:33:31 +0000 (15:33 -0700)
commit7e841c39ec30f6ed3e764e36cbb5e99c644899af
tree164c561e1885a0ddebade0ced137091cdc63daf1
parentf0cd824027c5a9cd9850ebf08350fb8e35fc784e
powerpc: Add helper to check if offset is within relative branch range

BugLink: http://bugs.launchpad.net/bugs/1585741
To permit the use of relative branch instruction in powerpc, the target
address has to be relatively nearby, since the address is specified in an
immediate field (24 bit filed) in the instruction opcode itself. Here
nearby refers to 32MB on either side of the current instruction.

This patch verifies whether the target address is within +/- 32MB
range or not.

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Anju T Sudhakar <anju@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from linux-next commit ebfa50df435eed18e1389a43e0596246228e7298)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
arch/powerpc/include/asm/code-patching.h
arch/powerpc/lib/code-patching.c