linux-stable/tools/testing
David Matlack 40e0ee6338 KVM: selftests: Add coverage of EPT-disabled to vmx_dirty_log_test
Extend vmx_dirty_log_test to include accesses made by L2 when EPT is
disabled.

This commit adds explicit coverage of a bug caught by syzkaller, where
the TDP MMU would clear D-bits instead of write-protecting SPTEs being
used to map an L2, which only happens when L1 does not enable EPT,
causing writes made by L2 to not be reflected in the dirty log when PML
is enabled:

  $ ./vmx_dirty_log_test
  Nested EPT: disabled
  ==== Test Assertion Failure ====
    x86_64/vmx_dirty_log_test.c:151: test_bit(0, bmap)
    pid=72052 tid=72052 errno=4 - Interrupted system call
    (stack trace empty)
    Page 0 incorrectly reported clean

Opportunistically replace the volatile casts with {READ,WRITE}_ONCE().

Link: https://lore.kernel.org/kvm/000000000000c6526f06137f18cc@google.com/
Signed-off-by: David Matlack <dmatlack@google.com>
Link: https://lore.kernel.org/r/20240315230541.1635322-5-dmatlack@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
2024-04-11 12:58:52 -07:00
..
crypto/chacha20-s390
cxl cxl/test: Add support for qos_class checking 2024-02-16 23:20:34 -08:00
fault-injection
ktest ktest: force $buildonly = 1 for 'make_warnings_file' test type 2024-03-15 12:36:19 -04:00
kunit linux_kselftest-kunit-fixes-6.9-rc2 2024-03-29 15:35:12 -07:00
memblock
nvdimm
radix-tree
scatterlist
selftests KVM: selftests: Add coverage of EPT-disabled to vmx_dirty_log_test 2024-04-11 12:58:52 -07:00
vsock