mirror-linux/tools/testing/selftests/kvm
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
..
aarch64 KVM/riscv fixes for 6.9, take #1 2024-04-02 12:29:51 -04:00
include Fix a bug in KVM_SET_CPUID{2,} where KVM looks at the wrong CPUID entries (old 2024-03-18 19:19:08 -04:00
lib KVM x86 PMU changes for 6.9: 2024-03-11 10:41:09 -04:00
riscv KVM: selftests: Fix spelling mistake "trigged" -> "triggered" 2024-03-25 14:14:21 +05:30
s390x S390: 2024-03-15 13:03:13 -07:00
x86_64 KVM: selftests: Add coverage of EPT-disabled to vmx_dirty_log_test 2024-04-11 12:58:52 -07:00
.gitignore KVM: selftests: Use pattern matching in .gitignore 2022-12-27 06:00:46 -05:00
Makefile selftests: kvm: remove meaningless assignments in Makefiles 2024-03-15 06:52:55 -04:00
access_tracking_perf_test.c Merge remote-tracking branch 'kvm/queue' into HEAD 2022-12-12 15:54:07 -05:00
arch_timer.c KVM: riscv: selftests: Add sstc timer test 2024-03-06 20:53:29 +05:30
config KVM: selftests: Fixup config fragment for access_tracking_perf_test 2023-03-30 19:27:56 +01:00
demand_paging_test.c KVM: selftests: Remove redundant newlines 2024-01-29 08:39:14 -08:00
dirty_log_perf_test.c KVM: selftests: Remove redundant newlines 2024-01-29 08:39:14 -08:00
dirty_log_test.c KVM: selftests: Fix a semaphore imbalance in the dirty ring logging test 2024-02-06 10:53:30 -08:00
get-reg-list.c KVM: selftests: Remove redundant newlines 2024-01-29 08:39:14 -08:00
guest_memfd_test.c KVM: selftests: Explicitly close guest_memfd files in some gmem tests 2024-03-05 13:31:20 -08:00
guest_print_test.c KVM: selftests: Remove redundant newlines 2024-01-29 08:39:14 -08:00
hardware_disable_test.c KVM: selftests: Remove redundant newlines 2024-01-29 08:39:14 -08:00
kvm_binary_stats_test.c KVM: selftests: Verify stats fd is usable after VM fd has been closed 2023-07-29 11:05:30 -04:00
kvm_create_max_vcpus.c KVM: selftests: Remove redundant newlines 2024-01-29 08:39:14 -08:00
kvm_page_table_test.c KVM: selftests: Remove redundant newlines 2024-01-29 08:39:14 -08:00
max_guest_memory_test.c KVM: selftests: fix max_guest_memory_test with more that 256 vCPUs 2024-04-08 13:21:40 -07:00
memslot_modification_stress_test.c KVM: selftests: Remove redundant newlines 2024-01-29 08:39:14 -08:00
memslot_perf_test.c KVM: selftests: Remove redundant newlines 2024-01-29 08:39:14 -08:00
rseq_test.c KVM: selftests: Remove redundant newlines 2024-01-29 08:39:14 -08:00
set_memory_region_test.c KVM: selftests: fix supported_flags for riscv 2024-04-08 13:22:08 -07:00
settings
steal_time.c RISC-V: KVM: selftests: Add steal_time test support 2023-12-30 11:26:45 +05:30
system_counter_offset_test.c KVM: selftests: Remove redundant newlines 2024-01-29 08:39:14 -08:00