riscv-non-isa / riscv-iommu

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

Is there one missing condition for read permission about NW flag? #326

Closed baimengwei closed 1 month ago

baimengwei commented 1 month ago

https://github.com/riscv-non-isa/riscv-iommu/blob/main/iommu_ref_model/test/tbapi.c#L70

*read = ( req->tr.read_writeAMO == READ ) ? 1 : 0;

https://github.com/riscv-non-isa/riscv-iommu/blob/main/iommu_registers.adoc#translation-request-control-tr_req_ctl NW | WARL | If set to 1, read permission is requested. If set to 0, both read and write permissions are requested.

ved-rivos commented 1 month ago

RISC-V does not provide write-only or write-execute PTEs. When write permission is requested, read permission is always required. See checks here, here, here, and here.