summaryrefslogtreecommitdiffstats
path: root/target/arm/cpu.h
diff options
context:
space:
mode:
authorPeter Maydell2018-11-13 11:47:59 +0100
committerPeter Maydell2018-11-13 11:47:59 +0100
commited89f078ff3d6684ce3e538e4777a3bb4ec3e2b1 (patch)
treed456f2c7e48302f544450e09e90a18c0dc55c215 /target/arm/cpu.h
parentRevert "target/arm: Implement HCR.VI and VF" (diff)
downloadqemu-ed89f078ff3d6684ce3e538e4777a3bb4ec3e2b1.tar.gz
qemu-ed89f078ff3d6684ce3e538e4777a3bb4ec3e2b1.tar.xz
qemu-ed89f078ff3d6684ce3e538e4777a3bb4ec3e2b1.zip
target/arm: Track the state of our irq lines from the GIC explicitly
Currently we track the state of the four irq lines from the GIC only via the cs->interrupt_request or KVM irq state. That means that we assume that an interrupt is asserted if and only if the external line is set. This assumption is incorrect for VIRQ and VFIQ, because the HCR_EL2.{VI,VF} bits allow assertion of VIRQ and VFIQ separately from the state of the external line. To handle this, start tracking the state of the external lines explicitly in a CPU state struct field, as is common practice for devices. The complicated part of this is dealing with inbound migration from an older QEMU which didn't have this state. We assume in that case that the older QEMU did not implement the HCR_EL2.{VI,VF} bits as generating interrupts, and so the line state matches the current state in cs->interrupt_request. (This is not quite true between commit 8a0fc3a29fc2315325400c7 and its revert, but that commit is broken and never made it into any released QEMU version.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-id: 20181109134731.11605-3-peter.maydell@linaro.org
Diffstat (limited to 'target/arm/cpu.h')
-rw-r--r--target/arm/cpu.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index 814ff69bc2..2a73fed9a0 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -538,6 +538,9 @@ typedef struct CPUARMState {
uint64_t esr;
} serror;
+ /* State of our input IRQ/FIQ/VIRQ/VFIQ lines */
+ uint32_t irq_line_state;
+
/* Thumb-2 EE state. */
uint32_t teecr;
uint32_t teehbr;