Commit daac4c23 authored by Andrea Arcangeli's avatar Andrea Arcangeli

userfaultfd: add userfaultfd_wp mm helpers

These helpers will be used to know if to call handle_userfault() during
wrprotect faults in order to deliver the wrprotect faults to userland.
parent 093b3515
...@@ -65,6 +65,11 @@ static inline bool userfaultfd_missing(struct vm_area_struct *vma) ...@@ -65,6 +65,11 @@ static inline bool userfaultfd_missing(struct vm_area_struct *vma)
return vma->vm_flags & VM_UFFD_MISSING; return vma->vm_flags & VM_UFFD_MISSING;
} }
static inline bool userfaultfd_wp(struct vm_area_struct *vma)
{
return vma->vm_flags & VM_UFFD_WP;
}
static inline bool userfaultfd_armed(struct vm_area_struct *vma) static inline bool userfaultfd_armed(struct vm_area_struct *vma)
{ {
return vma->vm_flags & (VM_UFFD_MISSING | VM_UFFD_WP); return vma->vm_flags & (VM_UFFD_MISSING | VM_UFFD_WP);
...@@ -92,6 +97,11 @@ static inline bool userfaultfd_missing(struct vm_area_struct *vma) ...@@ -92,6 +97,11 @@ static inline bool userfaultfd_missing(struct vm_area_struct *vma)
return false; return false;
} }
static inline bool userfaultfd_wp(struct vm_area_struct *vma)
{
return false;
}
static inline bool userfaultfd_armed(struct vm_area_struct *vma) static inline bool userfaultfd_armed(struct vm_area_struct *vma)
{ {
return false; return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment