Skip to contentSkip to conversation

s390x: Fixup test fencing

PATCH In review Janosch Frank 2 participants 4 messages Aug 4 – Aug 6

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover s390x: Fixup test fencing

Migration tests have been fenced for way too long in TCG due to a TCG bug that has been fixed ages ago.

The skey access tests will always fail in TCG so it makes more sense to fence them in the test itself rather than to filter the CI results so that humans won't see the fail.

Janosch Frank (2):
s390x: unittests: Reenable tcg for migration tests
s390x: skey: Fence TCG protection checks

 s390x/skey.c        | 8 ++++++++
 s390x/unittests.cfg | 5 -----
 2 files changed, 8 insertions(+), 5 deletions(-)
Signature · 1 line
2.53.0
#1 lore raw

PATCH 1/2 s390x: unittests: Reenable tcg for migration tests

The TCG fixes for this issue have been in QEMU for quite a while. It's time to reenable these tests.

QEMU fix discussion:
https://lore.kernel.org/qemu-devel/[email protected]/

---
 s390x/unittests.cfg | 5 -----
 1 file changed, 5 deletions(-)
s390x/unittests.cfg +0 -5
index 8c39d4f1..64bc998d 100644
@@ -15,19 +15,14 @@ test_args = 'test 123'
 [selftest-migration]
 file = selftest-migration.elf
 groups = selftest migration
-# TODO: Remove accel=kvm once the following TCG migration fix has been merged:
-# https://lore.kernel.org/qemu-devel/[email protected]/
-accel = kvm
 
 [selftest-migration-skip]
 file = selftest-migration.elf
 groups = selftest migration
 test_args = "skip"
 
-# This fails due to a QEMU TCG bug so KVM-only until QEMU is fixed upstream
 [migration-memory]
 file = memory-verify.elf
-accel = kvm
 groups = migration
 
 [intercept]
Signature · 1 line
2.53.0
#2 lore raw

PATCH 2/2 s390x: skey: Fence TCG protection checks

In reply to Janosch Frank

TCG does not implement the skey memory protection, skip those tests under TCG instead of filtering them in the CI logs.

This way the test will PASS when run by humans and there's no confusion why it fails anymore.

---
 s390x/skey.c | 8 ++++++++
 1 file changed, 8 insertions(+)
s390x/skey.c +8 -0
index bb769730..1fc95857 100644
@@ -14,6 +14,7 @@
 #include <vmalloc.h>
 #include <css.h>
 #include <mmu.h>
+#include <hardware.h>
 #include <asm/page.h>
 #include <asm/facility.h>
 #include <asm/mem.h>
@@ -736,6 +737,13 @@ int main(void)
 	test_set();
 	test_set_mb();
 	test_chg();
+
+	if  (detect_host() == HOST_IS_TCG) {
+		report_skip("No actual access protection in TCG for skeys.");
+		report_prefix_pop();
+		return report_summary();
+	}
+
 	test_test_protection();
 	test_store_cpu_address();
 	test_diag_308();
Signature · 1 line
2.53.0
Reviewed-by on v1 2/2
#3 lore raw

Re: [kvm-unit-tests 2/2] s390x: skey: Fence TCG protection checks

Quoted 7 lines · On Tue, 4 Aug 2026 14:16:29 +0000 Janosch Frank <[email protected]> wrote:

TCG does not implement the skey memory protection, skip those tests under TCG instead of filtering them in the CI logs.

This way the test will PASS when run by humans and there's no confusion why it fails anymore.

Quoted 30 lines
---
 s390x/skey.c | 8 ++++++++
 1 file changed, 8 insertions(+)
s390x/skey.c +8 -0
index bb769730..1fc95857 100644
@@ -14,6 +14,7 @@
 #include <vmalloc.h>
 #include <css.h>
 #include <mmu.h>
+#include <hardware.h>
 #include <asm/page.h>
 #include <asm/facility.h>
 #include <asm/mem.h>
@@ -736,6 +737,13 @@ int main(void)
 	test_set();
 	test_set_mb();
 	test_chg();
+
+	if  (detect_host() == HOST_IS_TCG) {
+		report_skip("No actual access protection in TCG for skeys.");
+		report_prefix_pop();
+		return report_summary();
+	}
+
 	test_test_protection();
 	test_store_cpu_address();
 	test_diag_308();