Merge tag 'kvm-x86-selftests_utils-6.10' of https://github.com/kvm-x86/linux into...
authorPaolo Bonzini <pbonzini@redhat.com>
Sun, 12 May 2024 07:18:11 +0000 (03:18 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Sun, 12 May 2024 07:18:11 +0000 (03:18 -0400)
KVM selftests treewide updates for 6.10:

 - Define _GNU_SOURCE for all selftests to fix a warning that was introduced by
   a change to kselftest_harness.h late in the 6.9 cycle, and because forcing
   every test to #define _GNU_SOURCE is painful.

 - Provide a global psuedo-RNG instance for all tests, so that library code can
   generate random, but determinstic numbers.

 - Use the global pRNG to randomly force emulation of select writes from guest
   code on x86, e.g. to help validate KVM's emulation of locked accesses.

 - Rename kvm_util_base.h back to kvm_util.h, as the weird layer of indirection
   was added purely to avoid manually #including ucall_common.h in a handful of
   locations.

 - Allocate and initialize x86's GDT, IDT, TSS, segments, and default exception
   handlers at VM creation, instead of forcing tests to manually trigger the
   related setup.

21 files changed:
1  2 
tools/testing/selftests/kvm/Makefile
tools/testing/selftests/kvm/aarch64/arch_timer.c
tools/testing/selftests/kvm/aarch64/page_fault_test.c
tools/testing/selftests/kvm/aarch64/psci_test.c
tools/testing/selftests/kvm/aarch64/vgic_init.c
tools/testing/selftests/kvm/demand_paging_test.c
tools/testing/selftests/kvm/dirty_log_perf_test.c
tools/testing/selftests/kvm/include/aarch64/processor.h
tools/testing/selftests/kvm/include/userfaultfd_util.h
tools/testing/selftests/kvm/lib/kvm_util.c
tools/testing/selftests/kvm/lib/riscv/processor.c
tools/testing/selftests/kvm/lib/userfaultfd_util.c
tools/testing/selftests/kvm/max_guest_memory_test.c
tools/testing/selftests/kvm/riscv/arch_timer.c
tools/testing/selftests/kvm/rseq_test.c
tools/testing/selftests/kvm/set_memory_region_test.c
tools/testing/selftests/kvm/steal_time.c
tools/testing/selftests/kvm/x86_64/monitor_mwait_test.c
tools/testing/selftests/kvm/x86_64/pmu_counters_test.c
tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c
tools/testing/selftests/kvm/x86_64/xen_shinfo_test.c

Simple merge
index 89be559cdb7ecfefcf5a062a68d751a1f626c056,02967318caf4523ca01ad2554407f1ce0aa07282..eeba1cc87ff82bb6f93b98a51f6c9702fe0e2a70
  #include "gic.h"
  #include "processor.h"
  #include "timer_test.h"
+ #include "ucall_common.h"
  #include "vgic.h"
  
 -#define GICD_BASE_GPA                 0x8000000ULL
 -#define GICR_BASE_GPA                 0x80A0000ULL
 -
  enum guest_stage {
        GUEST_STAGE_VTIMER_CVAL = 1,
        GUEST_STAGE_VTIMER_TVAL,
index 9fa3578d47d5308057c82ff28ae0ff2083f70fa5,1c8c6f0c1ca30c863bfd82d71cb5ba530a36d161..61731a950def93ef5fcc06ae02ac34da5069000c
   *  - A test for KVM's handling of PSCI SYSTEM_SUSPEND and the associated
   *    KVM_SYSTEM_EVENT_SUSPEND UAPI.
   */
- #define _GNU_SOURCE
 +
 +#include <linux/kernel.h>
  #include <linux/psci.h>
 +#include <asm/cputype.h>
  
  #include "kvm_util.h"
  #include "processor.h"