Merge tag 'kvm-x86-selftests-6.5' of https://github.com/kvm-x86/linux into HEAD
authorPaolo Bonzini <pbonzini@redhat.com>
Sat, 1 Jul 2023 11:19:09 +0000 (07:19 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 1 Jul 2023 11:19:09 +0000 (07:19 -0400)
KVM selftests changes for 6.5:

 - Add a test for splitting and reconstituting hugepages during and after
   dirty logging

 - Add support for CPU pinning in demand paging test

 - Generate dependency files so that partial rebuilds work as expected

 - Misc cleanups and fixes

1  2 
tools/testing/selftests/kvm/Makefile

index 74e0a44f921649191e6828e7f1b35c9079ff52d0,de10581ea108e0851951f2571bf0426874b0fcb2..c692cc86e7da83f92f19efa48b9833701d06bc91
@@@ -61,6 -61,7 +61,7 @@@ TEST_PROGS_x86_64 += x86_64/nx_huge_pag
  # Compiled test targets
  TEST_GEN_PROGS_x86_64 = x86_64/cpuid_test
  TEST_GEN_PROGS_x86_64 += x86_64/cr4_cpuid_sync_test
+ TEST_GEN_PROGS_x86_64 += x86_64/dirty_log_page_splitting_test
  TEST_GEN_PROGS_x86_64 += x86_64/get_msr_index_features
  TEST_GEN_PROGS_x86_64 += x86_64/exit_on_emulation_failure_test
  TEST_GEN_PROGS_x86_64 += x86_64/fix_hypercall_test
@@@ -116,7 -117,6 +117,7 @@@ TEST_GEN_PROGS_x86_64 += x86_64/sev_mig
  TEST_GEN_PROGS_x86_64 += x86_64/amx_test
  TEST_GEN_PROGS_x86_64 += x86_64/max_vcpuid_cap_test
  TEST_GEN_PROGS_x86_64 += x86_64/triple_fault_event_test
 +TEST_GEN_PROGS_x86_64 += x86_64/recalc_apic_map_test
  TEST_GEN_PROGS_x86_64 += access_tracking_perf_test
  TEST_GEN_PROGS_x86_64 += demand_paging_test
  TEST_GEN_PROGS_x86_64 += dirty_log_test
@@@ -164,7 -164,6 +165,7 @@@ TEST_GEN_PROGS_s390x = s390x/memo
  TEST_GEN_PROGS_s390x += s390x/resets
  TEST_GEN_PROGS_s390x += s390x/sync_regs_test
  TEST_GEN_PROGS_s390x += s390x/tprot
 +TEST_GEN_PROGS_s390x += s390x/cmma_test
  TEST_GEN_PROGS_s390x += demand_paging_test
  TEST_GEN_PROGS_s390x += dirty_log_test
  TEST_GEN_PROGS_s390x += kvm_create_max_vcpus
@@@ -185,6 -184,8 +186,8 @@@ TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(AR
  TEST_GEN_PROGS_EXTENDED += $(TEST_GEN_PROGS_EXTENDED_$(ARCH_DIR))
  LIBKVM += $(LIBKVM_$(ARCH_DIR))
  
+ OVERRIDE_TARGETS = 1
  # lib.mak defines $(OUTPUT), prepends $(OUTPUT)/ to $(TEST_GEN_PROGS), and most
  # importantly defines, i.e. overwrites, $(CC) (unless `make -e` or `make CC=`,
  # which causes the environment variable to override the makefile).
@@@ -199,7 -200,7 +202,7 @@@ els
  LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include
  endif
  CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
-       -Wno-gnu-variable-sized-type-not-at-end \
+       -Wno-gnu-variable-sized-type-not-at-end -MD\
        -fno-builtin-memcmp -fno-builtin-memcpy -fno-builtin-memset \
        -fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \
        -I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \
@@@ -226,7 -227,18 +229,18 @@@ LIBKVM_S_OBJ := $(patsubst %.S, $(OUTPU
  LIBKVM_STRING_OBJ := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBKVM_STRING))
  LIBKVM_OBJS = $(LIBKVM_C_OBJ) $(LIBKVM_S_OBJ) $(LIBKVM_STRING_OBJ)
  
- EXTRA_CLEAN += $(LIBKVM_OBJS) cscope.*
+ TEST_GEN_OBJ = $(patsubst %, %.o, $(TEST_GEN_PROGS))
+ TEST_GEN_OBJ += $(patsubst %, %.o, $(TEST_GEN_PROGS_EXTENDED))
+ TEST_DEP_FILES = $(patsubst %.o, %.d, $(TEST_GEN_OBJ))
+ TEST_DEP_FILES += $(patsubst %.o, %.d, $(LIBKVM_OBJS))
+ -include $(TEST_DEP_FILES)
+ $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED): %: %.o
+       $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) $< $(LIBKVM_OBJS) $(LDLIBS) -o $@
+ $(TEST_GEN_OBJ): $(OUTPUT)/%.o: %.c
+       $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
+ EXTRA_CLEAN += $(LIBKVM_OBJS) $(TEST_DEP_FILES) $(TEST_GEN_OBJ) cscope.*
  
  x := $(shell mkdir -p $(sort $(dir $(LIBKVM_C_OBJ) $(LIBKVM_S_OBJ))))
  $(LIBKVM_C_OBJ): $(OUTPUT)/%.o: %.c