9d5a9ae962
In the M-profile Arm ARM, rule R_CVJS defines when an interrupt should be set to the Pending state: A) when the input line is high and the interrupt is not Active B) when the input line transitions from low to high and the interrupt is Active (Note that the first of these is an ongoing condition, and the second is a point-in-time event.) This can be rephrased as: 1 when the line goes from low to high, set Pending 2 when Active goes from 1 to 0, if line is high then set Pending 3 ignore attempts to clear Pending when the line is high and Active is 0 where 1 covers both B and one of the "transition into condition A" cases, 2 deals with the other "transition into condition A" possibility, and 3 is "don't drop Pending if we're already in condition A". Transitions out of condition A don't affect Pending state. We handle case 1 in set_irq_level(). For an interrupt (as opposed to other kinds of exception) the only place where we clear Active is in armv7m_nvic_complete_irq(), where we handle case 2 by checking for whether we need to re-pend the exception. For case 3, the only places where we clear Pending state on an interrupt are in armv7m_nvic_acknowledge_irq() (where we are setting Active so it doesn't count) and for writes to NVIC_ICPRn. It is the "write to NVIC_ICPRn" case that we missed: we must ignore this if the input line is high and the interrupt is not Active. (This required behaviour is differently and perhaps more clearly stated in the v7M Arm ARM, which has pseudocode in section B3.4.1 that implies it.) Reported-by: Igor Kotrasiński <i.kotrasinsk@samsung.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20220628154724.3297442-1-peter.maydell@linaro.org |
||
---|---|---|
.. | ||
allwinner-a10-pic.c | ||
apic_common.c | ||
apic.c | ||
arm_gic_common.c | ||
arm_gic_kvm.c | ||
arm_gic.c | ||
arm_gicv2m.c | ||
arm_gicv3_common.c | ||
arm_gicv3_cpuif_common.c | ||
arm_gicv3_cpuif.c | ||
arm_gicv3_dist.c | ||
arm_gicv3_its_common.c | ||
arm_gicv3_its_kvm.c | ||
arm_gicv3_its.c | ||
arm_gicv3_kvm.c | ||
arm_gicv3_redist.c | ||
arm_gicv3.c | ||
armv7m_nvic.c | ||
aspeed_vic.c | ||
bcm2835_ic.c | ||
bcm2836_control.c | ||
etraxfs_pic.c | ||
exynos4210_combiner.c | ||
exynos4210_gic.c | ||
gic_internal.h | ||
gicv3_internal.h | ||
goldfish_pic.c | ||
grlib_irqmp.c | ||
heathrow_pic.c | ||
i8259_common.c | ||
i8259.c | ||
imx_avic.c | ||
imx_gpcv2.c | ||
intc.c | ||
ioapic_common.c | ||
ioapic.c | ||
Kconfig | ||
loongarch_extioi.c | ||
loongarch_ipi.c | ||
loongarch_pch_msi.c | ||
loongarch_pch_pic.c | ||
loongson_liointc.c | ||
m68k_irqc.c | ||
meson.build | ||
mips_gic.c | ||
nios2_vic.c | ||
omap_intc.c | ||
ompic.c | ||
openpic_kvm.c | ||
openpic.c | ||
pl190.c | ||
pnv_xive2_regs.h | ||
pnv_xive2.c | ||
pnv_xive_regs.h | ||
pnv_xive.c | ||
ppc-uic.c | ||
realview_gic.c | ||
riscv_aclint.c | ||
riscv_aplic.c | ||
riscv_imsic.c | ||
rx_icu.c | ||
s390_flic_kvm.c | ||
s390_flic.c | ||
sh_intc.c | ||
sifive_plic.c | ||
slavio_intctl.c | ||
spapr_xive_kvm.c | ||
spapr_xive.c | ||
trace-events | ||
trace.h | ||
vgic_common.h | ||
xics_kvm.c | ||
xics_pnv.c | ||
xics_spapr.c | ||
xics.c | ||
xilinx_intc.c | ||
xive2.c | ||
xive.c | ||
xlnx-pmu-iomod-intc.c | ||
xlnx-zynqmp-ipi.c |