linux/arch/powerpc/lib
Michael Ellerman b8858581fe powerpc/lib: Fix off-by-one in alternate feature patching
When we patch an alternate feature section, we have to adjust any
relative branches that branch out of the alternate section.

But currently we have a bug if we have a branch that points to past
the last instruction of the alternate section, eg:

  FTR_SECTION_ELSE
  1:     b       2f
         or      6,6,6
  2:
  ALT_FTR_SECTION_END(...)
         nop

This will result in a relative branch at 1 with a target that equals
the end of the alternate section.

That branch does not need adjusting when it's moved to the non-else
location. Currently we do adjust it, resulting in a branch that goes
off into the link-time location of the else section, which is junk.

The fix is to not patch branches that have a target == end of the
alternate section.

Fixes: d20fe50a7b ("KVM: PPC: Book3S HV: Branch inside feature section")
Fixes: 9b1a735de6 ("powerpc: Add logic to patch alternative feature sections")
Cc: stable@vger.kernel.org # v2.6.27+
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2018-04-17 00:37:48 +10:00
..
alloc.c
checksum_32.S
checksum_64.S
checksum_wrappers.c
code-patching.c powerpc/lib/feature-fixups: use raw_patch_instruction() 2018-01-21 15:06:25 +11:00
copy_32.S
copypage_64.S powerpc/64s: Set assembler machine type to POWER4 2018-04-01 00:47:49 +11:00
copypage_power7.S powerpc/64s: Set assembler machine type to POWER4 2018-04-01 00:47:49 +11:00
copyuser_64.S powerpc/64s: Set assembler machine type to POWER4 2018-04-01 00:47:49 +11:00
copyuser_power7.S powerpc/64s: Set assembler machine type to POWER4 2018-04-01 00:47:49 +11:00
crtsavres.S
div64.S
feature-fixups-test.S
feature-fixups.c powerpc/lib: Fix off-by-one in alternate feature patching 2018-04-17 00:37:48 +10:00
hweight_64.S
ldstfp.S
locks.c
Makefile powerpc/64s: Set assembler machine type to POWER4 2018-04-01 00:47:49 +11:00
mem_64.S
memcmp_64.S
memcpy_64.S powerpc/64s: Set assembler machine type to POWER4 2018-04-01 00:47:49 +11:00
memcpy_power7.S powerpc/64s: Set assembler machine type to POWER4 2018-04-01 00:47:49 +11:00
pmem.c powerpc/lib: Implement UACCESS_FLUSHCACHE API 2017-11-13 08:00:31 +11:00
quad.S
rheap.c
sstep.c powerpc/32: Move the inline keyword at the beginning of function declaration 2018-03-13 15:50:33 +11:00
string_64.S
string.S
test_emulate_step.c
vmx-helper.c
xor_vmx_glue.c
xor_vmx.c
xor_vmx.h