riscv-non-isa/riscv-iommu

Question about gpasize in iotval2 when s1 bare and gpa over 56bit

Orion3-e opened this issue · 5 comments

According to the spec
Snipaste_2024-07-25_11-41-46
seems the iotval2 should save the whole gpa high part value [63:2], even the gpa is over maxgpa ,
but in the c model , seems gpa dont save the value above 56bit when S1 bare (va=gpa), depending on page_sz .
image
image
so , should the iotval2 save the upper_bits in this situation? thanks

Do you have a test input that you can add to show what you mean? What was your input va and what do you see saved in iotval2 for that input?

image
this is the req we send : iova = fffffff54d1ee2bc
image
this is the result covert from the rivos model
image
this is the two stage function handles gpa for this req , the page_sz screenshoted in my last comment shows it is not 64 , causing the gpa high part [63:57] discarded
in this situation , dc.pdtv=1 && vsatp mode=bare so s1 bare va =gpa , so i think the iotval2 should save fffffff54d1ee2bc ,not the fffff54d1ee2bc in the temp fault q result rivos , seems bit [63:57] of iotval2 is discarded by two stage translation. Thanks

The issue is that the pte->PPN is 44 bit wide. I have fixed this in #390
Please also send me a direct message.

Now the iotval2 check of that req pass, thanks

I have different opinion of the saved iotval/iotval2, probably you guys should take a look over it:
#391