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 InclPC == 1 and process directory entry is not valid #17

Closed mhayat-10xe closed 2 months ago

mhayat-10xe commented 2 months ago

The Specs state that:

If pdte.V == 0, stop and report "PDT entry not valid" (cause = 266).

However, when pdte.V == 0, it is giving "DDT_ENTRY_MISCONFIGURED(cause = 259)" which is wrong.

Here is the counter-example where you can see that in the 10th cycle when pdt_walk is high, and in the 11th cycle when the process directory entry is accessed, pdte.v == 0, and in the next cycle, cause_code == 259, which is wrong. image

malejo97 commented 2 months ago

Fixed by PR #23