mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-23 12:56:16 +07:00
1cce91dfc8
The asm-generic/unaligned.h header provides two different implementations
for accessing unaligned variables: the access_ok.h version used when
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is set pretends that all pointers
are in fact aligned, while the le_struct.h version convinces gcc that the
alignment of a pointer is '1', to make it issue the correct load/store
instructions depending on the architecture flags.
On ARMv5 and older, we always use the second version, to let the compiler
use byte accesses. On ARMv6 and newer, we currently use the access_ok.h
version, so the compiler can use any instruction including stm/ldm and
ldrd/strd that will cause an alignment trap. This trap can significantly
impact performance when we have to do a lot of fixups and, worse, has
led to crashes in the LZ4 decompressor code that does not have a trap
handler.
This adds an ARM specific version of asm/unaligned.h that uses the
le_struct.h/be_struct.h implementation unconditionally. This should lead
to essentially the same code on ARMv6+ as before, with the exception of
using regular load/store instructions instead of the trapping instructions
multi-register variants.
The crash in the LZ4 decompressor code was probably introduced by the
patch replacing the LZ4 implementation, commit 4e1a33b105
("lib: update
LZ4 compressor module"), so linux-4.11 and higher would be affected most.
However, we probably want to have this backported to all older stable
kernels as well, to help with the performance issues.
There are two follow-ups that I think we should also work on, but not
backport to stable kernels, first to change the asm-generic version of
the header to remove the ARM special case, and second to review all
other uses of CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS to see if they
might be affected by the same problem on ARM.
Cc: stable@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
26 lines
568 B
Makefile
26 lines
568 B
Makefile
generic-y += clkdev.h
|
|
generic-y += current.h
|
|
generic-y += early_ioremap.h
|
|
generic-y += emergency-restart.h
|
|
generic-y += exec.h
|
|
generic-y += extable.h
|
|
generic-y += irq_regs.h
|
|
generic-y += kdebug.h
|
|
generic-y += local.h
|
|
generic-y += local64.h
|
|
generic-y += mm-arch-hooks.h
|
|
generic-y += msi.h
|
|
generic-y += parport.h
|
|
generic-y += preempt.h
|
|
generic-y += rwsem.h
|
|
generic-y += seccomp.h
|
|
generic-y += segment.h
|
|
generic-y += serial.h
|
|
generic-y += simd.h
|
|
generic-y += sizes.h
|
|
generic-y += timex.h
|
|
generic-y += trace_clock.h
|
|
|
|
generated-y += mach-types.h
|
|
generated-y += unistd-nr.h
|