]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: selftests: replace assertion with warning in access_tracking_perf_test
authorEmanuele Giuseppe Esposito <eesposit@redhat.com>
Mon, 26 Sep 2022 08:29:23 +0000 (04:29 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 30 Sep 2022 10:38:00 +0000 (06:38 -0400)
commit3bdadbd51db5b741f7583c0affe55752be7c35ce
tree78deb07786853933f84d534e47524d22d83978e0
parente980d009ffd5dad35648bf8decc3e3b44e63593e
KVM: selftests: replace assertion with warning in access_tracking_perf_test

Page_idle uses {ptep/pmdp}_clear_young_notify which in turn calls
the mmu notifier callback ->clear_young(), which purposefully
does not flush the TLB.

When running the test in a nested guest, point 1. of the test
doc header is violated, because KVM TLB is unbounded by size
and since no flush is forced, KVM does not update the sptes
accessed/idle bits resulting in guest assertion failure.

More precisely, only the first ACCESS_WRITE in run_test() actually
makes visible changes, because sptes are created and the accessed
bit is set to 1 (or idle bit is 0). Then the first mark_memory_idle()
passes since access bit is still one, and sets all pages as idle
(or not accessed). When the next write is performed, the update
is not flushed therefore idle is still 1 and next mark_memory_idle()
fails.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-Id: <20220926082923.299554-1-eesposit@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/access_tracking_perf_test.c