diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2020-06-23 03:29:56 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-06-23 03:29:56 -0400 |
commit | ca5efa6a3ed3b94776383eccfca3255f9745a8d7 (patch) | |
tree | ab7aae006386627d9f16bf6410e229cf855d5ea0 | |
parent | c88b7beaafd711e0ca98529a56c9d35eedc60b5f (diff) | |
parent | 9d7f9a2f0b3427bbeda242c64f698d14e21d2a42 (diff) | |
download | kvm-unit-tests-ca5efa6a3ed3b94776383eccfca3255f9745a8d7.tar.gz |
Merge tag 'pull-request-2020-06-16' of https://gitlab.com/huth/kvm-unit-tests
* Lots of CI-related fixes and improvements
* Update the gitlab-CI to Fedora 32
* Test compilation with Clang
-rw-r--r-- | .gitlab-ci.yml | 17 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | lib/auxinfo.h | 3 | ||||
-rw-r--r-- | powerpc/flat.lds | 19 | ||||
-rw-r--r-- | s390x/stsi.c | 6 | ||||
-rw-r--r-- | x86/Makefile.common | 1 | ||||
-rw-r--r-- | x86/svm_tests.c | 2 | ||||
-rw-r--r-- | x86/vmx_tests.c | 10 |
8 files changed, 45 insertions, 15 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3093239..3af53f0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: fedora:30 +image: fedora:32 before_script: - dnf update -y @@ -77,6 +77,19 @@ build-i386: - ./configure --arch=i386 - make -j2 - ACCEL=tcg ./run_tests.sh - cmpxchg8b eventinj port80 setjmp sieve tsc taskswitch taskswitch2 umip + cmpxchg8b eventinj port80 setjmp sieve tsc taskswitch umip | tee results.txt - if grep -q FAIL results.txt ; then exit 1 ; fi + +build-clang: + script: + - dnf install -y qemu-system-x86 clang + - ./configure --arch=x86_64 --cc=clang + - make -j2 + - ACCEL=tcg ./run_tests.sh + smptest smptest3 vmexit_cpuid vmexit_mov_from_cr8 + vmexit_mov_to_cr8 vmexit_inl_pmtimer vmexit_ipi vmexit_ipi_halt + vmexit_ple_round_robin vmexit_tscdeadline vmexit_tscdeadline_immed + eventinj msr port80 setjmp syscall tsc rmap_chain umip intel_iommu + | tee results.txt + - grep -q PASS results.txt && ! grep -q FAIL results.txt @@ -49,7 +49,7 @@ include $(SRCDIR)/$(TEST_DIR)/Makefile cc-option = $(shell if $(CC) -Werror $(1) -S -o /dev/null -xc /dev/null \ > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) -COMMON_CFLAGS += -g $(autodepend-flags) -fno-strict-aliasing +COMMON_CFLAGS += -g $(autodepend-flags) -fno-strict-aliasing -fno-common COMMON_CFLAGS += -Wall -Wwrite-strings -Wempty-body -Wuninitialized COMMON_CFLAGS += -Wignored-qualifiers -Werror diff --git a/lib/auxinfo.h b/lib/auxinfo.h index 08b96f8..a46a1e6 100644 --- a/lib/auxinfo.h +++ b/lib/auxinfo.h @@ -13,7 +13,6 @@ struct auxinfo { unsigned long flags; }; -/* No extern! Define a common symbol. */ -struct auxinfo auxinfo; +extern struct auxinfo auxinfo; #endif #endif diff --git a/powerpc/flat.lds b/powerpc/flat.lds index 53221e8..5eed368 100644 --- a/powerpc/flat.lds +++ b/powerpc/flat.lds @@ -1,7 +1,17 @@ +PHDRS +{ + text PT_LOAD FLAGS(5); + data PT_LOAD FLAGS(6); +} + SECTIONS { - .text : { *(.init) *(.text) *(.text.*) } + .text : { + *(.init) + *(.text) + *(.text.*) + } :text . = ALIGN(64K); etext = .; .opd : { *(.opd) } @@ -19,9 +29,12 @@ SECTIONS .data : { *(.data) *(.data.rel*) - } + } :data . = ALIGN(16); - .rodata : { *(.rodata) *(.rodata.*) } + .rodata : { + *(.rodata) + *(.rodata.*) + } :data . = ALIGN(16); .bss : { *(.bss) } . = ALIGN(256); diff --git a/s390x/stsi.c b/s390x/stsi.c index 66b4257..b81cea7 100644 --- a/s390x/stsi.c +++ b/s390x/stsi.c @@ -129,11 +129,11 @@ static void test_3_2_2(void) } report(!memcmp(data->vm[0].uuid, uuid, sizeof(uuid)), "uuid"); - report(data->vm[0].conf_cpus == smp_query_num_cpus(), "cpu # configured"); + report(data->vm[0].conf_cpus == smp_query_num_cpus(), "cpu count configured"); report(data->vm[0].total_cpus == data->vm[0].reserved_cpus + data->vm[0].conf_cpus, - "cpu # total == conf + reserved"); - report(data->vm[0].standby_cpus == 0, "cpu # standby"); + "cpu count total == conf + reserved"); + report(data->vm[0].standby_cpus == 0, "cpu count standby"); report(!memcmp(data->vm[0].name, vm_name, sizeof(data->vm[0].name)), "VM name == kvm-unit-test"); diff --git a/x86/Makefile.common b/x86/Makefile.common index ab67ca0..2ea9c9f 100644 --- a/x86/Makefile.common +++ b/x86/Makefile.common @@ -5,6 +5,7 @@ all: directories test_cases cflatobjs += lib/pci.o cflatobjs += lib/pci-edu.o cflatobjs += lib/alloc.o +cflatobjs += lib/auxinfo.o cflatobjs += lib/vmalloc.o cflatobjs += lib/alloc_page.o cflatobjs += lib/alloc_phys.o diff --git a/x86/svm_tests.c b/x86/svm_tests.c index 89ce214..610685b 100644 --- a/x86/svm_tests.c +++ b/x86/svm_tests.c @@ -890,7 +890,7 @@ static bool npt_rw_l1mmio_check(struct svm_test *test) } #define TSC_ADJUST_VALUE (1ll << 32) -#define TSC_OFFSET_VALUE (-1ll << 48) +#define TSC_OFFSET_VALUE (~0ull << 48) static bool ok; static void tsc_adjust_prepare(struct svm_test *test) diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c index df722ff..9fec0f7 100644 --- a/x86/vmx_tests.c +++ b/x86/vmx_tests.c @@ -2253,7 +2253,9 @@ static void into_guest_main(void) .offset = (uintptr_t)&&into, .selector = KERNEL_CS32, }; - register uintptr_t rsp asm("rsp"); + uintptr_t rsp; + + asm volatile ("mov %%rsp, %0" : "=r"(rsp)); if (fp.offset != (uintptr_t)&&into) { printf("Code address too high.\n"); @@ -3349,7 +3351,9 @@ static void try_compat_invvpid(void *unused) .offset = (uintptr_t)&&invvpid, .selector = KERNEL_CS32, }; - register uintptr_t rsp asm("rsp"); + uintptr_t rsp; + + asm volatile ("mov %%rsp, %0" : "=r"(rsp)); TEST_ASSERT_MSG(fp.offset == (uintptr_t)&&invvpid, "Code address too high."); @@ -8544,7 +8548,7 @@ static void vmx_preemption_timer_zero_test(void) * an event that you injected. */ vmx_set_test_stage(1); - vmx_preemption_timer_zero_inject_db(1 << DB_VECTOR); + vmx_preemption_timer_zero_inject_db(true); vmx_preemption_timer_zero_expect_preempt_at_rip(db_fault_address); vmx_preemption_timer_zero_advance_past_vmcall(); |