Lines Matching +full:full +full:- +full:bit
1 // SPDX-License-Identifier: GPL-2.0
45 # define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7)
118 addr &= ~(host_page_size - 1); in guest_code()
145 * is the only place that we'll guarantee both "dirty bit" and "dirty data"
147 * after setting dirty bit but before the data is written.
152 * ring-full event. It should only be read until a sem_wait() of
158 * tricky case when the ring just got full, kvm will do userspace exit due to
159 * ring full. When that happens, the very last PFN is set but actually the
161 * we found that the dirty ring is full, refused to continue the vcpu, and
165 * bit, because it's a redundant bit, and when the write happens later the bit
210 while (ret == -1 && errno == EINTR); in sem_wait_until()
260 TEST_ASSERT(ret == 0 || (ret == -1 && err == EINTR), in default_after_vcpu_run()
265 exit_reason_str(run->exit_reason)); in default_after_vcpu_run()
287 return gfn->flags == KVM_DIRTY_GFN_F_DIRTY; in dirty_gfn_is_dirtied()
292 gfn->flags = KVM_DIRTY_GFN_F_RESET; in dirty_gfn_set_collected()
306 TEST_ASSERT(cur->slot == slot, "Slot number didn't match: " in dirty_ring_collect_one()
307 "%u != %u", cur->slot, slot); in dirty_ring_collect_one()
308 TEST_ASSERT(cur->offset < num_pages, "Offset overflow: " in dirty_ring_collect_one()
309 "0x%llx >= 0x%x", cur->offset, num_pages); in dirty_ring_collect_one()
310 //pr_info("fetch 0x%x page %llu\n", *fetch_index, cur->offset); in dirty_ring_collect_one()
311 set_bit_le(cur->offset, bitmap); in dirty_ring_collect_one()
312 dirty_ring_last_page = cur->offset; in dirty_ring_collect_one()
346 * This is not a ring-full event, it's safe to allow in dirty_ring_collect_dirty_pages()
365 "Didn't continue vcpu even without ring full"); in dirty_ring_collect_dirty_pages()
376 /* A ucall-sync or ring-full event is allowed */ in dirty_ring_after_vcpu_run()
380 } else if (run->exit_reason == KVM_EXIT_DIRTY_RING_FULL || in dirty_ring_after_vcpu_run()
381 (ret == -1 && err == EINTR)) { in dirty_ring_after_vcpu_run()
384 run->exit_reason == KVM_EXIT_DIRTY_RING_FULL); in dirty_ring_after_vcpu_run()
388 "dirty ring is full" : "vcpu is kicked out"); in dirty_ring_after_vcpu_run()
394 exit_reason_str(run->exit_reason)); in dirty_ring_after_vcpu_run()
418 .name = "dirty-log",
423 .name = "clear-log",
430 .name = "dirty-ring",
441 * bit set in the _next_ iteration. For example, if we detected the
443 * page bit is cleared in the latest bitmap, then the system must
462 if (mode->supported) in log_mode_supported()
463 return mode->supported(); in log_mode_supported()
472 if (mode->create_vm_done) in log_mode_create_vm_done()
473 mode->create_vm_done(vm); in log_mode_create_vm_done()
481 TEST_ASSERT(mode->collect_dirty_pages != NULL, in log_mode_collect_dirty_pages()
483 mode->collect_dirty_pages(vm, slot, bitmap, num_pages); in log_mode_collect_dirty_pages()
490 if (mode->after_vcpu_run) in log_mode_after_vcpu_run()
491 mode->after_vcpu_run(vm, ret, err); in log_mode_after_vcpu_run()
498 if (mode->before_vcpu_join) in log_mode_before_vcpu_join()
499 mode->before_vcpu_join(); in log_mode_before_vcpu_join()
518 sigset_t *sigset = (sigset_t *) &sigmask->sigset; in vcpu_worker()
524 * ioctl to return with -EINTR, but it is still pending and we need in vcpu_worker()
527 sigmask->len = 8; in vcpu_worker()
543 if (ret == -1 && errno == EINTR) { in vcpu_worker()
544 int sig = -1; in vcpu_worker()
570 "Page %"PRIu64" should have its dirty bit " in vm_dirty_log_verify()
581 * If the bit is set, the value written onto in vm_dirty_log_verify()
586 *value_ptr == iteration - 1); in vm_dirty_log_verify()
589 if (*value_ptr == iteration - 2 && min_iter <= iteration - 2) { in vm_dirty_log_verify()
594 * dirty ring full in iteration N-2. in vm_dirty_log_verify()
600 * -------- -------- in vm_dirty_log_verify()
602 * write 1 to page 0~(R-1) in vm_dirty_log_verify()
603 * full, vmexit in vm_dirty_log_verify()
604 * collect 0~(R-1) in vm_dirty_log_verify()
606 * write 1 to (R-1)~(2R-2) in vm_dirty_log_verify()
607 * full, vmexit in vm_dirty_log_verify()
609 * collect (R-1)~(2R-2) in vm_dirty_log_verify()
611 * write 1 to (2R-2) in vm_dirty_log_verify()
613 * write 2 to (2R-1)~(3R-3) in vm_dirty_log_verify()
614 * full, vmexit in vm_dirty_log_verify()
616 * collect (2R-2)~(3R-3) in vm_dirty_log_verify()
618 * "2R-2" is 1, while iter=3!!!) in vm_dirty_log_verify()
622 min_iter = iteration - 1; in vm_dirty_log_verify()
643 * (iteration-1) if that write can happen in vm_dirty_log_verify()
646 * (1) increase loop count to "iteration-1" in vm_dirty_log_verify()
648 * "iteration-1") in vm_dirty_log_verify()
649 * (3) get dirty log for "iteration-1"; we'll in vm_dirty_log_verify()
650 * see that page P bit is set (dirtied), in vm_dirty_log_verify()
651 * and not set the bit in host_bmap_track in vm_dirty_log_verify()
656 * value "iteration-1". in vm_dirty_log_verify()
722 2ul << (DIRTY_MEM_BITS - PAGE_SHIFT_4K), in run_test()
730 guest_num_pages = (1ul << (DIRTY_MEM_BITS - in run_test()
737 if (!p->phys_offset) { in run_test()
738 guest_test_phys_mem = (vm_get_max_gfn(vm) - in run_test()
740 guest_test_phys_mem &= ~(host_page_size - 1); in run_test()
742 guest_test_phys_mem = p->phys_offset; in run_test()
747 guest_test_phys_mem &= ~((1 << 20) - 1); in run_test()
786 while (iteration < p->iterations) { in run_test()
788 usleep(p->interval * 1000); in run_test()
800 * GUEST_SYNC but instead we stopped because ring is full; in run_test()
801 * that's okay too because ring full means we're only missing in run_test()
832 printf("usage: %s [-h] [-i iterations] [-I interval] " in help()
833 "[-p offset] [-m mode]\n", name); in help()
835 printf(" -c: specify dirty ring size, in number of entries\n"); in help()
836 printf(" (only useful for dirty-ring test; default: %"PRIu32")\n", in help()
838 printf(" -i: specify iteration counts (default: %"PRIu64")\n", in help()
840 printf(" -I: specify interval in ms (default: %"PRIu64" ms)\n", in help()
842 printf(" -p: specify guest physical test memory offset\n" in help()
844 printf(" -M: specify the host logging mode " in help()
866 while ((opt = getopt(argc, argv, "c:hi:I:p:m:M:")) != -1) { in main()