/linux-master/tools/testing/selftests/drivers/dma-buf/ |
H A D | udmabuf.c | 15 #include <linux/memfd.h> 29 int devfd, memfd, buf, ret; local 40 memfd = memfd_create("udmabuf-test", MFD_ALLOW_SEALING); 41 if (memfd < 0) { 42 printf("%s: [skip,no-memfd]\n", TEST_PREFIX); 46 ret = fcntl(memfd, F_ADD_SEALS, F_SEAL_SHRINK); 54 ret = ftruncate(memfd, size); 56 printf("%s: [FAIL,memfd-truncate]\n", TEST_PREFIX); 63 create.memfd = memfd; [all...] |
/linux-master/tools/testing/selftests/memfd/ |
H A D | run_fuse_test.sh | 13 ./fuse_test ./mnt/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 */ 268 /* create new memfd-object */ 273 /* mmap memfd [all...] |
H A D | memfd_test.c | 10 #include <linux/memfd.h> 25 #define MEMFD_STR "memfd:" 26 #define MEMFD_HUGE_STR "memfd-hugetlb:" 1487 * Via /proc we can get access to a separate file-context for the same memfd. 1611 printf("memfd: DONE\n");
|
/linux-master/include/uapi/linux/ |
H A D | udmabuf.h | 11 __u32 memfd; member in struct:udmabuf_create 18 __u32 memfd; member in struct:udmabuf_create_item
|
/linux-master/tools/testing/selftests/kvm/ |
H A D | set_memory_region_test.c | 449 static void test_invalid_guest_memfd(struct kvm_vm *vm, int memfd, argument 454 0, memfd, offset); 461 int memfd, i; local 470 memfd = kvm_memfd_alloc(MEM_REGION_SIZE, false); 471 test_invalid_guest_memfd(vm, memfd, 0, "Regular memfd() should fail"); 472 close(memfd); 475 memfd = vm_create_guest_memfd(vm2, MEM_REGION_SIZE, 0); 476 test_invalid_guest_memfd(vm, memfd, 0, "Other VM's guest_memfd() should fail"); 479 MEM_REGION_GPA, MEM_REGION_SIZE, 0, memfd, 497 int memfd; local [all...] |
/linux-master/tools/testing/selftests/pidfd/ |
H A D | pidfd_getfd_test.c | 37 static int __child(int sk, int memfd) argument 53 ret = send(sk, &memfd, sizeof(memfd), 0); 54 if (ret != sizeof(memfd)) { 101 int memfd, ret; local 103 memfd = sys_memfd_create("test", 0); 104 if (memfd < 0) { 105 fprintf(stderr, "%s: Child could not create memfd\n", 109 ret = __child(sk, memfd); 110 close(memfd); [all...] |
/linux-master/drivers/dma-buf/ |
H A D | udmabuf.c | 9 #include <linux/memfd.h> 202 struct file *memfd = NULL; local 239 memfd = fget(list[i].memfd); 240 if (!memfd) 242 mapping = memfd->f_mapping; 245 seals = memfd_fcntl(memfd, F_GET_SEALS, 0); 262 fput(memfd); 263 memfd = NULL; 286 if (memfd) [all...] |
/linux-master/tools/testing/selftests/kvm/x86_64/ |
H A D | private_mem_conversions_test.c | 19 #include <linux/memfd.h> 384 int memfd, i, r; local 392 "The memfd size (0x%lx) needs to be cleanly divisible by the number of memslots (%u)", 398 memfd = vm_create_guest_memfd(vm, memfd_size, 0); 403 KVM_MEM_GUEST_MEMFD, memfd, slot_size * i); 432 r = fallocate(memfd, FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE, 0, memfd_size); 435 r = fallocate(memfd, FALLOC_FL_KEEP_SIZE, 0, memfd_size); 438 close(memfd);
|
/linux-master/mm/ |
H A D | memfd.c | 20 #include <linux/memfd.h> 22 #include <uapi/linux/memfd.h> 254 #define MFD_NAME_PREFIX "memfd:"
|
H A D | secretmem.c | 12 #include <linux/memfd.h>
|
H A D | Makefile | 128 obj-$(CONFIG_MEMFD_CREATE) += memfd.o
|
H A D | shmem.c | 78 #include <uapi/linux/memfd.h>
|
/linux-master/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); 305 ksft_print_msg("[RUN] %s ... with memfd hugetlb (%zu kB)\n", desc,
|
H A D | cow.c | 22 #include <linux/memfd.h> 1529 ksft_print_msg("[RUN] %s ... with memfd\n", desc); 1543 /* Create a private mapping of the memfd. */ 1594 /* Create a private mapping of the memfd. */ 1626 ksft_print_msg("[RUN] %s ... with memfd hugetlb (%zu kB)\n", desc, 1643 /* Create a private mapping of the memfd. */
|
H A D | pagemap_ioctl.c | 12 #include <linux/memfd.h>
|
/linux-master/tools/testing/selftests/seccomp/ |
H A D | seccomp_bpf.c | 4060 int status, listener, memfd, fd, nextfd; local 4070 memfd = memfd_create("test", 0); 4071 ASSERT_GE(memfd, 0); 4072 nextfd = get_next_fd(memfd); 4103 addfd.srcfd = memfd; 4141 EXPECT_EQ(filecmp(getpid(), pid, memfd, fd), 0); 4155 EXPECT_EQ(filecmp(getpid(), pid, memfd, fd), 0); 4188 ASSERT_EQ(filecmp(getpid(), pid, memfd, fd), 0); 4215 close(memfd); 4222 int status, listener, memfd; local [all...] |
/linux-master/tools/testing/selftests/ |
H A D | Makefile | 51 TARGETS += memfd
|
/linux-master/fs/ |
H A D | fcntl.c | 27 #include <linux/memfd.h>
|