• Peter Xu's avatar
    KVM: selftests: Run dirty ring test asynchronously · 019d321a
    Peter Xu authored
    Previously the dirty ring test was working in synchronous way, because
    only with a vmexit (with that it was the ring full event) we'll know
    the hardware dirty bits will be flushed to the dirty ring.
    
    With this patch we first introduce a vcpu kick mechanism using SIGUSR1,
    which guarantees a vmexit and also therefore the flushing of hardware
    dirty bits.  Once this is in place, we can keep the vcpu dirty work
    asynchronous of the whole collection procedure now.  Still, we need
    to be very careful that when reaching the ring buffer soft limit
    (KVM_EXIT_DIRTY_RING_FULL) we must collect the dirty bits before
    continuing the vcpu.
    
    Further increase the dirty ring size to current maximum to make sure
    we torture more on the no-ring-full case, which should be the major
    scenario when the hypervisors like QEMU would like to use this feature.
    Reviewed-by: default avatarAndrew Jones <drjones@redhat.com>
    Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
    Message-Id: <20201001012239.6159-1-peterx@redhat.com>
    [Use KVM_SET_SIGNAL_MASK+sigwait instead of a signal handler. - Paolo]
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    019d321a
dirty_log_test.c 25.8 KB