File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -6640,26 +6640,33 @@ static unsigned long page_table_shareable(struct vm_area_struct *svma,
6640
6640
return saddr ;
6641
6641
}
6642
6642
6643
- static bool vma_shareable (struct vm_area_struct * vma , unsigned long addr )
6643
+ static bool __vma_aligned_range_pmd_shareable (struct vm_area_struct * vma ,
6644
+ unsigned long start , unsigned long end )
6644
6645
{
6645
- unsigned long base = addr & PUD_MASK ;
6646
- unsigned long end = base + PUD_SIZE ;
6647
-
6648
6646
/*
6649
6647
* check on proper vm_flags and page table alignment
6650
6648
*/
6651
- if (vma -> vm_flags & VM_MAYSHARE && range_in_vma (vma , base , end ))
6649
+ if (vma -> vm_flags & VM_MAYSHARE && range_in_vma (vma , start , end ))
6652
6650
return true;
6653
6651
return false;
6654
6652
}
6655
6653
6654
+ static bool vma_addr_pmd_shareable (struct vm_area_struct * vma ,
6655
+ unsigned long addr )
6656
+ {
6657
+ unsigned long start = addr & PUD_MASK ;
6658
+ unsigned long end = start + PUD_SIZE ;
6659
+
6660
+ return __vma_aligned_range_pmd_shareable (vma , start , end );
6661
+ }
6662
+
6656
6663
bool want_pmd_share (struct vm_area_struct * vma , unsigned long addr )
6657
6664
{
6658
6665
#ifdef CONFIG_USERFAULTFD
6659
6666
if (uffd_disable_huge_pmd_share (vma ))
6660
6667
return false;
6661
6668
#endif
6662
- return vma_shareable (vma , addr );
6669
+ return vma_addr_pmd_shareable (vma , addr );
6663
6670
}
6664
6671
6665
6672
/*
You can’t perform that action at this time.
0 commit comments