Lines Matching refs:sync
288 struct sync_area *sync; in prepare_vm() local
349 sync = (typeof(sync))vm_gpa2hva(data, MEM_SYNC_GPA, NULL); in prepare_vm()
350 sync->guest_page_size = data->vm->page_size; in prepare_vm()
351 atomic_init(&sync->start_flag, false); in prepare_vm()
352 atomic_init(&sync->exit_flag, false); in prepare_vm()
353 atomic_init(&sync->sync_flag, false); in prepare_vm()
382 static void let_guest_run(struct sync_area *sync) in let_guest_run() argument
384 atomic_store_explicit(&sync->start_flag, true, memory_order_release); in let_guest_run()
389 struct sync_area *sync = (typeof(sync))MEM_SYNC_GPA; in guest_spin_until_start() local
391 while (!atomic_load_explicit(&sync->start_flag, memory_order_acquire)) in guest_spin_until_start()
395 static void make_guest_exit(struct sync_area *sync) in make_guest_exit() argument
397 atomic_store_explicit(&sync->exit_flag, true, memory_order_release); in make_guest_exit()
402 struct sync_area *sync = (typeof(sync))MEM_SYNC_GPA; in _guest_should_exit() local
404 return atomic_load_explicit(&sync->exit_flag, memory_order_acquire); in _guest_should_exit()
415 static noinline void host_perform_sync(struct sync_area *sync) in host_perform_sync() argument
419 atomic_store_explicit(&sync->sync_flag, true, memory_order_release); in host_perform_sync()
420 while (atomic_load_explicit(&sync->sync_flag, memory_order_acquire)) in host_perform_sync()
428 struct sync_area *sync = (typeof(sync))MEM_SYNC_GPA; in guest_perform_sync() local
436 } while (!atomic_compare_exchange_weak_explicit(&sync->sync_flag, in guest_perform_sync()
446 struct sync_area *sync = (typeof(sync))MEM_SYNC_GPA; in guest_code_test_memslot_move() local
447 uint32_t page_size = (typeof(page_size))READ_ONCE(sync->guest_page_size); in guest_code_test_memslot_move()
448 uintptr_t base = (typeof(base))READ_ONCE(sync->move_area_ptr); in guest_code_test_memslot_move()
475 struct sync_area *sync = (typeof(sync))MEM_SYNC_GPA; in guest_code_test_memslot_map() local
476 uint32_t page_size = (typeof(page_size))READ_ONCE(sync->guest_page_size); in guest_code_test_memslot_map()
507 struct sync_area *sync = (typeof(sync))MEM_SYNC_GPA; in guest_code_test_memslot_unmap() local
542 struct sync_area *sync = (typeof(sync))MEM_SYNC_GPA; in guest_code_test_memslot_rw() local
543 uint32_t page_size = (typeof(page_size))READ_ONCE(sync->guest_page_size); in guest_code_test_memslot_rw()
575 struct sync_area *sync, in test_memslot_move_prepare() argument
594 sync->move_area_ptr = (void *)movetestgpa; in test_memslot_move_prepare()
606 struct sync_area *sync, in test_memslot_move_prepare_active() argument
609 return test_memslot_move_prepare(data, sync, maxslots, true); in test_memslot_move_prepare_active()
613 struct sync_area *sync, in test_memslot_move_prepare_inactive() argument
616 return test_memslot_move_prepare(data, sync, maxslots, false); in test_memslot_move_prepare_inactive()
619 static void test_memslot_move_loop(struct vm_data *data, struct sync_area *sync) in test_memslot_move_loop() argument
672 static void test_memslot_map_loop(struct vm_data *data, struct sync_area *sync) in test_memslot_map_loop() argument
690 host_perform_sync(sync); in test_memslot_map_loop()
705 host_perform_sync(sync); in test_memslot_map_loop()
711 struct sync_area *sync, in test_memslot_unmap_loop_common() argument
725 host_perform_sync(sync); in test_memslot_unmap_loop_common()
731 host_perform_sync(sync); in test_memslot_unmap_loop_common()
738 struct sync_area *sync) in test_memslot_unmap_loop() argument
745 test_memslot_unmap_loop_common(data, sync, guest_chunk_pages); in test_memslot_unmap_loop()
749 struct sync_area *sync) in test_memslot_unmap_loop_chunked() argument
754 test_memslot_unmap_loop_common(data, sync, guest_chunk_pages); in test_memslot_unmap_loop_chunked()
757 static void test_memslot_rw_loop(struct vm_data *data, struct sync_area *sync) in test_memslot_rw_loop() argument
766 host_perform_sync(sync); in test_memslot_rw_loop()
779 host_perform_sync(sync); in test_memslot_rw_loop()
786 bool (*prepare)(struct vm_data *data, struct sync_area *sync,
788 void (*loop)(struct vm_data *data, struct sync_area *sync);
800 struct sync_area *sync; in test_execute() local
811 sync = (typeof(sync))vm_gpa2hva(data, MEM_SYNC_GPA, NULL); in test_execute()
813 !tdata->prepare(data, sync, maxslots)) { in test_execute()
821 let_guest_run(sync); in test_execute()
828 tdata->loop(data, sync); in test_execute()
833 make_guest_exit(sync); in test_execute()