Searched refs:memfd (Results 1 - 20 of 20) sorted by relevance

/linux-master/tools/testing/selftests/drivers/dma-buf/
H A Dudmabuf.c15 #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 Drun_fuse_test.sh13 ./fuse_test ./mnt/memfd $@
H A Dcommon.c8 #include <linux/memfd.h>
H A Dfuse_test.c3 * 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 Dmemfd_test.c10 #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 Dudmabuf.h11 __u32 memfd; member in struct:udmabuf_create
18 __u32 memfd; member in struct:udmabuf_create_item
/linux-master/tools/testing/selftests/kvm/
H A Dset_memory_region_test.c449 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 Dpidfd_getfd_test.c37 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 Dudmabuf.c9 #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 Dprivate_mem_conversions_test.c19 #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 Dmemfd.c20 #include <linux/memfd.h>
22 #include <uapi/linux/memfd.h>
254 #define MFD_NAME_PREFIX "memfd:"
H A Dsecretmem.c12 #include <linux/memfd.h>
H A DMakefile128 obj-$(CONFIG_MEMFD_CREATE) += memfd.o
H A Dshmem.c78 #include <uapi/linux/memfd.h>
/linux-master/tools/testing/selftests/mm/
H A Dgup_longterm.c22 #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 Dcow.c22 #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 Dpagemap_ioctl.c12 #include <linux/memfd.h>
/linux-master/tools/testing/selftests/seccomp/
H A Dseccomp_bpf.c4060 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 DMakefile51 TARGETS += memfd
/linux-master/fs/
H A Dfcntl.c27 #include <linux/memfd.h>

Completed in 214 milliseconds