linux-stable/arch/powerpc
Sandipan Das b0490a04e7 powerpc/lib/sstep: Fix count leading zeros instructions
According to the GCC documentation, the behaviour of __builtin_clz()
and __builtin_clzl() is undefined if the value of the input argument
is zero. Without handling this special case, these builtins have been
used for emulating the following instructions:
  * Count Leading Zeros Word (cntlzw[.])
  * Count Leading Zeros Doubleword (cntlzd[.])

This fixes the emulated behaviour of these instructions by adding an
additional check for this special case.

Fixes: 3cdfcbfd32 ("powerpc: Change analyse_instr so it doesn't modify *regs")
Signed-off-by: Sandipan Das <sandipan@linux.vnet.ibm.com>
Reviewed-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2017-10-10 20:16:32 +11:00
..
boot powerpc: conditionally compile platform-specific serial drivers 2017-08-31 14:26:48 +10:00
configs powerpc/configs: Update for CONFIG_SND changes 2017-09-20 13:30:09 +10:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2017-05-02 15:53:46 -07:00
include Merge branch 'akpm' (patches from Andrew) 2017-09-09 10:30:07 -07:00
kernel powerpc/livepatch: Fix livepatch stack access 2017-10-10 15:27:42 +11:00
kvm kvm,powerpc: Serialize wq active checks in ops->vcpu_kick 2017-09-15 16:57:13 +02:00
lib powerpc/lib/sstep: Fix count leading zeros instructions 2017-10-10 20:16:32 +11:00
math-emu Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
mm powerpc/mm: Call flush_tlb_kernel_range with interrupts enabled 2017-10-04 22:15:30 +11:00
net powerpc updates for 4.14 2017-09-07 10:15:40 -07:00
oprofile ktime: Cleanup ktime_set() usage 2016-12-25 17:21:22 +01:00
perf powerpc/sysrq: Fix oops whem ppmu is not registered 2017-09-20 13:30:09 +10:00
platforms powerpc/powernv: Increase memory block size to 1GB on radix 2017-10-06 15:50:45 +11:00
purgatory powerpc/asm: Convert .llong directives to .8byte 2017-08-31 14:26:47 +10:00
sysdev powerpc/xive: Clear XIVE internal structures when a CPU is removed 2017-10-04 22:01:57 +11:00
tools powerpc/64: Tool to check head sections location sanity 2017-05-30 14:59:51 +10:00
xmon powerpc/xmon: Add ISA v3.0 SPRs to SPR dump 2017-08-31 14:26:45 +10:00
Kconfig powerpc updates for 4.14 2017-09-07 10:15:40 -07:00
Kconfig.debug powerpc/xmon: Enable disassembly files (compilation changes) 2017-02-15 20:02:42 +11:00
Makefile Merge branch 'fixes' into next 2017-08-23 22:20:10 +10:00
Makefile.postlink powerpc/64: Tool to check head sections location sanity 2017-05-30 14:59:51 +10:00