Lines Matching +full:close +full:- +full:range

1 // SPDX-License-Identifier: GPL-2.0
7 * Copyright (C) 2019-2022 Google LLC
31 int uffd = uffd_desc->uffd; in uffd_handler_thread_fn()
32 int pipefd = uffd_desc->pipefds[0]; in uffd_handler_thread_fn()
33 useconds_t delay = uffd_desc->delay; in uffd_handler_thread_fn()
50 r = poll(pollfd, 2, -1); in uffd_handler_thread_fn()
52 case -1: in uffd_handler_thread_fn()
80 if (r == -1) { in uffd_handler_thread_fn()
97 r = uffd_desc->handler(uffd_desc->uffd_mode, uffd, &msg); in uffd_handler_thread_fn()
139 TEST_ASSERT(ioctl(uffd, UFFDIO_API, &uffdio_api) != -1, in uffd_setup_demand_paging()
143 uffdio_register.range.start = (uint64_t)hva; in uffd_setup_demand_paging()
144 uffdio_register.range.len = len; in uffd_setup_demand_paging()
146 TEST_ASSERT(ioctl(uffd, UFFDIO_REGISTER, &uffdio_register) != -1, in uffd_setup_demand_paging()
151 ret = pipe2(uffd_desc->pipefds, O_CLOEXEC | O_NONBLOCK); in uffd_setup_demand_paging()
154 uffd_desc->uffd_mode = uffd_mode; in uffd_setup_demand_paging()
155 uffd_desc->uffd = uffd; in uffd_setup_demand_paging()
156 uffd_desc->delay = delay; in uffd_setup_demand_paging()
157 uffd_desc->handler = handler; in uffd_setup_demand_paging()
158 pthread_create(&uffd_desc->thread, NULL, uffd_handler_thread_fn, in uffd_setup_demand_paging()
161 PER_VCPU_DEBUG("Created uffd thread for HVA range [%p, %p)\n", in uffd_setup_demand_paging()
172 ret = write(uffd->pipefds[1], &c, 1); in uffd_stop_demand_paging()
175 ret = pthread_join(uffd->thread, NULL); in uffd_stop_demand_paging()
178 close(uffd->uffd); in uffd_stop_demand_paging()
180 close(uffd->pipefds[1]); in uffd_stop_demand_paging()
181 close(uffd->pipefds[0]); in uffd_stop_demand_paging()