qemu-e2k/target/arm
Peter Maydell b28b3377d7 arm: Fix APSR writes via M profile MSR
Our implementation of writes to the APSR for M-profile via the MSR
instruction was badly broken.

First and worst, we had the sense wrong on the test of bit 2 of the
SYSm field -- this is supposed to request an APSR write if bit 2 is 0
but we were doing it if bit 2 was 1.  This bug was introduced in
commit 58117c9bb4, so hasn't been in a QEMU release.

Secondly, the choice of exactly which parts of APSR should be written
is defined by bits in the 'mask' field.  We were not passing these
through from instruction decode, making it impossible to check them
in the helper.

Pass the mask bits through from the instruction decode to the helper
function and process them appropriately; fix the wrong sense of the
SYSm bit 2 check.

Invalid mask values and invalid combinations of mask and register
number are UNPREDICTABLE; we choose to treat them as if the mask
values were valid.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1487616072-9226-5-git-send-email-peter.maydell@linaro.org
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
2017-03-20 12:41:44 +00:00
..
arch_dump.c
arm_ldst.h
arm-powerctl.c target-arm/powerctl: defer cpu reset work to CPU context 2017-02-24 10:32:46 +00:00
arm-powerctl.h target-arm/powerctl: defer cpu reset work to CPU context 2017-02-24 10:32:46 +00:00
arm-semi.c
cpu64.c
cpu-qom.h
cpu.c armv7m: Fix condition check for taking exceptions 2017-02-28 12:08:17 +00:00
cpu.h target/arm/arm-powerctl: Fix psci info return values 2017-03-14 11:28:54 +00:00
crypto_helper.c
gdbstub64.c
gdbstub.c
helper-a64.c
helper-a64.h
helper.c arm: Fix APSR writes via M profile MSR 2017-03-20 12:41:44 +00:00
helper.h
internals.h
iwmmxt_helper.c
kvm32.c
kvm64.c
kvm_arm.h
kvm-consts.h
kvm-stub.c
kvm.c KVM: do not use sigtimedwait to catch SIGBUS 2017-03-03 16:40:02 +01:00
machine.c target-arm/powerctl: defer cpu reset work to CPU context 2017-02-24 10:32:46 +00:00
Makefile.objs
monitor.c
neon_helper.c
op_addsub.h
op_helper.c target-arm: don't generate WFE/YIELD calls for MTTCG 2017-02-24 10:32:46 +00:00
psci.c target-arm/powerctl: defer cpu reset work to CPU context 2017-02-24 10:32:46 +00:00
trace-events
translate-a64.c Add missing fp_access_check() to aarch64 crypto instructions 2017-02-28 12:08:15 +00:00
translate.c arm: Fix APSR writes via M profile MSR 2017-03-20 12:41:44 +00:00
translate.h