qemu-e2k/hw/intc
Peter Maydell 382c7160d1 hw/intc/arm_gicv3_cpuif: Fix EOIR write access check logic
In icc_eoir_write() we assume that we can identify the group of the
IRQ being completed based purely on which register is being written
to and the current CPU state, and that "CPU state matches group
indicated by register" is the only necessary access check.

This isn't correct: if the CPU is not in Secure state then EOIR1 will
only complete Group 1 NS IRQs, but if the CPU is in EL3 it can
complete both Group 1 S and Group 1 NS IRQs.  (The pseudocode
ICC_EOIR1_EL1 makes this clear.) We were also missing the logic to
prevent EOIR0 writes completing G0 IRQs when they should not.

Rearrange the logic to first identify the group of the current
highest priority interrupt and then look at whether we should
complete it or ignore the access based on which register was accessed
and the state of the CPU.  The resulting behavioural change is:
 * EL3 can now complete G1NS interrupts
 * G0 interrupt completion is now ignored if the GIC
   and the CPU have the security extension enabled and
   the CPU is not secure

Reported-by: Chan Kim <ckim@etri.re.kr>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20210510150016.24910-1-peter.maydell@linaro.org
2021-05-25 16:01:43 +01:00
..
Kconfig m68k: add an interrupt controller 2021-03-15 21:02:20 +01:00
allwinner-a10-pic.c
apic.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
apic_common.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
arm_gic.c
arm_gic_common.c
arm_gic_kvm.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
arm_gicv2m.c
arm_gicv3.c hw: Do not include hw/sysbus.h if it is not necessary 2021-05-02 17:24:50 +02:00
arm_gicv3_common.c
arm_gicv3_cpuif.c hw/intc/arm_gicv3_cpuif: Fix EOIR write access check logic 2021-05-25 16:01:43 +01:00
arm_gicv3_dist.c
arm_gicv3_its_common.c
arm_gicv3_its_kvm.c sysemu: Let VMChangeStateHandler take boolean 'running' argument 2021-03-09 23:13:57 +01:00
arm_gicv3_kvm.c hw: Do not include hw/sysbus.h if it is not necessary 2021-05-02 17:24:50 +02:00
arm_gicv3_redist.c
armv7m_nvic.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
aspeed_vic.c
bcm2835_ic.c
bcm2836_control.c
etraxfs_pic.c hw: Replace anti-social QOM type names 2021-03-19 15:18:43 +01:00
exynos4210_combiner.c
exynos4210_gic.c
gic_internal.h
gicv3_internal.h
goldfish_pic.c hw/intc: add goldfish-pic 2021-03-15 21:02:14 +01:00
grlib_irqmp.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
heathrow_pic.c
i8259.c hw/intc/i8259: Refactor pic_read_irq() to avoid uninitialized variable 2021-03-19 08:48:18 -04:00
i8259_common.c
ibex_plic.c hw/opentitan: Update the interrupt layout 2021-05-11 20:02:06 +10:00
imx_avic.c
imx_gpcv2.c hw: Do not include qemu/log.h if it is not necessary 2021-05-02 17:24:50 +02:00
intc.c
ioapic.c
ioapic_common.c
loongson_liointc.c
m68k_irqc.c m68k: add an interrupt controller 2021-03-15 21:02:20 +01:00
meson.build Drop the deprecated unicore32 target 2021-05-12 18:20:52 +02:00
mips_gic.c
omap_intc.c
ompic.c hw: Do not include qemu/log.h if it is not necessary 2021-05-02 17:24:50 +02:00
openpic.c hw: Do not include qemu/log.h if it is not necessary 2021-05-02 17:24:50 +02:00
openpic_kvm.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
pl190.c
pnv_xive.c
pnv_xive_regs.h
ppc-uic.c
realview_gic.c
rx_icu.c
s390_flic.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
s390_flic_kvm.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
sh_intc.c
sifive_clint.c
sifive_plic.c Do not include hw/boards.h if it's not really necessary 2021-05-02 17:24:51 +02:00
slavio_intctl.c
spapr_xive.c hw/intc/spapr_xive: Use device_cold_reset() instead of device_legacy_reset() 2021-05-04 13:12:59 +10:00
spapr_xive_kvm.c sysemu: Let VMChangeStateHandler take boolean 'running' argument 2021-03-09 23:13:57 +01:00
trace-events Drop the deprecated lm32 target 2021-05-12 18:20:25 +02:00
trace.h
vgic_common.h
xics.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
xics_kvm.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
xics_pnv.c
xics_spapr.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
xilinx_intc.c
xive.c
xlnx-pmu-iomod-intc.c
xlnx-zynqmp-ipi.c