Skip to contentSkip to conversation

s390x updates and gitlab-ci file

GIT PULL Thomas Huth 1 participant 5 messages Apr 19, 2019 KVM

lore
Share & tools
lore
#0 lore raw

Hi Paolo, hi Radim,

the following changes since commit 764aa0b88d9556520457f13b38d5cea21600545b:

arm: powerpc: comment halt(code) (2019-04-09 18:31:45 +0200)

are available in the Git repository at:

https://gitlab.com/huth/kvm-unit-tests.git tags/pull-request-2019-04-19

for you to fetch changes up to dd09573b27c929eb7ff6cd366638049daae5f5ea:

Add a .gitlab-ci.yml file for automatic CI testing on GitLab instances (2019-04-18 10:02:31 +0200)

----------------------------------------------------------------
- New test for s390x that checks the diag 0x308 hypercall
- Skip a known failure (crash) on z/VM in the "skey" test
- Ignore *.bin files in the s390x folder
- Enable CI on gitlab repos
----------------------------------------------------------------

Thomas Huth (4):

      Add s390x/*.bin to the .gitignore file
      s390x/skey: Skip the "iske" test when running under z/VM 6
      s390x: Add a test for the diagnose 0x308 hypercall
      Add a .gitlab-ci.yml file for automatic CI testing on GitLab instances
 .gitignore          |   1 +
 .gitlab-ci.yml      |  75 ++++++++++++++++++++++++++++++
 s390x/Makefile      |   1 +
 s390x/diag308.c     | 130 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 s390x/skey.c        |  55 ++++++++++++++++++++--
 s390x/unittests.cfg |   3 ++
 6 files changed, 261 insertions(+), 4 deletions(-)
 create mode 100644 .gitlab-ci.yml
 create mode 100644 s390x/diag308.c
#1 lore raw

[kvm-unit-tests PULL 3/4] s390x: Add a test for the diagnose 0x308 hypercall

The original idea for this test is to have an easy way to check for a problem that has been fixed in QEMU recently: QEMU simply aborted if this diagnose call was called with an unsupported subcode (e.g. 2). The problem has been fixed in QEMU commit 37dbd1f4d4805edcd18d94eb202bb3461b3cd52d ("Return specification exception for unimplemented diag 308 subcodes"), and this test now should make sure that we do not regress here again. While we're at it, also check whether LOAD NORMAL via subcode 1 works correctly, whether the diagnose call is blocked correctly in problem state and whether subcodes 5 and 6 are generating specification exceptions for illegal parameters as expected.

---
 s390x/Makefile      |   1 +
 s390x/diag308.c     | 130 ++++++++++++++++++++++++++++++++++++++++++++
 s390x/unittests.cfg |   3 +
 3 files changed, 134 insertions(+)
 create mode 100644 s390x/diag308.c
s390x/Makefile +1 -0
index af40fd4..1f21ddb 100644
@@ -5,6 +5,7 @@ tests += $(TEST_DIR)/sieve.elf
 tests += $(TEST_DIR)/sthyi.elf
 tests += $(TEST_DIR)/skey.elf
 tests += $(TEST_DIR)/diag10.elf
+tests += $(TEST_DIR)/diag308.elf
 tests += $(TEST_DIR)/pfmf.elf
 tests += $(TEST_DIR)/cmm.elf
 tests += $(TEST_DIR)/vector.elf
s390x/diag308.c new file +130 -0

130 lines not on this page · raw message

s390x/unittests.cfg +3 -0
index e53c365..546b1f2 100644
@@ -44,6 +44,9 @@ file = skey.elf
 [diag10]
 file = diag10.elf
 
+[diag308]
+file = diag308.elf
+
 [pfmf]
 file = pfmf.elf
 
Signature · 1 line
2.21.0
#2 lore raw

[kvm-unit-tests PULL 1/4] Add s390x/*.bin to the .gitignore file

In reply to Thomas Huth

Since commit 1a4cd2f22a48b8de53ef9e46afb8 ("s390x: Add binary generation to makefile") we are also generating *.bin files from the *.elf files in the s390x directory. Add them to the .gitignore file so that they do not show up in the output of "git status" anymore.

---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)
.gitignore +1 -0
index 483f7c7..784cb2d 100644
@@ -21,3 +21,4 @@ cscope.*
 /api/api-sample
 /api/dirty-log
 /api/dirty-log-perf
+/s390x/*.bin
Signature · 1 line
2.21.0
#3 lore raw

[kvm-unit-tests PULL 4/4] Add a .gitlab-ci.yml file for automatic CI testing on GitLab instances

In reply to Thomas Huth

When changing common code of the kvm-unit-tests, one should make sure that the tests still compile fine for all target architectures afterwards. But compiling kvm-unit-tests for all target architectures manually is cumbersome. For people like me who store their git trees on GitLab, this can be done automatically via a CI system instead. Using the .gitlab-ci.yml file, auto- matic builds are now triggered on each push to a kvm-unit-test repository on gitlab.com. Additionally, the script also runs the tests that can be executed with QEMU TCG (except for s390x, since the QEMU package of the CI container currently does not provide the required s390-ccw bios here).

---
 .gitlab-ci.yml | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 75 insertions(+)
 create mode 100644 .gitlab-ci.yml
.gitlab-ci.yml new file +75 -0
new file mode 100644
index 0000000..50a1e39
@@ -0,0 +1,75 @@
+before_script:
+ - apt-get update -qq
+ - apt-get install -y -qq qemu-system
+
+build-aarch64:
+ script:
+ - apt-get install -y -qq gcc-aarch64-linux-gnu
+ - ./configure --arch=aarch64 --cross-prefix=aarch64-linux-gnu-
+ - make -j2
+ - ACCEL=tcg ./run_tests.sh
+     selftest-setup selftest-vectors-kernel selftest-vectors-user selftest-smp
+     pci-test pmu gicv2-active gicv3-active psci timer
+     | tee results.txt
+ - if grep -q FAIL results.txt ; then exit 1 ; fi
+
+build-arm:
+ script:
+ - apt-get install -y -qq gcc-arm-linux-gnueabi
+ - ./configure --arch=arm --cross-prefix=arm-linux-gnueabi-
+ - make -j2
+ - ACCEL=tcg ./run_tests.sh
+     selftest-setup selftest-vectors-kernel selftest-vectors-user selftest-smp
+     pci-test pmu gicv2-active gicv3-active psci
+     | tee results.txt
+ - if grep -q FAIL results.txt ; then exit 1 ; fi
+
+build-ppc64be:
+ script:
+ - apt-get install -y -qq gcc-powerpc64-linux-gnu
+ - ./configure --arch=ppc64 --endian=big --cross-prefix=powerpc64-linux-gnu-
+ - make -j2
+ - ACCEL=tcg ./run_tests.sh
+     selftest-setup spapr_hcall rtas-get-time-of-day rtas-get-time-of-day-base
+     rtas-set-time-of-day emulator
+     | tee results.txt
+ - if grep -q FAIL results.txt ; then exit 1 ; fi
+
+build-ppc64le:
+ script:
+ - apt-get install -y -qq gcc-powerpc64-linux-gnu
+ - ./configure --arch=ppc64 --endian=little --cross-prefix=powerpc64-linux-gnu-
+ - make -j2
+ - ACCEL=tcg ./run_tests.sh
+     selftest-setup spapr_hcall rtas-get-time-of-day rtas-get-time-of-day-base
+     rtas-set-time-of-day emulator
+     | tee results.txt
+ - if grep -q FAIL results.txt ; then exit 1 ; fi
+
+build-s390x:
+ script:
+ - apt-get install -y -qq gcc-s390x-linux-gnu
+ - ./configure --arch=s390x --cross-prefix=s390x-linux-gnu-
+ - make -j2
+
+build-x86_64:
+ script:
+ - ./configure --arch=x86_64
+ - make -j2
+ - ACCEL=tcg ./run_tests.sh
+     ioapic-split ioapic 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 sieve tsc rmap_chain umip hyperv_stimer intel_iommu
+     | tee results.txt
+ - if grep -q FAIL results.txt ; then exit 1 ; fi
+
+build-i386:
+ script:
+ - apt-get install -y -qq gcc-multilib
+ - ./configure --arch=i386
+ - make -j2
+ - ACCEL=tcg ./run_tests.sh
+     eventinj port80 sieve tsc taskswitch umip hyperv_stimer
+     | tee results.txt
+ - if grep -q FAIL results.txt ; then exit 1 ; fi
Signature · 1 line
2.21.0
#4 lore raw

[kvm-unit-tests PULL 2/4] s390x/skey: Skip the "iske" test when running under z/VM 6

In reply to Thomas Huth

There is a known bug of z/VM 6 which causes the "iske" test to fail. Since it is still sometimes useful to run the kvm-unit-tests in such a nested environment, let's rather skip the "iske" test there instead of always reporting a failure.

---
 s390x/skey.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 51 insertions(+), 4 deletions(-)
s390x/skey.c +51 -4
index f4894f1..b1e11af 100644
@@ -70,9 +70,51 @@ static void test_set(void)
 	       skey.str.acc == ret.str.acc && skey.str.fp == ret.str.fp);
 }
 
+static inline int stsi(void *addr, int fc, int sel1, int sel2)
+{
+	register int r0 asm("0") = (fc << 28) | sel1;
+	register int r1 asm("1") = sel2;
+	int rc = 0;
+
+	asm volatile(
+		"	stsi	0(%3)\n"
+		"	jz	0f\n"
+		"	lhi	%1,-1\n"
+		"0:\n"
+		: "+d" (r0), "+d" (rc)
+		: "d" (r1), "a" (addr)
+		: "cc", "memory");
+
+	return rc;
+}
+
+/* Returns true if we are running under z/VM 6.x */
+static bool check_for_zvm6(void)
+{
+	int dcbt;	/* Descriptor block count */
+	int nr;
+	static const unsigned char zvm6[] = {
+		/* This is "z/VM    6" in EBCDIC */
+		0xa9, 0x61, 0xe5, 0xd4, 0x40, 0x40, 0x40, 0x40, 0xf6
+	};
+
+	if (stsi(pagebuf, 3, 2, 2))
+		return false;
+
+	dcbt = pagebuf[31] & 0xf;
+
+	for (nr = 0; nr < dcbt; nr++) {
+		if (!memcmp(&pagebuf[32 + nr * 64 + 24], zvm6, sizeof(zvm6)))
+			return true;
+	}
+
+	return false;
+}
+
 static void test_priv(void)
 {
 	union skey skey;
+	bool is_zvm6 = check_for_zvm6();
 
 	memset(pagebuf, 0, PAGE_SIZE * 2);
 	report_prefix_push("privileged");
@@ -87,10 +129,15 @@ static void test_priv(void)
 	report("skey did not change on exception", skey.str.acc != 3);
 
 	report_prefix_push("iske");
-	expect_pgm_int();
-	enter_pstate();
-	get_storage_key(page0);
-	check_pgm_int_code(PGM_INT_CODE_PRIVILEGED_OPERATION);
+	if (is_zvm6) {
+		/* There is a known bug with z/VM 6, so skip the test there */
+		report_skip("not working on z/VM 6");
+	} else {
+		expect_pgm_int();
+		enter_pstate();
+		get_storage_key(page0);
+		check_pgm_int_code(PGM_INT_CODE_PRIVILEGED_OPERATION);
+	}
 	report_prefix_pop();
 
 	report_prefix_pop();
Signature · 1 line
2.21.0