On 1/21/2026 4:54 AM, Zhi Wang wrote:
> On Tue, 20 Jan 2026 15:42:50 -0500
> Joel Fernandes <[email protected]> wrote:
>> Add unified Pte, Pde, and DualPde wrapper enums that abstract over
>> MMU v2 and v3 page table entry formats. These enums allow the page
>> table walker and VMM to work with both MMU versions.
>>
> 
> snip
> 
>> +impl DualPde {
>> +    /// Create a [`DualPde`] from raw 128-bit value (two `u64`s) for
>> the given MMU version.
>> +    pub(crate) fn new(version: MmuVersion, big: u64, small: u64) ->
>> Self {
>> +        match version {
>> +            MmuVersion::V2 => Self::V2(ver2::DualPde::new(big, small)),
>> +            MmuVersion::V3 => Self::V3(ver3::DualPde::new(big, small)),
>> +        }
>> +    }
>> +
>> +    /// Create a [`DualPde`] with only the small page table pointer set.
>> +    pub(crate) fn new_small(version: MmuVersion, table_pfn: Pfn) ->
>> Self {
>> +        match version {
>> +            MmuVersion::V2 =>
>> Self::V2(ver2::DualPde::new_small(table_pfn)),
>> +            MmuVersion::V3 =>
>> Self::V3(ver3::DualPde::new_small(table_pfn)),
>> +        }
>> +    }
>> +
>> +    /// Check if the small page table pointer is valid.
>> +    pub(crate) fn has_small(&self) -> bool {
>> +        match self {
>> +            Self::V2(d) => d.has_small(),
>> +            Self::V3(d) => d.has_small(),
>> +        }
>> +    }
>> +
> 
> Should we also have a has_big here as well?
Good catch, I will add that in, thanks.

--
Joel Fernandes

Reply via email to