riscv-non-isa / riscv-iommu

RISC-V IOMMU Specification
https://jira.riscv.org/browse/RVG-55
Creative Commons Attribution 4.0 International
72 stars 14 forks source link

what should interrupt do when records in fault queue ? #366

Closed baimengwei closed 1 week ago

baimengwei commented 1 week ago

let wire interrupt as an example. When two faults occur in fault queue in time series, and the first fault record is stored in fault queue, the interrupt is assert, then the software detect the interrupt and start to deal with the fault record and deassert the fip. However, at the same time, the next fault record is arrive and stored in fault queue but software not detect it and the interrupt is deassert, software lost a attention which the next fault record is stored in fault queue?

is the software do right ? or the interrupt stay assert when records in fault queue rather than this is a new record ?

the same condition for fqmf , fqof or other queues interrupt handle.

ved-rivos commented 1 week ago

The guidelines for handling interrupts are provided in section 6.5 of the specification. The sequence to follow is to first clear fip and then read the the fqt/fqh to process the fault records. In your example, if this sequence is followed then the fqt and fqh will be 1 record apart leading to software processing one fault record. A second fault record if produced after clearing of fip will cause fip to be set again but software may not observe it. This is however okay as when the interrupt service routine completes there is another interrupt pending and the ISR will be invoked again to handle the second interrupt. The same rule applies to other interrupt sources i.e. first clear the interrupt-pending so that any new interrupts that occur will cause another interrupt and then service the causes of the interrupt.

then the software detect the interrupt and start to deal with the fault record and deassert the fip.

This sequence should be reversed. It should be "deassert the fip and then start todeal with the fault record"

baimengwei commented 1 week ago

Thanks.