You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the RISC-V ISA, delegated interrupts should result in the interrupt being masked at the delegator privilege level. For example, if the Supervisor Timer Interrupt (STI) is delegated to S-mode by setting mideleg[5], STIs should not be taken when executing in M-mode. If mideleg[5] is cleared, STIs can be taken in any mode, and regardless of the current mode, control should transfer to M-mode.
However, when the STI interrupt is delegated to S-mode and the interrupt is triggered, the interrupt is not masked in M-mode as expected. It remains visible in M-mode even though it should be masked, and we can see the interrupt in the mip register.
Code for Reproducing the Bug:
intmain() {
asm volatile ("li t0, 0x20");
asm volatile ("csrs mip, t0"); // Set STI interrupt in mip
asm volatile ("csrr t0, mip"); // Read the mip register (Check mask)
asm volatile ("csrr t0, sip"); // Read the sip register (shows delegation)
}
Expected Behavior:
When the STI interrupt is delegated to S-mode, and the interrupt is triggered, it should be masked in M-mode and should not be visible in the mip register while executing in M-mode. The interrupt should be visible in the sip register when executing in S-mode.
Observed Behavior:
The STI interrupt is still visible in M-mode, even though it should be masked due to the delegation to S-mode. This violates the expected behavior as defined by the RISC-V ISA for delegated interrupts.
Is there an existing CVA6 bug for this?
Bug Description
According to the RISC-V ISA, delegated interrupts should result in the interrupt being masked at the delegator privilege level. For example, if the Supervisor Timer Interrupt (STI) is delegated to S-mode by setting mideleg[5], STIs should not be taken when executing in M-mode. If mideleg[5] is cleared, STIs can be taken in any mode, and regardless of the current mode, control should transfer to M-mode.
However, when the STI interrupt is delegated to S-mode and the interrupt is triggered, the interrupt is not masked in M-mode as expected. It remains visible in M-mode even though it should be masked, and we can see the interrupt in the mip register.
Code for Reproducing the Bug:
Expected Behavior:
When the STI interrupt is delegated to S-mode, and the interrupt is triggered, it should be masked in M-mode and should not be visible in the mip register while executing in M-mode. The interrupt should be visible in the sip register when executing in S-mode.
Observed Behavior:
The STI interrupt is still visible in M-mode, even though it should be masked due to the delegation to S-mode. This violates the expected behavior as defined by the RISC-V ISA for delegated interrupts.
CVA6 commit: 2155d0e
Build config :
cv64a6_imafdch_sv39_wb
The text was updated successfully, but these errors were encountered: