[PATCH v8 05/15] mm: convert PTE table entry to pte

From: Alexander Gordeev

Date: Wed Oct 07 2026 - 08:40:39 EST


From: Muhammad Usama Anjum <usama.anjum@xxxxxxx>

The non-MMU stub receives hw_pte_t but returns a software PTE value. It
has no attached PTE that requires ptep_get(), so convert only the stored
entry through __pte_from_hw().

Signed-off-by: Muhammad Usama Anjum <usama.anjum@xxxxxxx>
---
include/linux/hugetlb.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index bc0b9c65aa1d..be31fcf93654 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -1283,7 +1283,8 @@ static inline pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
#ifdef CONFIG_MMU
return ptep_get(ptep);
#else
- return *ptep;
+ /* No attached PTE that requires ptep_get(). */
+ return __pte_from_hw(*ptep);
#endif
}

--
2.53.0