qemu-e2k/target
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
..
alpha qemu-timer: do not include sysemu/cpus.h from util/qemu-timer.h 2017-03-14 13:28:18 +01:00
arm arm: Fix APSR writes via M profile MSR 2017-03-20 12:41:44 +00:00
cris
hppa hppa: avoid anonymous unions in designated initializers. 2017-03-04 12:52:01 +00:00
i386 kvm: Print MSR information if KVM_{GET,SET}_MSRS failed 2017-03-14 13:26:36 +01:00
lm32
m68k
microblaze
mips target/mips: hold BQL for timer interrupts 2017-03-09 10:41:48 +00:00
moxie
nios2 target/nios2: take BQL around interrupt check 2017-03-14 13:26:37 +01:00
openrisc
ppc target/ppc: fix cpu_ov setting for 32-bit 2017-03-14 11:27:23 +11:00
s390x makefile: merge GENERATED_HEADERS & GENERATED_SOURCES variables 2017-03-16 11:51:15 +08:00
sh4 monitor: Fix crashes when using HMP commands without CPU 2017-02-21 18:29:01 +00:00
sparc sparc/sparc64: grab BQL before calling cpu_check_irqs 2017-03-09 10:41:38 +00:00
tilegx
tricore
unicore32
xtensa target/xtensa fixes for 2.9: 2017-03-18 17:24:49 +00:00