[PATCH 3/6] Make create_branch() return errors if the branch target is too large

Benjamin Herrenschmidt benh at kernel.crashing.org
Thu May 29 16:33:40 EST 2008


On Thu, 2008-05-29 at 16:20 +1000, Michael Ellerman wrote:
> 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 at ellerman.id.au>

Acked-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>





More information about the Linuxppc-dev mailing list