File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -2037,7 +2037,7 @@ static void __split_huge_zero_page_pmd(struct vm_area_struct *vma,
2037
2037
{
2038
2038
struct mm_struct * mm = vma -> vm_mm ;
2039
2039
pgtable_t pgtable ;
2040
- pmd_t _pmd ;
2040
+ pmd_t _pmd , old_pmd ;
2041
2041
int i ;
2042
2042
2043
2043
/*
@@ -2048,7 +2048,7 @@ static void __split_huge_zero_page_pmd(struct vm_area_struct *vma,
2048
2048
*
2049
2049
* See Documentation/mm/mmu_notifier.rst
2050
2050
*/
2051
- pmdp_huge_clear_flush (vma , haddr , pmd );
2051
+ old_pmd = pmdp_huge_clear_flush (vma , haddr , pmd );
2052
2052
2053
2053
pgtable = pgtable_trans_huge_withdraw (mm , pmd );
2054
2054
pmd_populate (mm , & _pmd , pgtable );
@@ -2057,6 +2057,8 @@ static void __split_huge_zero_page_pmd(struct vm_area_struct *vma,
2057
2057
pte_t * pte , entry ;
2058
2058
entry = pfn_pte (my_zero_pfn (haddr ), vma -> vm_page_prot );
2059
2059
entry = pte_mkspecial (entry );
2060
+ if (pmd_uffd_wp (old_pmd ))
2061
+ entry = pte_mkuffd_wp (entry );
2060
2062
pte = pte_offset_map (& _pmd , haddr );
2061
2063
VM_BUG_ON (!pte_none (* pte ));
2062
2064
set_pte_at (mm , haddr , pte , entry );
You can’t perform that action at this time.
0 commit comments