Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc: Fix div64 in bootloader

The code is missing a fix that went into the main kernel variant
(we should try to share that code again at some stage)

Reported-by: Albert Cahalan <acahalan@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

+2 -1
+2 -1
arch/powerpc/boot/div64.S
··· 33 33 cntlzw r0,r5 # we are shifting the dividend right 34 34 li r10,-1 # to make it < 2^32, and shifting 35 35 srw r10,r10,r0 # the divisor right the same amount, 36 - add r9,r4,r10 # rounding up (so the estimate cannot 36 + addc r9,r4,r10 # rounding up (so the estimate cannot 37 37 andc r11,r6,r10 # ever be too large, only too small) 38 38 andc r9,r9,r10 39 + addze r9,r9 39 40 or r11,r5,r11 40 41 rotlw r9,r9,r0 41 42 rotlw r11,r11,r0