Lines Matching refs:memfd
466 static void test_invalid_guest_memfd(struct kvm_vm *vm, int memfd, in test_invalid_guest_memfd() argument
471 0, memfd, offset); in test_invalid_guest_memfd()
478 int memfd, i; in test_add_private_memory_region() local
487 memfd = kvm_memfd_alloc(MEM_REGION_SIZE, false); in test_add_private_memory_region()
488 test_invalid_guest_memfd(vm, memfd, 0, "Regular memfd() should fail"); in test_add_private_memory_region()
489 close(memfd); in test_add_private_memory_region()
492 memfd = vm_create_guest_memfd(vm2, MEM_REGION_SIZE, 0); in test_add_private_memory_region()
493 test_invalid_guest_memfd(vm, memfd, 0, "Other VM's guest_memfd() should fail"); in test_add_private_memory_region()
496 MEM_REGION_GPA, MEM_REGION_SIZE, 0, memfd, 0); in test_add_private_memory_region()
497 close(memfd); in test_add_private_memory_region()
500 memfd = vm_create_guest_memfd(vm, MEM_REGION_SIZE, 0); in test_add_private_memory_region()
502 test_invalid_guest_memfd(vm, memfd, i, "Unaligned offset should fail"); in test_add_private_memory_region()
505 MEM_REGION_GPA, MEM_REGION_SIZE, 0, memfd, 0); in test_add_private_memory_region()
506 close(memfd); in test_add_private_memory_region()
514 int memfd; in test_add_overlapping_private_memory_regions() local
521 memfd = vm_create_guest_memfd(vm, MEM_REGION_SIZE * 4, 0); in test_add_overlapping_private_memory_regions()
524 MEM_REGION_GPA, MEM_REGION_SIZE * 2, 0, memfd, 0); in test_add_overlapping_private_memory_regions()
528 0, memfd, MEM_REGION_SIZE * 2); in test_add_overlapping_private_memory_regions()
541 0, memfd, 0); in test_add_overlapping_private_memory_regions()
549 0, memfd, 0); in test_add_overlapping_private_memory_regions()
553 close(memfd); in test_add_overlapping_private_memory_regions()