qemu-e2k/target/arm
Peter Maydell 268b1b3dfb target/arm: Allow user-mode code to write CPSR.E via MSR
Using the MSR instruction to write to CPSR.E is deprecated, but it is
required to work from any mode including unprivileged code.  We were
incorrectly forbidding usermode code from writing it because
CPSR_USER did not include the CPSR_E bit.

We use CPSR_USER in only three places:
 * as the mask of what to allow userspace MSR to write to CPSR
 * when deciding what bits a linux-user signal-return should be
   able to write from the sigcontext structure
 * in target_user_copy_regs() when we set up the initial
   registers for the linux-user process

In the first two cases not being able to update CPSR.E is a bug, and
in the third case it doesn't matter because CPSR.E is always 0 there.
So we can fix both bugs by adding CPSR_E to CPSR_USER.

Because the cpsr_write() in restore_sigcontext() is now changing
a CPSR bit which is cached in hflags, we need to add an
arm_rebuild_hflags() call there; the callsite in
target_user_copy_regs() was already rebuilding hflags for other
reasons.

(The recommended way to change CPSR.E is to use the 'SETEND'
instruction, which we do correctly allow from usermode code.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20200518142801.20503-1-peter.maydell@linaro.org
2020-05-21 22:05:27 +01:00
..
a32-uncond.decode
a32.decode
arch_dump.c
arm_ldst.h
arm-powerctl.c
arm-powerctl.h
arm-semi.c
cpu64.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
cpu_tcg.c target/arm: Use correct GDB XML for M-profile cores 2020-05-14 15:03:08 +01:00
cpu-param.h target/arm: Don't use a TLB for ARMMMUIdx_Stage2 2020-05-04 10:32:46 +01:00
cpu-qom.h target/arm: Make cpu_register() available for other files 2020-04-30 15:35:41 +01:00
cpu.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
cpu.h target/arm: Allow user-mode code to write CPSR.E via MSR 2020-05-21 22:05:27 +01:00
crypto_helper.c
debug_helper.c
gdbstub64.c
gdbstub.c target/arm: Use correct GDB XML for M-profile cores 2020-05-14 15:03:08 +01:00
helper-a64.c
helper-a64.h
helper-sve.h target/arm: Use tcg_gen_gvec_5_ptr for sve FMLA/FCMLA 2020-05-11 11:59:22 +01:00
helper.c target-arm: kvm64: handle SIGBUS signal from kernel or KVM 2020-05-14 15:03:09 +01:00
helper.h target/arm: Move 'env' argument of recps_f32 and rsqrts_f32 helpers to usual place 2020-05-14 15:03:09 +01:00
idau.h
internals.h target-arm: kvm64: handle SIGBUS signal from kernel or KVM 2020-05-14 15:03:09 +01:00
iwmmxt_helper.c
kvm32.c target/arm/kvm: Inline set_feature() calls 2020-05-11 11:45:59 +01:00
kvm64.c target-arm: kvm64: handle SIGBUS signal from kernel or KVM 2020-05-14 15:03:09 +01:00
kvm_arm.h
kvm-consts.h
kvm-stub.c
kvm.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
m_helper.c
machine.c
Makefile.objs target/arm: Restrict TCG cpus to TCG accel 2020-05-11 11:45:59 +01:00
monitor.c
neon_helper.c target/arm: Convert Neon VADD, VSUB, VABD 3-reg-same insns to decodetree 2020-05-14 15:03:09 +01:00
neon-dp.decode target/arm: Convert NEON VFMA, VFMS 3-reg-same insns to decodetree 2020-05-14 15:03:09 +01:00
neon-ls.decode target/arm: Convert Neon 'load/store single structure' to decodetree 2020-05-04 12:57:56 +01:00
neon-shared.decode target/arm: Convert VFM[AS]L (scalar) to decodetree 2020-05-04 12:57:56 +01:00
op_addsub.h
op_helper.c
pauth_helper.c
psci.c
sve_helper.c softfloat: Replace flag with bool 2020-05-19 08:40:50 -07:00
sve.decode
t16.decode
t32.decode
tlb_helper.c target-arm: kvm64: handle SIGBUS signal from kernel or KVM 2020-05-14 15:03:09 +01:00
trace-events
translate-a64.c target/arm: Use clear_vec_high more effectively 2020-05-21 22:05:27 +01:00
translate-a64.h target/arm: Convert Neon 3-reg-same VADD/VSUB to decodetree 2020-05-04 12:57:56 +01:00
translate-neon.inc.c target/arm: Convert NEON VFMA, VFMS 3-reg-same insns to decodetree 2020-05-14 15:03:09 +01:00
translate-sve.c target/arm: Fix tcg_gen_gvec_dup_imm vs DUP (indexed) 2020-05-11 14:22:54 +01:00
translate-vfp.inc.c target/arm/translate-vfp.inc.c: Remove duplicate simd_r32 check 2020-05-04 12:57:56 +01:00
translate.c target/arm: Remove unused GEN_NEON_INTEGER_OP macro 2020-05-21 20:00:18 +01:00
translate.h target/arm: Vectorize SABA/UABA 2020-05-14 15:03:08 +01:00
vec_helper.c target/arm: Convert Neon VADD, VSUB, VABD 3-reg-same insns to decodetree 2020-05-14 15:03:09 +01:00
vfp_helper.c softfloat: Name compare relation enum 2020-05-19 08:41:45 -07:00
vfp-uncond.decode
vfp.decode