[PATCH 6/9] mm: convert PTE table entry to pte

Muhammad Usama Anjum <[email protected]> Thu, 6 Aug 2026 09:38:44 +0100
Newsgroups gmane.comp.freedesktop.xorg.drivers.intel,gmane.linux.kernel,gmane.comp.video.dri.devel,gmane.linux.ports.parisc,gmane.comp.emulators.xen.devel,gmane.linux.kernel.mm,gmane.linux.file-systems,gmane.linux.kernel.cross-arch,gmane.linux.kernel.bpf,gmane.linux.kernel.perf.user
Message-ID <[email protected]>
The non-MMU stub receives hw_pte_t but returns a logical pte_t
value. Convert the stored entry through __pte_from_hw() before
returning.

Signed-off-by: Muhammad Usama Anjum <[email protected]>
---
 include/linux/hugetlb.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index bc0b9c65aa1d0..9e8b391aa4bc9 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -1283,7 +1283,7 @@ static inline pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
 #ifdef CONFIG_MMU
 	return ptep_get(ptep);
 #else
-	return *ptep;
+	return __pte_from_hw(*ptep);
 #endif
 }
 
-- 
2.47.3