Thread (71 messages) 71 messages, 8 authors, 2026-02-06

Re: [PATCH RFC v6 13/26] nova-core: mm: Add unified page table entry wrapper enums

From: Joel Fernandes <joelagnelf@nvidia.com>
Date: 2026-01-21 18:35:17
Also in: amd-gfx, dri-devel, intel-gfx, intel-xe, linux-doc, lkml, nouveau, rust-for-linux


On 1/21/2026 4:54 AM, Zhi Wang wrote:
On Tue, 20 Jan 2026 15:42:50 -0500
Joel Fernandes [off-list ref] wrote:
quoted
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
quoted
+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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help