]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: Make create_branch() return errors if the branch target is too large
authorMichael Ellerman <michael@ellerman.id.au>
Tue, 24 Jun 2008 01:32:24 +0000 (11:32 +1000)
committerPaul Mackerras <paulus@samba.org>
Tue, 1 Jul 2008 01:28:19 +0000 (11:28 +1000)
commitd07c22ca7ea86eedce88c6de123fa933d5c22a7b
tree21f5a7dd1718d33a38083fc51cdaad054fdbae72
parentb311409e585b0d6760ead36b3e1da149f0b9b31b
powerpc: Make create_branch() return errors if the branch target is too large

If you pass a target value to create_branch() which is more than 32MB - 4,
or - 32MB away from the branch site, then it's impossible to create an
immediate branch.  The current code doesn't check, which will lead to us
creating a branch to somewhere else - which is bad.

For code that cares to check we return 0, which is easy to check for, and
for code that doesn't at least we'll be creating an illegal instruction,
rather than a branch to some random address.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/lib/code-patching.c