Skip to content

Commit

Permalink
hw/intc: Update APLIC IDC after claiming iforce register
Browse files Browse the repository at this point in the history
Currently, QEMU only sets the iforce register to 0 and returns early
when claiming the iforce register. However, this may leave mip.meip
remains at 1 if a spurious external interrupt triggered by iforce
register is the only pending interrupt to be claimed, and the interrupt
cannot be lowered as expected.

This commit fixes this issue by calling riscv_aplic_idc_update() to
update the IDC status after the iforce register is claimed.

Signed-off-by: Frank Chang <frank.chang@sifive.com>
Reviewed-by: Jim Shu <jim.shu@sifive.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20240321104951.12104-1-frank.chang@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
  • Loading branch information
Frank Chang authored and alistair23 committed Mar 22, 2024
1 parent 0a11629 commit 078189b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions hw/intc/riscv_aplic.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ static uint32_t riscv_aplic_idc_claimi(RISCVAPLICState *aplic, uint32_t idc)

if (!topi) {
aplic->iforce[idc] = 0;
riscv_aplic_idc_update(aplic, idc);
return 0;
}

Expand Down

0 comments on commit 078189b

Please sign in to comment.