original_kernel/arch/powerpc/lib
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
..
Makefile powerpc: Use instruction emulation infrastructure to handle alignment faults 2017-09-01 16:42:43 +10:00
alloc.c
checksum_32.S
checksum_64.S
checksum_wrappers.c
code-patching.c powerpc/lib/code-patching: Use alternate map for patch_instruction() 2017-07-03 23:12:19 +10:00
copy_32.S powerpc/32: remove a NOP from memset() 2017-09-01 16:42:46 +10:00
copypage_64.S
copypage_power7.S powerpc: Fix invalid use of register expressions 2017-08-10 22:29:41 +10:00
copyuser_64.S
copyuser_power7.S powerpc: Fix invalid use of register expressions 2017-08-10 22:29:41 +10:00
crtsavres.S powerpc/64: Do not create new section for save/restore functions 2017-05-30 14:59:51 +10:00
div64.S
feature-fixups-test.S
feature-fixups.c powerpc: make feature-fixup tests fortify-safe 2017-07-12 16:26:03 -07:00
hweight_64.S
ldstfp.S powerpc: Fix kernel crash in emulation of vector loads and stores 2017-09-04 19:38:07 +10:00
locks.c
mem_64.S powerpc/string: Implement optimized memset variants 2017-08-17 23:04:35 +10:00
memcmp_64.S
memcpy_64.S
memcpy_power7.S powerpc: Fix invalid use of register expressions 2017-08-10 22:29:41 +10:00
quad.S powerpc: Handle most loads and stores in instruction emulation code 2017-09-01 16:39:48 +10:00
rheap.c
sstep.c powerpc/lib/sstep: Fix count leading zeros instructions 2017-10-10 20:16:32 +11:00
string.S
string_64.S powerpc: Fix invalid use of register expressions 2017-08-10 22:29:41 +10:00
test_emulate_step.c
vmx-helper.c
xor_vmx.c powerpc/lib/xor_vmx: Ensure no altivec code executes before enable_kernel_altivec() 2017-06-02 20:17:52 +10:00
xor_vmx.h powerpc/lib/xor_vmx: Ensure no altivec code executes before enable_kernel_altivec() 2017-06-02 20:17:52 +10:00
xor_vmx_glue.c powerpc/lib/xor_vmx: Ensure no altivec code executes before enable_kernel_altivec() 2017-06-02 20:17:52 +10:00