qemu/target/arm
Peter Maydell 6c94851881 target/arm: Split "get pending exception info" from "acknowledge it"
Currently armv7m_nvic_acknowledge_irq() does three things:
 * make the current highest priority pending interrupt active
 * return a bool indicating whether that interrupt is targeting
   Secure or NonSecure state
 * implicitly tell the caller which is the highest priority
   pending interrupt by setting env->v7m.exception

We need to split these jobs, because v7m_exception_taken()
needs to know whether the pending interrupt targets Secure so
it can choose to stack callee-saves registers or not, but it
must not make the interrupt active until after it has done
that stacking, in case the stacking causes a derived exception.
Similarly, it needs to know the number of the pending interrupt
so it can read the correct vector table entry before the
interrupt is made active, because vector table reads might
also cause a derived exception.

Create a new armv7m_nvic_get_pending_irq_info() function which simply
returns information about the highest priority pending interrupt, and
use it to rearrange the v7m_exception_taken() code so we don't
acknowledge the exception until we've done all the things which could
possibly cause a derived exception.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 1517324542-6607-3-git-send-email-peter.maydell@linaro.org
2018-02-09 10:40:27 +00:00
..
arch_dump.c target/arm: Add aa{32, 64}_vfp_{dreg, qreg} helpers 2018-01-25 11:45:29 +00:00
arm_ldst.h Fix Thumb-1 BE32 execution and disassembly. 2017-02-07 18:29:59 +00:00
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 Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
cpu64.c target-arm: Enable EL2 feature bit on A53 and A57 2017-01-20 11:15:10 +00:00
cpu-qom.h Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
cpu.c qdev: use device_class_set_parent_realize/unrealize/reset() 2018-02-05 13:54:38 +01:00
cpu.h target/arm: Split "get pending exception info" from "acknowledge it" 2018-02-09 10:40:27 +00:00
crypto_helper.c target/arm: Use pointers in crypto helpers 2018-01-25 11:45:28 +00:00
gdbstub64.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
gdbstub.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
helper-a64.c target/arm: Add aa{32, 64}_vfp_{dreg, qreg} helpers 2018-01-25 11:45:29 +00:00
helper-a64.h target/arm: check CF_PARALLEL instead of parallel_cpus 2017-10-24 13:53:41 -07:00
helper.c target/arm: Split "get pending exception info" from "acknowledge it" 2018-02-09 10:40:27 +00:00
helper.h target/arm: Use pointers in neon tbl helper 2018-01-25 11:45:28 +00:00
internals.h target/arm: Handle page table walk load failures correctly 2018-01-16 13:28:11 +00:00
iwmmxt_helper.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
kvm32.c target/arm: Add aa{32, 64}_vfp_{dreg, qreg} helpers 2018-01-25 11:45:29 +00:00
kvm64.c target/arm: Add aa{32, 64}_vfp_{dreg, qreg} helpers 2018-01-25 11:45:29 +00:00
kvm_arm.h target/arm/kvm: pmu: improve error handling 2017-09-04 15:21:54 +01:00
kvm-consts.h arm: add trailing ; after MISMATCH_CHECK 2017-02-01 03:37:18 +02:00
kvm-stub.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
kvm.c arm: postpone device listener unregister 2018-02-07 14:09:24 +01:00
machine.c target/arm: Change the type of vfp.regs 2018-01-25 11:45:28 +00:00
Makefile.objs Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
monitor.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
neon_helper.c target/arm: Use pointers in neon zip/uzp helpers 2018-01-25 11:45:28 +00:00
op_addsub.h Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
op_helper.c -----BEGIN PGP SIGNATURE----- 2018-01-26 10:08:53 +00:00
psci.c fix WFI/WFE length in syndrome register 2017-10-31 11:50:50 +00:00
trace-events trace-events: fix code style: print 0x before hex numbers 2017-08-01 12:13:07 +01:00
translate-a64.c target/arm: Use vector infrastructure for aa64 orr/bic immediate 2018-02-08 15:54:08 +00:00
translate.c target/arm: Add aa{32, 64}_vfp_{dreg, qreg} helpers 2018-01-25 11:45:29 +00:00
translate.h target/arm: Mark disas_set_insn_syndrome inline 2018-01-25 11:45:28 +00:00