riscv-non-isa / riscv-iommu

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

Question about page request fault report related to iommu_mode in model #300

Closed viktoryou closed 3 months ago

viktoryou commented 3 months ago

From the handle_page_request in libiommu/src/iommu_ats.c, when ddtp.iommu_mode is OFF or Bare, the response code is missing here. According to the spec, Response Failure response should be added when ddtp.iommu_mode is OFF and Invalid Request response should be added when ddtp.iommu_mode is Bare.

Additionally, in such case, is fault report still needed? From the spec, such case is not listed in the conditions described in Chapter 2.7.

If fault report is needed, similar with Chapter 2.3, would the cause be like (1) ddtp.iommu_mode is OFF -> cause 256, (2) ddtp.iommu_mode is Bare -> cause 260 ?

Please help to check.

ved-rivos commented 3 months ago

The missing check in handle_page_request is added by PR #301 . The section 2.7 notes the 3 cases where faults are not logged - for all other cases the faults are logged. Added the cause code to the list in https://github.com/riscv-non-isa/riscv-iommu/pull/243/commits/2f57efc7a715130487e1feeee8df99abe3cb1a2d