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 pdte is misconfigured #18

Closed mhayat-10xe closed 2 months ago

mhayat-10xe commented 2 months ago

The Specs state that:

If any bits or encoding that are reserved for future standard use are set within pdte, stop and report "PDT entry misconfigured" (cause = 267).

However, when pdte.reserved bits are set high, it gives "DDT_ENTRY_MISCONFIGURED(cause = 259)" instead of "PDT_ENTRY_MISCONFIGURED(cause = 259)" which is wrong.

Here is the counter-example where we 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.reserved bits are set high, and in the next cycle, cause_code == 259(DDT_ENTRY_MISCONFIGURED), which is wrong. image

malejo97 commented 2 months ago

Fixed in PR #23