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
- [PATCH RFC v6 00/26] nova-core: Memory management infrastru... Joel Fernandes
- [PATCH RFC v6 07/26] nova-core: Add BAR1 aperture type... Joel Fernandes
- [PATCH RFC v6 19/26] nova-core: mm: Add BAR1 user inte... Joel Fernandes
- [PATCH RFC v6 08/26] nova-core: gsp: Add BAR1 PDE base... Joel Fernandes
- [PATCH RFC v6 16/26] nova-core: mm: Add page table wal... Joel Fernandes
- [PATCH RFC v6 03/26] rust: gpu: Add GPU buddy allocato... Joel Fernandes
- [PATCH RFC v6 13/26] nova-core: mm: Add unified page t... Joel Fernandes
- Re: [PATCH RFC v6 13/26] nova-core: mm: Add unifie... Zhi Wang
- Re: [PATCH RFC v6 13/26] nova-core: mm: Add un... Joel Fernandes
- [PATCH RFC v6 25/26] nova-core: mm: Use usable VRAM re... Joel Fernandes
- [PATCH RFC v6 26/26] nova-core: mm: Add BarUser to str... Joel Fernandes
- [PATCH RFC v6 21/26] nova-core: mm: Add memory managem... Joel Fernandes
- [PATCH RFC v6 15/26] nova-core: mm: Add GpuMm centrali... Joel Fernandes
- [PATCH RFC v6 12/26] nova-core: mm: Add MMU v3 page ta... Joel Fernandes
- [PATCH RFC v6 18/26] nova-core: mm: Add virtual addres... Joel Fernandes
- [PATCH RFC v6 06/26] docs: gpu: nova-core: Document th... Joel Fernandes
- [PATCH RFC v6 22/26] nova-core: mm: Add PRAMIN apertur... Joel Fernandes
- [PATCH RFC v6 23/26] nova-core: gsp: Extract usable FB... Joel Fernandes
- [PATCH RFC v6 17/26] nova-core: mm: Add Virtual Memory... Joel Fernandes
