zero-day-labs / riscv-iommu

IOMMU IP compliant with the RISC-V IOMMU Specification v1.0
Apache License 2.0
66 stars 12 forks source link

Wrong cause_code if pte.a == 0 and dc.iohgatp.mode == 0 #28

Open mhayat-10xe opened 1 month ago

mhayat-10xe commented 1 month ago

I wrote an assertion that states:

if dc.iohgatp.mode == 0, pte.v== 1, pte.r or pte.x is equal to 1 andpte.a == 0 then in the next cycle cause_code must be equal to load_page_fault or store_page_fault(cause_code == 13/15).

Here is the counter-example of the violation of the assertion, in the 11th cycle, when iohgatp.mode == 0, pte.v ==1, pte.r ==1 and pte.a == 0 then in the next cycle cause_code must be load or store page fault but it is giving load_guest_page_fault (cause_code == 21) which is wrong.

image