Closed baimengwei closed 7 months ago
why need to add masked_upper_bits != mask ?
Virtual addresses are always 64-bit wide or 32-bit wide. The range of valid 64-bit virtual addresses however depends on the virtual memory system mode. The rules to determine the validity of a virtual address are as follows :
If a iova is ffff_ffff_ffff_ffff,which exceed the sv39/sv48/sv57 translate mode size, Is this iova is legal ?
The address 0xFFFF_FFFF_FFFF_FFFF is all of these modes. The valid address ranges are as follows:
This effectively partitions the virtual memory space into two halves with a range of invalid addresses in the middle. This also ensures that all addresses that were valid in Sv39 are also valid in Sv48/Sv57, and all valid addresses of Sv48 are also valid in Sv57.
Thanks.
https://github.com/riscv-non-isa/riscv-iommu/blob/main/iommu_ref_model/libiommu/src/iommu_two_stage_trans.c#L103
why need to add
masked_upper_bits != mask
? If a iova is ffff_ffff_ffff_ffff,which exceed the sv39/sv48/sv57 translate mode size, Is this iova is legal ?Thanks.