linux-stable/tools/arch
Vasily Gorbik 5ed934e57e x86/insn: Fix vector instruction decoding on big endian cross-compiles
Running instruction decoder posttest on an s390 host with an x86 target
with allyesconfig shows errors. Instructions used in a couple of kernel
objects could not be correctly decoded on big endian system.

  insn_decoder_test: warning: objdump says 6 bytes, but insn_get_length() says 5
  insn_decoder_test: warning: Found an x86 instruction decoder bug, please report this.
  insn_decoder_test: warning: ffffffff831eb4e1:    62 d1 fd 48 7f 04 24    vmovdqa64 %zmm0,(%r12)
  insn_decoder_test: warning: objdump says 7 bytes, but insn_get_length() says 6
  insn_decoder_test: warning: Found an x86 instruction decoder bug, please report this.
  insn_decoder_test: warning: ffffffff831eb4e8:    62 51 fd 48 7f 44 24 01         vmovdqa64 %zmm8,0x40(%r12)
  insn_decoder_test: warning: objdump says 8 bytes, but insn_get_length() says 6

This is because in a few places instruction field bytes are set directly
with further usage of "value". To address that introduce and use a
insn_set_byte() helper, which correctly updates "value" on big endian
systems.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
2021-01-13 18:13:17 -06:00
..
alpha/include tools headers uapi: Sync asm-generic/mman-common.h and linux/mman.h 2019-03-28 14:31:56 -03:00
arc/include/uapi/asm tools arch uapi: Copy missing unistd.h headers for arc, hexagon and riscv 2019-05-02 16:00:20 -04:00
arm/include tools headers kvm: Sync kvm headers with the kernel sources 2019-12-02 12:54:13 -03:00
arm64/include tools kvm headers: Update KVM headers from the kernel sources 2020-12-24 09:24:19 -03:00
csky/include/uapi/asm csky: Add support for libdw 2019-05-15 16:36:46 -03:00
h8300/include License cleanup: add SPDX license identifier to uapi header files with no license 2017-11-02 11:19:54 +01:00
hexagon/include/uapi/asm tools arch uapi: Copy missing unistd.h headers for arc, hexagon and riscv 2019-05-02 16:00:20 -04:00
ia64/include tools, perf: add and use optimized ring_buffer_{read_head, write_tail} helpers 2018-10-19 13:43:08 -07:00
microblaze/include/uapi/asm License cleanup: add SPDX license identifier to uapi header files with no license 2017-11-02 11:19:54 +01:00
mips/include tools headers uapi: Sync asm-generic/mman-common.h and linux/mman.h 2019-03-28 14:31:56 -03:00
parisc/include/uapi/asm parisc: Add MAP_UNINITIALIZED define 2020-10-15 08:10:39 +02:00
powerpc/include perf tools changes for v5.9 2020-08-10 19:21:38 -07:00
riscv/include/uapi/asm Replace HTTP links with HTTPS ones: RISC-V 2020-07-30 11:37:40 -07:00
s390/include tools kvm headers: Update KVM headers from the kernel sources 2020-11-03 08:46:30 -03:00
sh/include sh: remove sh5 support 2020-06-01 14:48:52 -04:00
sparc/include tools headers UAPI: Update tools's copy of mman.h headers 2019-07-29 09:02:58 -03:00
x86 x86/insn: Fix vector instruction decoding on big endian cross-compiles 2021-01-13 18:13:17 -06:00
xtensa/include tools headers uapi: Sync asm-generic/mman-common.h and linux/mman.h 2019-03-28 14:31:56 -03:00