uint64_t translate_gpa (iohgatp_t iohgatp, uint64_t gpa, uint64_t *spa)
This function is used to translate a gpa to a spa. The function also returns the G-stage pte that provides the translation
However, when the gpte is not invalid, this function will return address 1 as a gpte address, which seems confusing? For me, this function seems to return the error code if the address is negative?
https://github.com/riscv-non-isa/riscv-iommu/blob/42c778f6240618d2931d9aff20e8512f97413399/iommu_ref_model/libtables/src/translate_gpa.c#L57C40-L57C40
However, when the gpte is not invalid, this function will return address 1 as a gpte address, which seems confusing? For me, this function seems to return the error code if the address is negative?