1
0
Fork 0
alistair23-linux/arch
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
..
alpha mm: introduce MAP_FIXED_NOREPLACE 2018-04-11 10:28:38 -07:00
arc kbuild: mark $(targets) as .SECONDARY and remove .PRECIOUS markers 2018-04-07 19:04:02 +09:00
arm Kbuild updates for v4.17 (2nd) 2018-04-15 17:21:30 -07:00
arm64 Kbuild updates for v4.17 (2nd) 2018-04-15 17:21:30 -07:00
c6x c6x: pass endianness info to sparse 2018-04-10 09:58:58 -04:00
h8300 h8300: remove extraneous __BIG_ENDIAN definition 2018-03-22 17:07:01 -07:00
hexagon
ia64 pci-v4.17-changes 2018-04-06 18:31:06 -07:00
m68k Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu 2018-04-09 09:15:46 -07:00
microblaze Microblaze patches for 4.17-rc1 2018-04-12 10:18:02 -07:00
mips mm/gup.c: document return value 2018-04-13 17:10:27 -07:00
nds32 page cache: use xa_lock 2018-04-11 10:28:39 -07:00
nios2 nios2 update for v4.17-rc1 2018-04-11 16:02:18 -07:00
openrisc OpenRISC updates for v4.17 2018-04-15 12:27:58 -07:00
parisc Merge branch 'parisc-4.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux 2018-04-12 17:07:04 -07:00
powerpc powerpc/lib: Fix off-by-one in alternate feature patching 2018-04-17 00:37:48 +10:00
riscv RISC-V changes for 4.17 2018-04-04 16:43:47 -07:00
s390 Merge branch 'akpm' (patches from Andrew) 2018-04-14 08:50:50 -07:00
sh Merge branch 'akpm' (patches from Andrew) 2018-04-14 08:50:50 -07:00
sparc Kbuild updates for v4.17 (2nd) 2018-04-15 17:21:30 -07:00
um Merge git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml 2018-04-11 16:36:47 -07:00
unicore32 unicore32: turn flush_dcache_mmap_lock into a no-op 2018-04-11 10:28:39 -07:00
x86 Kbuild updates for v4.17 (2nd) 2018-04-15 17:21:30 -07:00
xtensa mm: introduce MAP_FIXED_NOREPLACE 2018-04-11 10:28:38 -07:00
.gitignore
Kconfig kbuild: remove incremental linking option 2018-03-26 02:01:19 +09:00