]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: selftests: Support multiple write retires in dirty_log_test
authorMaxim Levitsky <mlevitsk@redhat.com>
Sat, 11 Jan 2025 00:29:45 +0000 (16:29 -0800)
committerSean Christopherson <seanjc@google.com>
Wed, 12 Feb 2025 17:00:54 +0000 (09:00 -0800)
commitfe49f80052578cfe79411b6b47bb9ea278acbea8
tree296613ce8f31de540041bc4b2eb4004b3958680f
parent89ea56a4043ab6ec598e7969a9b88883815f53a0
KVM: selftests: Support multiple write retires in dirty_log_test

If dirty_log_test is run nested, it is possible for entries in the emulated
PML log to appear before the actual memory write is committed to the RAM,
due to the way KVM retries memory writes as a response to a MMU fault.

In addition to that in some very rare cases retry can happen more than
once, which will lead to the test failure because once the write is
finally committed it may have a very outdated iteration value.

Detect and avoid this case.

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