xemu/hw
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
..
9pfs tests: virtio-9p: add FLUSH operation test 2018-02-02 11:11:55 +01:00
acpi nvdimm: add 'unarmed' option 2018-01-19 11:18:51 -02:00
adc maint: Fix macros with broken 'do/while(0); ' usage 2018-01-16 14:54:52 +01:00
alpha Merge remote-tracking branch 'origin/master' into HEAD 2018-01-11 22:03:50 +02:00
arm hw/arm: Replace fprintf(stderr, "*\n" with error_report() 2018-02-06 18:26:42 +01:00
audio hw/audio/sb16.c: change dolog() to qemu_log_mask() 2018-02-02 08:19:47 +01:00
block block: Move NVMe constants to a separate header 2018-02-08 09:22:03 +08:00
bt hw/bt: Replace fprintf(stderr, "*\n" with error_report() 2018-01-22 09:51:00 +01:00
char hw: convert the escc device to keycodemapdb 2018-01-29 09:30:25 +01:00
core * socket option parsing fix (Daniel) 2018-02-07 20:40:36 +00:00
cpu hw: use "qemu/osdep.h" as first #include in source files 2017-12-18 17:07:02 +03:00
cris cris: use generic cpu_model parsing 2017-10-27 16:03:54 +02:00
display exynos4210: workaround UBSAN compilation error 2018-02-05 18:09:45 +01:00
dma hw/dma: Replace fprintf(stderr, "*\n" with error_report() 2018-02-06 18:29:09 +01:00
gpio Replace all occurances of __FUNCTION__ with __func__ 2018-01-22 09:46:18 +01:00
hppa hw/hppa: Use qemu_log_mask instead of fprintf to stderr 2018-02-04 14:11:03 -08:00
i2c i2c: Add a CONFIG_I2C master switch to the configuration files 2018-02-05 18:09:45 +01:00
i386 qdev: use device_class_set_parent_realize/unrealize/reset() 2018-02-05 13:54:38 +01:00
ide Pull request for various patches that have been reviewed and 2018-01-23 10:15:09 +00:00
input qdev: use device_class_set_parent_realize/unrealize/reset() 2018-02-05 13:54:38 +01:00
intc target/arm: Split "get pending exception info" from "acknowledge it" 2018-02-09 10:40:27 +00:00
ipack pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices 2017-10-15 05:54:43 +03:00
ipmi ipmi: Allow BMC device properties to be set 2018-01-30 15:52:53 -06:00
isa hw/isa: Replace fprintf(stderr, "*\n" with error_report() 2018-01-22 09:51:00 +01:00
lm32 hw/lm32: Replace fprintf(stderr, "*\n" with error_report() 2018-02-06 18:29:26 +01:00
m68k m68k: mcf5208: use generic cpu_model parsing 2017-10-27 16:03:54 +02:00
mem nvdimm: add 'unarmed' option 2018-01-19 11:18:51 -02:00
microblaze xlnx-zynqmp-pmu: Connect the IPI device to the PMU 2018-01-26 11:09:09 +01:00
mips hw/mips: Replace fprintf(stderr, "*\n" with error_report() 2018-02-06 18:29:26 +01:00
misc ivshmem: Disable irqfd on device reset 2018-02-07 14:09:24 +01:00
moxie hw/moxie: Replace fprintf(stderr, "*\n" with error_report() 2018-02-06 18:29:26 +01:00
net qdev: use device_class_set_parent_realize/unrealize/reset() 2018-02-05 13:54:38 +01:00
nios2 nios2: remove duplicated includes (in code commented out) 2017-12-18 17:07:02 +03:00
nvram i2c: Add a CONFIG_I2C master switch to the configuration files 2018-02-05 18:09:45 +01:00
openrisc hw/openrisc: Replace fprintf(stderr, "*\n" with error_report() 2018-02-06 18:29:26 +01:00
pci hw/pci*: Replace fprintf(stderr, "*\n" with error_report() 2018-02-06 18:29:26 +01:00
pci-bridge qdev: use device_class_set_parent_realize/unrealize/reset() 2018-02-05 13:54:38 +01:00
pci-host hw/pci*: Replace fprintf(stderr, "*\n" with error_report() 2018-02-06 18:29:26 +01:00
pcmcia hw: Clean up includes 2016-01-29 15:07:25 +00:00
ppc Error reporting patches for 2018-02-06 2018-02-07 16:26:01 +00:00
s390x s390x: fix storage attributes migration for non-small guests 2018-01-22 11:04:52 +01:00
scsi scsi-generic: Simplify error handling code 2018-02-05 13:54:39 +01:00
sd hw/sd: Replace fprintf(stderr, "*\n" with DPRINTF() 2018-02-06 18:29:26 +01:00
sh4 pci: Rename root bus initialization functions for clarity 2017-12-05 19:13:45 +02:00
smbios Merge remote-tracking branch 'origin/master' into HEAD 2018-01-11 22:03:50 +02:00
sparc hw/sparc*: Replace fprintf(stderr, "*\n" with error_report() 2018-02-06 18:29:46 +01:00
sparc64 hw/sparc*: Replace fprintf(stderr, "*\n" with error_report() 2018-02-06 18:29:46 +01:00
ssi xilinx_spips: Correct usage of an uninitialized local variable 2018-01-25 11:45:30 +00:00
timer qdev: use device_class_set_parent_realize/unrealize/reset() 2018-02-05 13:54:38 +01:00
tpm tpm: tis: move one-line function into caller 2018-02-03 09:01:56 -05:00
tricore tricore: use generic cpu_model parsing 2017-10-27 16:04:27 +02:00
unicore32 hw/unicore32: restrict hw addr defines to source file 2017-12-18 17:07:02 +03:00
usb usb-ccid: convert CCIDCardClass::exitfn() -> unrealize() 2018-01-26 07:59:33 +01:00
vfio * socket option parsing fix (Daniel) 2018-02-07 20:40:36 +00:00
virtio memfd: add error argument, instead of perror() 2018-02-07 14:09:25 +01:00
watchdog misc: drop old i386 dependency 2017-12-18 17:07:03 +03:00
xen hw/xen*: Replace fprintf(stderr, "*\n" with error_report() 2018-02-06 18:29:46 +01:00
xenpv hw/xen*: Replace fprintf(stderr, "*\n" with error_report() 2018-02-06 18:29:46 +01:00
xtensa target/xtensa: allow different default CPU for MMU/noMMU 2018-01-22 11:54:23 -08:00
Makefile.objs 9pfs: fix dependencies 2017-08-30 18:23:25 +02:00