diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/userfaultfd_k.h | 13 | ||||
| -rw-r--r-- | include/uapi/linux/userfaultfd.h | 15 |
2 files changed, 18 insertions, 10 deletions
diff --git a/include/linux/userfaultfd_k.h b/include/linux/userfaultfd_k.h index 11b92b047a1e..79002bca1f43 100644 --- a/include/linux/userfaultfd_k.h +++ b/include/linux/userfaultfd_k.h | |||
| @@ -52,6 +52,9 @@ static inline bool userfaultfd_armed(struct vm_area_struct *vma) | |||
| 52 | return vma->vm_flags & (VM_UFFD_MISSING | VM_UFFD_WP); | 52 | return vma->vm_flags & (VM_UFFD_MISSING | VM_UFFD_WP); |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | extern int dup_userfaultfd(struct vm_area_struct *, struct list_head *); | ||
| 56 | extern void dup_userfaultfd_complete(struct list_head *); | ||
| 57 | |||
| 55 | #else /* CONFIG_USERFAULTFD */ | 58 | #else /* CONFIG_USERFAULTFD */ |
| 56 | 59 | ||
| 57 | /* mm helpers */ | 60 | /* mm helpers */ |
| @@ -76,6 +79,16 @@ static inline bool userfaultfd_armed(struct vm_area_struct *vma) | |||
| 76 | return false; | 79 | return false; |
| 77 | } | 80 | } |
| 78 | 81 | ||
| 82 | static inline int dup_userfaultfd(struct vm_area_struct *vma, | ||
| 83 | struct list_head *l) | ||
| 84 | { | ||
| 85 | return 0; | ||
| 86 | } | ||
| 87 | |||
| 88 | static inline void dup_userfaultfd_complete(struct list_head *l) | ||
| 89 | { | ||
| 90 | } | ||
| 91 | |||
| 79 | #endif /* CONFIG_USERFAULTFD */ | 92 | #endif /* CONFIG_USERFAULTFD */ |
| 80 | 93 | ||
| 81 | #endif /* _LINUX_USERFAULTFD_K_H */ | 94 | #endif /* _LINUX_USERFAULTFD_K_H */ |
diff --git a/include/uapi/linux/userfaultfd.h b/include/uapi/linux/userfaultfd.h index 94046b8aa6ad..c8953c84fdcc 100644 --- a/include/uapi/linux/userfaultfd.h +++ b/include/uapi/linux/userfaultfd.h | |||
| @@ -18,12 +18,7 @@ | |||
| 18 | * means the userland is reading). | 18 | * means the userland is reading). |
| 19 | */ | 19 | */ |
| 20 | #define UFFD_API ((__u64)0xAA) | 20 | #define UFFD_API ((__u64)0xAA) |
| 21 | /* | 21 | #define UFFD_API_FEATURES (UFFD_FEATURE_EVENT_FORK) |
| 22 | * After implementing the respective features it will become: | ||
| 23 | * #define UFFD_API_FEATURES (UFFD_FEATURE_PAGEFAULT_FLAG_WP | \ | ||
| 24 | * UFFD_FEATURE_EVENT_FORK) | ||
| 25 | */ | ||
| 26 | #define UFFD_API_FEATURES (0) | ||
| 27 | #define UFFD_API_IOCTLS \ | 22 | #define UFFD_API_IOCTLS \ |
| 28 | ((__u64)1 << _UFFDIO_REGISTER | \ | 23 | ((__u64)1 << _UFFDIO_REGISTER | \ |
| 29 | (__u64)1 << _UFFDIO_UNREGISTER | \ | 24 | (__u64)1 << _UFFDIO_UNREGISTER | \ |
| @@ -78,6 +73,10 @@ struct uffd_msg { | |||
| 78 | } pagefault; | 73 | } pagefault; |
| 79 | 74 | ||
| 80 | struct { | 75 | struct { |
| 76 | __u32 ufd; | ||
| 77 | } fork; | ||
| 78 | |||
| 79 | struct { | ||
| 81 | /* unused reserved fields */ | 80 | /* unused reserved fields */ |
| 82 | __u64 reserved1; | 81 | __u64 reserved1; |
| 83 | __u64 reserved2; | 82 | __u64 reserved2; |
| @@ -90,9 +89,7 @@ struct uffd_msg { | |||
| 90 | * Start at 0x12 and not at 0 to be more strict against bugs. | 89 | * Start at 0x12 and not at 0 to be more strict against bugs. |
| 91 | */ | 90 | */ |
| 92 | #define UFFD_EVENT_PAGEFAULT 0x12 | 91 | #define UFFD_EVENT_PAGEFAULT 0x12 |
| 93 | #if 0 /* not available yet */ | ||
| 94 | #define UFFD_EVENT_FORK 0x13 | 92 | #define UFFD_EVENT_FORK 0x13 |
| 95 | #endif | ||
| 96 | 93 | ||
| 97 | /* flags for UFFD_EVENT_PAGEFAULT */ | 94 | /* flags for UFFD_EVENT_PAGEFAULT */ |
| 98 | #define UFFD_PAGEFAULT_FLAG_WRITE (1<<0) /* If this was a write fault */ | 95 | #define UFFD_PAGEFAULT_FLAG_WRITE (1<<0) /* If this was a write fault */ |
| @@ -111,10 +108,8 @@ struct uffdio_api { | |||
| 111 | * are to be considered implicitly always enabled in all kernels as | 108 | * are to be considered implicitly always enabled in all kernels as |
| 112 | * long as the uffdio_api.api requested matches UFFD_API. | 109 | * long as the uffdio_api.api requested matches UFFD_API. |
| 113 | */ | 110 | */ |
| 114 | #if 0 /* not available yet */ | ||
| 115 | #define UFFD_FEATURE_PAGEFAULT_FLAG_WP (1<<0) | 111 | #define UFFD_FEATURE_PAGEFAULT_FLAG_WP (1<<0) |
| 116 | #define UFFD_FEATURE_EVENT_FORK (1<<1) | 112 | #define UFFD_FEATURE_EVENT_FORK (1<<1) |
| 117 | #endif | ||
| 118 | __u64 features; | 113 | __u64 features; |
| 119 | 114 | ||
| 120 | __u64 ioctls; | 115 | __u64 ioctls; |
