]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: selftests: Keep dirty_log_test vCPU in guest until it needs to stop
authorSean Christopherson <seanjc@google.com>
Sat, 11 Jan 2025 00:29:54 +0000 (16:29 -0800)
committerSean Christopherson <seanjc@google.com>
Wed, 12 Feb 2025 17:00:55 +0000 (09:00 -0800)
commit0a818b3541af09ddaf412d125dc7315fc448851e
tree2bbf688e85168a851e11292059290070bb546ada
parentf3629c0ef167aec0eb069cff2526cd54e966b5d8
KVM: selftests: Keep dirty_log_test vCPU in guest until it needs to stop

In the dirty_log_test guest code, exit to userspace only when the vCPU is
explicitly told to stop.  Periodically exiting just to check if a flag has
been set is unnecessary, weirdly complex, and wastes time handling exits
that could be used to dirty memory.

Opportunistically convert 'i' to a uint64_t to guard against the unlikely
scenario that guest_num_pages exceeds the storage of an int.

Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Link: https://lore.kernel.org/r/20250111003004.1235645-11-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/dirty_log_test.c