xemu/target-arm
Peter Maydell 9b6a3ea7a6 target-arm: Correctly handle 'sub pc, pc, 1' for ARMv6
In the ARM v6 architecture, 'sub pc, pc, 1' is not an interworking
branch, so the computed new value is written to r15 as a normal
value. The architecture says that in this case, bits [1:0] of
the value written must be ignored if we are in ARM mode (or
bit [0] ignored if in Thumb mode); this is a change from the
ARMv4/v5 specification that behaviour is UNPREDICTABLE.
Use the correct mask on the PC value when doing a non-interworking
store to PC.

A popular library used on RaspberryPi uses this instruction
as part of a trick to determine whether it is running on
ARMv6 or ARMv7, and we were mishandling the sequence.

Fixes bug: https://bugs.launchpad.net/bugs/1625295

Reported-by: <stu.axon@gmail.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1474380941-4730-1-git-send-email-peter.maydell@linaro.org
2016-10-04 13:28:10 +01:00
..
arch_dump.c arm: Clean up includes 2016-01-29 15:07:23 +00:00
arm_ldst.h cpu: move exec-all.h inclusion out of cpu.h 2016-05-19 16:42:29 +02:00
arm-powerctl.c Use #include "..." for our own headers, <...> for others 2016-07-12 16:19:16 +02:00
arm-powerctl.h ARM: Factor out ARM on/off PSCI control functions 2016-05-12 13:22:28 +01:00
arm-semi.c target-arm/arm-semi.c: In SYS_HEAPINFO use correct type for 'limit' 2016-07-07 13:47:00 +01:00
cpu64.c include/qemu/osdep.h: Don't include qapi/error.h 2016-03-22 22:20:15 +01:00
cpu-qom.h target-arm: make cpu-qom.h not target specific 2016-05-19 13:08:04 +02:00
cpu.c arm: add Cortex A7 CPU parameters 2016-09-22 18:13:05 +01:00
cpu.h target-*: Clean up cpu.h header guards 2016-07-12 16:19:16 +02:00
crypto_helper.c target-arm: Clean up includes 2016-01-18 16:33:32 +00:00
gdbstub64.c qemu-common: push cpu.h inclusion out of qemu-common.h 2016-05-19 16:42:29 +02:00
gdbstub.c qemu-common: push cpu.h inclusion out of qemu-common.h 2016-05-19 16:42:29 +02:00
helper-a64.c softfloat: Implement run-time-configurable meaning of signaling NaN bit 2016-06-24 13:40:37 +01:00
helper-a64.h
helper.c tcg: Merge GETPC and GETRA 2016-09-16 08:12:11 -07:00
helper.h target-arm: Implement MRS (banked) and MSR (banked) instructions 2016-03-16 17:05:58 +00:00
internals.h Fix confusing argument names in some common functions 2016-07-12 13:06:08 +01:00
iwmmxt_helper.c target-arm: Clean up includes 2016-01-18 16:33:32 +00:00
kvm32.c os-posix: include sys/mman.h 2016-06-16 18:39:03 +02:00
kvm64.c os-posix: include sys/mman.h 2016-06-16 18:39:03 +02:00
kvm_arm.h target-arm: move gicv3_class_name from machine to kvm_arm.h 2016-10-04 13:28:08 +01:00
kvm-consts.h all: Clean up includes 2016-02-23 12:43:05 +00:00
kvm-stub.c qemu-common: push cpu.h inclusion out of qemu-common.h 2016-05-19 16:42:29 +02:00
kvm.c kvm-irqchip: i386: add hook for add/remove virq 2016-07-21 20:44:19 +03:00
machine.c target-arm: move gicv3_class_name from machine to kvm_arm.h 2016-10-04 13:28:08 +01:00
Makefile.objs ARM: Factor out ARM on/off PSCI control functions 2016-05-12 13:22:28 +01:00
monitor.c target-arm/monitor.c: Advertise emulated GICv3 in capabilities 2016-06-17 15:23:51 +01:00
neon_helper.c target-arm: Fix warn about implicit conversion 2016-08-12 11:12:24 +01:00
op_addsub.h
op_helper.c target-arm: Fix lpae bit in FSR on an alignment fault 2016-09-06 19:52:17 +01:00
psci.c Use #include "..." for our own headers, <...> for others 2016-07-12 16:19:16 +02:00
translate-a64.c target-arm: A64: Fix decoding of iss_sf in disas_ld_lit 2016-10-04 13:28:10 +01:00
translate.c target-arm: Correctly handle 'sub pc, pc, 1' for ARMv6 2016-10-04 13:28:10 +01:00
translate.h target-arm: A64: Create Instruction Syndromes for Data Aborts 2016-06-06 16:59:28 +01:00