/kernel/linux/linux-5.10/tools/testing/selftests/drivers/dma-buf/ |
H A D | udmabuf.c | 12 #include <linux/memfd.h> 26 int devfd, memfd, buf, ret; in main() local 36 memfd = memfd_create("udmabuf-test", MFD_ALLOW_SEALING); in main() 37 if (memfd < 0) { in main() 38 printf("%s: [skip,no-memfd]\n", TEST_PREFIX); in main() 42 ret = fcntl(memfd, F_ADD_SEALS, F_SEAL_SHRINK); in main() 50 ret = ftruncate(memfd, size); in main() 52 printf("%s: [FAIL,memfd-truncate]\n", TEST_PREFIX); in main() 59 create.memfd = memfd; in main() [all...] |
/kernel/linux/linux-6.6/tools/testing/selftests/drivers/dma-buf/ |
H A D | udmabuf.c | 15 #include <linux/memfd.h> 29 int devfd, memfd, buf, ret; in main() local 40 memfd = memfd_create("udmabuf-test", MFD_ALLOW_SEALING); in main() 41 if (memfd < 0) { in main() 42 printf("%s: [skip,no-memfd]\n", TEST_PREFIX); in main() 46 ret = fcntl(memfd, F_ADD_SEALS, F_SEAL_SHRINK); in main() 54 ret = ftruncate(memfd, size); in main() 56 printf("%s: [FAIL,memfd-truncate]\n", TEST_PREFIX); in main() 63 create.memfd = memfd; in main() [all...] |
/kernel/linux/linux-5.10/tools/testing/selftests/pidfd/ |
H A D | pidfd_getfd_test.c | 36 static int __child(int sk, int memfd) in __child() argument 52 ret = send(sk, &memfd, sizeof(memfd), 0); in __child() 53 if (ret != sizeof(memfd)) { in __child() 100 int memfd, ret; in child() local 102 memfd = sys_memfd_create("test", 0); in child() 103 if (memfd < 0) { in child() 104 fprintf(stderr, "%s: Child could not create memfd\n", in child() 108 ret = __child(sk, memfd); in child() 109 close(memfd); in child() [all...] |
/kernel/linux/linux-6.6/tools/testing/selftests/pidfd/ |
H A D | pidfd_getfd_test.c | 36 static int __child(int sk, int memfd) in __child() argument 52 ret = send(sk, &memfd, sizeof(memfd), 0); in __child() 53 if (ret != sizeof(memfd)) { in __child() 100 int memfd, ret; in child() local 102 memfd = sys_memfd_create("test", 0); in child() 103 if (memfd < 0) { in child() 104 fprintf(stderr, "%s: Child could not create memfd\n", in child() 108 ret = __child(sk, memfd); in child() 109 close(memfd); in child() [all...] |
/kernel/linux/linux-5.10/drivers/dma-buf/ |
H A D | udmabuf.c | 8 #include <linux/memfd.h> 168 struct file *memfd = NULL; in udmabuf_create() local 204 memfd = fget(list[i].memfd); in udmabuf_create() 205 if (!memfd) in udmabuf_create() 207 if (!shmem_mapping(file_inode(memfd)->i_mapping)) in udmabuf_create() 209 seals = memfd_fcntl(memfd, F_GET_SEALS, 0); in udmabuf_create() 220 file_inode(memfd)->i_mapping, pgoff + pgidx); in udmabuf_create() 227 fput(memfd); in udmabuf_create() 228 memfd in udmabuf_create() [all...] |
/kernel/linux/linux-6.6/drivers/dma-buf/ |
H A D | udmabuf.c | 9 #include <linux/memfd.h> 202 struct file *memfd = NULL; in udmabuf_create() local 239 memfd = fget(list[i].memfd); in udmabuf_create() 240 if (!memfd) in udmabuf_create() 242 mapping = memfd->f_mapping; in udmabuf_create() 245 seals = memfd_fcntl(memfd, F_GET_SEALS, 0); in udmabuf_create() 262 fput(memfd); in udmabuf_create() 263 memfd = NULL; in udmabuf_create() 286 if (memfd) in udmabuf_create() [all...] |
/kernel/linux/linux-5.10/include/uapi/linux/ |
H A D | udmabuf.h | 11 __u32 memfd; member 18 __u32 memfd; member
|
/kernel/linux/linux-6.6/include/uapi/linux/ |
H A D | udmabuf.h | 11 __u32 memfd; member 18 __u32 memfd; member
|
/kernel/linux/patches/linux-6.6/prebuilts/usr/include/linux/ |
H A D | udmabuf.h | 25 __u32 memfd; member 31 __u32 memfd; member
|
/kernel/linux/patches/linux-5.10/prebuilts/usr/include/linux/ |
H A D | udmabuf.h | 25 __u32 memfd; member 31 __u32 memfd; member
|
/kernel/linux/linux-5.10/tools/testing/selftests/memfd/ |
H A D | common.c | 8 #include <linux/memfd.h>
|
H A D | fuse_test.c | 3 * memfd GUP test-case 4 * This tests memfd interactions with get_user_pages(). We require the 10 * We use this trick to race ADD_SEALS against a write on a memfd object. The 11 * ADD_SEALS must fail if the memfd pages are still pinned. Note that we use 12 * the read() syscall with our memory-mapped memfd object as receive buffer to 13 * force the kernel to write into our memfd object. 24 #include <linux/memfd.h> 260 /* open FUSE memfd file for GUP testing */ in main() 268 /* create new memfd-object */ in main() 273 /* mmap memfd in main() [all...] |
H A D | memfd_test.c | 10 #include <linux/memfd.h> 24 #define MEMFD_STR "memfd:" 25 #define MEMFD_HUGE_STR "memfd-hugetlb:" 959 * Via /proc we can get access to a separate file-context for the same memfd. 1077 printf("memfd: DONE\n"); in main()
|
/kernel/linux/linux-6.6/tools/testing/selftests/memfd/ |
H A D | common.c | 8 #include <linux/memfd.h>
|
H A D | fuse_test.c | 3 * memfd GUP test-case 4 * This tests memfd interactions with get_user_pages(). We require the 10 * We use this trick to race ADD_SEALS against a write on a memfd object. The 11 * ADD_SEALS must fail if the memfd pages are still pinned. Note that we use 12 * the read() syscall with our memory-mapped memfd object as receive buffer to 13 * force the kernel to write into our memfd object. 24 #include <linux/memfd.h> 260 /* open FUSE memfd file for GUP testing */ in main() 268 /* create new memfd-object */ in main() 273 /* mmap memfd in main() [all...] |
/kernel/linux/linux-5.10/mm/ |
H A D | memfd.c | 20 #include <linux/memfd.h> 21 #include <uapi/linux/memfd.h> 260 #define MFD_NAME_PREFIX "memfd:"
|
H A D | Makefile | 123 obj-$(CONFIG_MEMFD_CREATE) += memfd.o
|
/kernel/linux/linux-6.6/mm/ |
H A D | memfd.c | 20 #include <linux/memfd.h> 22 #include <uapi/linux/memfd.h> 265 #define MFD_NAME_PREFIX "memfd:"
|
H A D | secretmem.c | 12 #include <linux/memfd.h>
|
H A D | Makefile | 133 obj-$(CONFIG_MEMFD_CREATE) += memfd.o
|
/kernel/linux/linux-5.10/tools/testing/selftests/seccomp/ |
H A D | seccomp_bpf.c | 3968 int status, listener, memfd, fd; in TEST() local 3977 memfd = memfd_create("test", 0); in TEST() 3978 ASSERT_GE(memfd, 0); in TEST() 4001 addfd.srcfd = memfd; in TEST() 4038 * The child has fds 0(stdin), 1(stdout), 2(stderr), 3(memfd), in TEST() 4042 EXPECT_EQ(filecmp(getpid(), pid, memfd, fd), 0); in TEST() 4055 EXPECT_EQ(filecmp(getpid(), pid, memfd, fd), 0); in TEST() 4088 close(memfd); in TEST() 4095 int status, listener, memfd; in TEST() local 4104 memfd in TEST() [all...] |
/kernel/linux/linux-6.6/tools/testing/selftests/seccomp/ |
H A D | seccomp_bpf.c | 4044 int status, listener, memfd, fd, nextfd; in TEST() local 4054 memfd = memfd_create("test", 0); in TEST() 4055 ASSERT_GE(memfd, 0); in TEST() 4056 nextfd = memfd + 1; in TEST() 4086 addfd.srcfd = memfd; in TEST() 4123 EXPECT_EQ(filecmp(getpid(), pid, memfd, fd), 0); in TEST() 4136 EXPECT_EQ(filecmp(getpid(), pid, memfd, fd), 0); in TEST() 4168 ASSERT_EQ(filecmp(getpid(), pid, memfd, fd), 0); in TEST() 4195 close(memfd); in TEST() 4202 int status, listener, memfd; in TEST() local [all...] |
/kernel/linux/linux-5.10/tools/testing/selftests/ |
H A D | Makefile | 33 TARGETS += memfd
|
/kernel/linux/linux-6.6/tools/testing/selftests/mm/ |
H A D | gup_longterm.c | 22 #include <linux/memfd.h> 240 ksft_print_msg("[RUN] %s ... with memfd\n", desc); in run_with_memfd() 304 ksft_print_msg("[RUN] %s ... with memfd hugetlb (%zu kB)\n", desc, in run_with_memfd_hugetlb()
|
/kernel/linux/linux-6.6/tools/testing/selftests/ |
H A D | Makefile | 46 TARGETS += memfd
|