diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ioctl.c | 2 | ||||
-rw-r--r-- | src/userfaultfd.c | 19 | ||||
-rw-r--r-- | src/xlat/uffd_api_features.in | 19 | ||||
-rw-r--r-- | src/xlat/uffd_api_flags.in | 1 | ||||
-rw-r--r-- | src/xlat/uffd_copy_flags.in | 5 | ||||
-rw-r--r-- | src/xlat/uffd_flags.in | 3 | ||||
-rw-r--r-- | src/xlat/uffd_register_ioctl_flags.in | 1 | ||||
-rw-r--r-- | src/xlat/uffd_register_mode_flags.in | 1 | ||||
-rw-r--r-- | src/xlat/uffd_zeropage_flags.in | 1 |
9 files changed, 28 insertions, 24 deletions
diff --git a/src/ioctl.c b/src/ioctl.c index aac7a4b27..01cb0e7cf 100644 --- a/src/ioctl.c +++ b/src/ioctl.c @@ -349,10 +349,8 @@ ioctl_decode(struct tcb *tcp) return fs_0x94_ioctl(tcp, code, arg); case 0xa4: return tee_ioctl(tcp, code, arg); -#ifdef HAVE_LINUX_USERFAULTFD_H case 0xaa: return uffdio_ioctl(tcp, code, arg); -#endif case 0xab: return nbd_ioctl(tcp, code, arg); #ifdef HAVE_LINUX_KVM_H diff --git a/src/userfaultfd.c b/src/userfaultfd.c index d87d6e781..7996c94f2 100644 --- a/src/userfaultfd.c +++ b/src/userfaultfd.c @@ -8,6 +8,9 @@ #include "defs.h" #include "kernel_fcntl.h" +#include <linux/ioctl.h> +#include <linux/userfaultfd.h> + #include "xlat/uffd_flags.h" SYS_FUNC(userfaultfd) @@ -17,16 +20,13 @@ SYS_FUNC(userfaultfd) return RVAL_DECODED | RVAL_FD; } -#ifdef HAVE_LINUX_USERFAULTFD_H -# include <linux/ioctl.h> -# include <linux/userfaultfd.h> -# include "xlat/uffd_api_features.h" -# include "xlat/uffd_api_flags.h" -# include "xlat/uffd_copy_flags.h" -# include "xlat/uffd_register_ioctl_flags.h" -# include "xlat/uffd_register_mode_flags.h" -# include "xlat/uffd_zeropage_flags.h" +#include "xlat/uffd_api_features.h" +#include "xlat/uffd_api_flags.h" +#include "xlat/uffd_copy_flags.h" +#include "xlat/uffd_register_ioctl_flags.h" +#include "xlat/uffd_register_mode_flags.h" +#include "xlat/uffd_zeropage_flags.h" static void tprintf_uffdio_range(const struct uffdio_range *range) @@ -191,4 +191,3 @@ uffdio_ioctl(struct tcb *const tcp, const unsigned int code, return RVAL_IOCTL_DECODED; } -#endif /* HAVE_LINUX_USERFAULTFD_H */ diff --git a/src/xlat/uffd_api_features.in b/src/xlat/uffd_api_features.in index 33d644778..603086f9c 100644 --- a/src/xlat/uffd_api_features.in +++ b/src/xlat/uffd_api_features.in @@ -1,10 +1,11 @@ +#unconditional #val_type uint64_t -UFFD_FEATURE_PAGEFAULT_FLAG_WP (1<<0) -UFFD_FEATURE_EVENT_FORK (1<<1) -UFFD_FEATURE_EVENT_REMAP (1<<2) -UFFD_FEATURE_EVENT_REMOVE (1<<3) -UFFD_FEATURE_MISSING_HUGETLBFS (1<<4) -UFFD_FEATURE_MISSING_SHMEM (1<<5) -UFFD_FEATURE_EVENT_UNMAP (1<<6) -UFFD_FEATURE_SIGBUS (1<<7) -UFFD_FEATURE_THREAD_ID (1<<8) +UFFD_FEATURE_PAGEFAULT_FLAG_WP +UFFD_FEATURE_EVENT_FORK +UFFD_FEATURE_EVENT_REMAP +UFFD_FEATURE_EVENT_REMOVE +UFFD_FEATURE_MISSING_HUGETLBFS +UFFD_FEATURE_MISSING_SHMEM +UFFD_FEATURE_EVENT_UNMAP +UFFD_FEATURE_SIGBUS +UFFD_FEATURE_THREAD_ID diff --git a/src/xlat/uffd_api_flags.in b/src/xlat/uffd_api_flags.in index fd210872b..66b968959 100644 --- a/src/xlat/uffd_api_flags.in +++ b/src/xlat/uffd_api_flags.in @@ -1,3 +1,4 @@ +#unconditional #val_type uint64_t 1<<_UFFDIO_REGISTER 1<<_UFFDIO_UNREGISTER diff --git a/src/xlat/uffd_copy_flags.in b/src/xlat/uffd_copy_flags.in index a9e3e9416..362b20761 100644 --- a/src/xlat/uffd_copy_flags.in +++ b/src/xlat/uffd_copy_flags.in @@ -1,3 +1,4 @@ +#unconditional #val_type uint64_t -UFFDIO_COPY_MODE_DONTWAKE (1ULL<<0) -UFFDIO_COPY_MODE_WP (1ULL<<1) +UFFDIO_COPY_MODE_DONTWAKE +UFFDIO_COPY_MODE_WP diff --git a/src/xlat/uffd_flags.in b/src/xlat/uffd_flags.in index e925a8fe7..7a68a695d 100644 --- a/src/xlat/uffd_flags.in +++ b/src/xlat/uffd_flags.in @@ -1,3 +1,4 @@ -UFFD_USER_MODE_ONLY 1 +#unconditional +UFFD_USER_MODE_ONLY O_NONBLOCK O_CLOEXEC diff --git a/src/xlat/uffd_register_ioctl_flags.in b/src/xlat/uffd_register_ioctl_flags.in index 077871f93..6d04ca3be 100644 --- a/src/xlat/uffd_register_ioctl_flags.in +++ b/src/xlat/uffd_register_ioctl_flags.in @@ -1,3 +1,4 @@ +#unconditional #val_type uint64_t 1<<_UFFDIO_WAKE 1<<_UFFDIO_COPY diff --git a/src/xlat/uffd_register_mode_flags.in b/src/xlat/uffd_register_mode_flags.in index 996b1f32e..adae3c64a 100644 --- a/src/xlat/uffd_register_mode_flags.in +++ b/src/xlat/uffd_register_mode_flags.in @@ -1,3 +1,4 @@ +#unconditional #val_type uint64_t UFFDIO_REGISTER_MODE_MISSING UFFDIO_REGISTER_MODE_WP diff --git a/src/xlat/uffd_zeropage_flags.in b/src/xlat/uffd_zeropage_flags.in index 6d48a040d..b2b3467ba 100644 --- a/src/xlat/uffd_zeropage_flags.in +++ b/src/xlat/uffd_zeropage_flags.in @@ -1,2 +1,3 @@ +#unconditional #val_type uint64_t UFFDIO_ZEROPAGE_MODE_DONTWAKE |