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

Question about mislign report in a translation #341

Closed viktoryou closed 1 month ago

viktoryou commented 1 month ago

In the process to translate an IOVA, where would the address misalign detection be placed? Should a “Read address misaligned” or "Write/AMO address misaligned" be reported right away, or after the device-context/process-context location? I could not find related behavior/decription in the model/spec.

ved-rivos commented 1 month ago

Whether misaligned accesses are allowed and the types of misalignment that are allowed is specific to the I/O protocol. The alignment checking, if required by the I/O protocol, happens in the host bridge and may be done before or after address translation and protection checks performed by the IOMMU. In priority order the misalignment checks, if required by the protocol, can happen either before the address translation in which case they are higher priority than load/store-AMO/instruction page-fault/guest-page-fault - or can happen after the address translation. See also Table 15 in Priv. spec. Response (Unsupported Request, SLVERR, etc.) to a misaligned access is also as defined by the I/O protocol.