On 18.11.2025 09:56, Oleksii Kurochko wrote: > On 11/13/25 5:32 PM, Jan Beulich wrote: >> On 13.11.2025 17:18, Oleksii Kurochko wrote: >>> Also, I’d like to note that it probably doesn’t make much sense to record >>> all >>> supported modes. If we traverse the|modes[]| array in the opposite >>> order—checking >>> |Sv57| first—then, according to the RISC-V specification: >>> - Implementations that support Sv57 must also support Sv48. >>> - Implementations that support Sv48 must also support Sv39. >>> So if Sv57 is supported then lower modes are supported too. (except Sv32 >>> for RV32) >>> >>> Based on this, it seems reasonable to start checking from Sv57, right? >> No. Bigger guests want running in 48x4, huge ones in 57x4 (each: if >> available), >> and most ones in 39x4. It doesn't matter what direction you do the checks, >> you >> want to know what you have available. > > My point was that if we change the direction, then once we find the first > (largest) > supported MMU mode, there is no need to check the others (lower modes) as > according > to the RISC-V specification, the lower modes must be supported automatically.
Oh, I see, makes sense. Jan
