aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdgar E. Iglesias <edgar.iglesias@xilinx.com>2020-12-14 23:21:54 +0100
committerPeter Maydell <peter.maydell@linaro.org>2021-01-08 15:13:37 +0000
commit4663b72a48fd540cbe16053b01d6839a95656440 (patch)
treefc5c15341e89f58213ec534ef452c56563c56d41
parente79de63ab1bd1f6550e7b915e433bec1ad1a870a (diff)
downloadqemu-4663b72a48fd540cbe16053b01d6839a95656440.zip
qemu-4663b72a48fd540cbe16053b01d6839a95656440.tar.gz
qemu-4663b72a48fd540cbe16053b01d6839a95656440.tar.bz2
intc/arm_gic: Fix gic_irq_signaling_enabled() for vCPUs
Correct the indexing into s->cpu_ctlr for vCPUs. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Luc Michel <luc.michel@greensocs.com> Message-id: 20201214222154.3480243-2-edgar.iglesias@gmail.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--hw/intc/arm_gic.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c
index c60dc6b..af41e2f 100644
--- a/hw/intc/arm_gic.c
+++ b/hw/intc/arm_gic.c
@@ -141,6 +141,8 @@ static inline void gic_get_best_virq(GICState *s, int cpu,
static inline bool gic_irq_signaling_enabled(GICState *s, int cpu, bool virt,
int group_mask)
{
+ int cpu_iface = virt ? (cpu + GIC_NCPU) : cpu;
+
if (!virt && !(s->ctlr & group_mask)) {
return false;
}
@@ -149,7 +151,7 @@ static inline bool gic_irq_signaling_enabled(GICState *s, int cpu, bool virt,
return false;
}
- if (!(s->cpu_ctlr[cpu] & group_mask)) {
+ if (!(s->cpu_ctlr[cpu_iface] & group_mask)) {
return false;
}