unicorn/qemu/target-arm
Peter Maydell 0e9a6a26f5
target-arm: A64: Fix handling of rotate in logic_imm_decode_wmask
The code in logic_imm_decode_wmask attempts to rotate a mask
value within the bottom 'e' bits of the value with
mask = (mask >> r) | (mask << (e - r));
This has two issues:
* if the element size is 64 then a rotate by zero results
in a shift left by 64, which is undefined behaviour
* if the element size is smaller than 64 then this will
leave junk in the value at bit 'e' and above, which is
not valid input to bitfield_replicate(). As it happens,
the bits at bit 'e' to '2e - r' are exactly the ones
which bitfield_replicate is going to copy in there,
so this isn't a "wrong code generated" bug, but it's
confusing and if we ever put an assert in
bitfield_replicate it would fire on valid guest code.

Fix the former by not doing anything if r is zero, and
the latter by masking with bitmask64(e).

Backports commit e167adc9d9f5df4f8109aecd4552c407fdce094a from qemu
2018-02-12 15:02:34 -05:00
..
arm_ldst.h import 2015-08-21 15:04:50 +08:00
cpu-qom.h target-arm: Add ARMCPU secure property 2018-02-12 10:40:52 -05:00
cpu.c target-arm: Add CPU property to disable AArch64 2018-02-12 13:56:44 -05:00
cpu.h target-arm: Add 32/64-bit register sync 2018-02-12 14:57:20 -05:00
cpu64.c target-arm: Add CPU property to disable AArch64 2018-02-12 13:56:44 -05:00
crypto_helper.c target-arm: crypto: fix BE host support 2018-02-12 10:40:52 -05:00
helper-a64.c target-arm: Add 32/64-bit register sync 2018-02-12 14:57:20 -05:00
helper-a64.h import 2015-08-21 15:04:50 +08:00
helper.c target-arm: Add 32/64-bit register sync 2018-02-12 14:57:20 -05:00
helper.h rework code/block tracing 2016-01-22 19:07:50 -08:00
internals.h target-arm: make TTBCR banked 2018-02-11 19:59:03 -05:00
iwmmxt_helper.c import 2015-08-21 15:04:50 +08:00
kvm-consts.h import 2015-08-21 15:04:50 +08:00
Makefile.objs delete sparc32_dma.h & arm-semi.c 2017-01-19 15:10:41 +08:00
neon_helper.c Arm support ported. (#736) 2017-01-23 23:30:57 +08:00
op_addsub.h import 2015-08-21 15:04:50 +08:00
op_helper.c target-arm: Add 32/64-bit register sync 2018-02-12 14:57:20 -05:00
psci.c import 2015-08-21 15:04:50 +08:00
translate-a64.c target-arm: A64: Fix handling of rotate in logic_imm_decode_wmask 2018-02-12 15:02:34 -05:00
translate.c target-arm: Use correct mmu_idx for unprivileged loads and stores 2018-02-12 11:28:17 -05:00
translate.h target-arm: Define correct mmu_idx values and pass them in TB flags 2018-02-12 11:21:19 -05:00
unicorn.h arm64eb: add support for ARM64 big endian. 2017-04-24 23:30:01 +08:00
unicorn_aarch64.c target-arm: make c13 cp regs banked (FCSEIDR, ...) 2018-02-12 10:40:51 -05:00
unicorn_arm.c fix conflicts 2017-03-30 12:23:24 +08:00