Skip to contentSkip to conversation

s390x: Pipeline and other minor fixes

PATCH In review Claudio Imbrenda 2 participants 6 messages Jul 21, 2022

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

v2 cover s390x: Pipeline and other minor fixes

The first patch fences a test when using TCG. When using Qemu < 7.1, TCG would crash. This causes the CI pipeline to fail. Fence the testcase when using TCG to get the CI pipeline to work.

The second patch adds some report_prefix_push/report_prefix_pop around some of the new testcases to make each output line unique.

Claudio Imbrenda (2):
s390x: intercept: fence one test when using TCG
s390x: intercept: make sure all output lines are unique

 s390x/intercept.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
Signature · 1 line
2.36.1
#1 lore raw

PATCH v2 1/2 s390x: intercept: fence one test when using TCG

Qemu commit f8333de2793 ("target/s390x/tcg: SPX: check validity of new prefix") fixes a TCG bug discovered with a new testcase in the intercept test.

The gitlab pipeline for the KVM unit tests uses TCG and it will keep failing every time as long as the pipeline uses a version of Qemu without the aforementioned patch.

Fence the specific testcase for now. Once the pipeline is fixed, this patch can safely be reverted.

This patch is meant to go on top this already queued patch from Janis:
"s390x/intercept: Test invalid prefix argument to SET PREFIX"
https://lore.kernel.org/all/[email protected]/

---
 s390x/intercept.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
s390x/intercept.c +7 -2
index 54bed5a4..656b8adb 100644
@@ -14,6 +14,7 @@
 #include <asm/page.h>
 #include <asm/facility.h>
 #include <asm/time.h>
+#include <hardware.h>
 
 static uint8_t pagebuf[PAGE_SIZE * 2] __attribute__((aligned(PAGE_SIZE * 2)));
 
@@ -76,7 +77,8 @@ static void test_spx(void)
 	check_pgm_int_code(PGM_INT_CODE_ADDRESSING);
 
 	new_prefix = get_ram_size() & 0x7fffe000;
-	if (get_ram_size() - new_prefix < 2 * PAGE_SIZE) {
+	/* TODO: Remove host_is_tcg() checks once CIs are using QEMU >= 7.1 */
+	if (!host_is_tcg() && (get_ram_size() - new_prefix < 2 * PAGE_SIZE)) {
 		expect_pgm_int();
 		asm volatile("spx	%0 " : : "Q"(new_prefix));
 		check_pgm_int_code(PGM_INT_CODE_ADDRESSING);
@@ -88,7 +90,10 @@ static void test_spx(void)
 		 * the address to 8k we have a completely accessible area.
 		 */
 	} else {
-		report_skip("inaccessible prefix area");
+		if (host_is_tcg())
+			report_skip("inaccessible prefix area (workaround for TCG bug)");
+		else
+			report_skip("inaccessible prefix area");
 	}
 }
 
Signature · 1 line
2.36.1
Reviewed-by on v2 1/2
#2 lore raw

Re: [PATCH v2 1/2] s390x: intercept: fence one test when using TCG

Quoted 7 lines · Claudio Imbrenda

Qemu commit f8333de2793 ("target/s390x/tcg: SPX: check validity of new prefix") fixes a TCG bug discovered with a new testcase in the intercept test.

The gitlab pipeline for the KVM unit tests uses TCG and it will keep failing every time as long as the pipeline uses a version of Qemu without the aforementioned patch.

Quoted 6 lines

Fence the specific testcase for now. Once the pipeline is fixed, this patch can safely be reverted.

This patch is meant to go on top this already queued patch from Janis:
"s390x/intercept: Test invalid prefix argument to SET PREFIX"
https://lore.kernel.org/all/[email protected]/

If we keep this as a separate patch, that paragraph should be removed from the commit description.

Anyway:

#3 lore raw

Re: [PATCH v2 1/2] s390x: intercept: fence one test when using TCG

Quoted 11 lines · On Thu, 21 Jul 2022 15:41:30 +0200 Thomas Huth <[email protected]> wrote:
Quoted 10 lines · Claudio Imbrenda

Qemu commit f8333de2793 ("target/s390x/tcg: SPX: check validity of new prefix") fixes a TCG bug discovered with a new testcase in the intercept test.

The gitlab pipeline for the KVM unit tests uses TCG and it will keep failing every time as long as the pipeline uses a version of Qemu without the aforementioned patch.

Fence the specific testcase for now. Once the pipeline is fixed, this patch can safely be reverted.

Quoted 6 lines
Quoted 3 lines

This patch is meant to go on top this already queued patch from Janis:
"s390x/intercept: Test invalid prefix argument to SET PREFIX"
https://lore.kernel.org/all/[email protected]/

If we keep this as a separate patch, that paragraph should be removed from the commit description.

yeah that will be removed

Quoted 5 lines

Anyway:

thanks!

#4 lore raw

PATCH v2 2/2 s390x: intercept: make sure all output lines are unique

In reply to Claudio Imbrenda

The intercept test has the same output line twice for two different testcases.

Fix this by adding report_prefix_push() as appropriate.

---
 s390x/intercept.c | 6 ++++++
 1 file changed, 6 insertions(+)
s390x/intercept.c +6 -0
index 656b8adb..9e826b6c 100644
@@ -68,14 +68,19 @@ static void test_spx(void)
 	set_prefix(old_prefix);
 	report(pagebuf[GEN_LC_STFL] != 0, "stfl to new prefix");
 
+	report_prefix_push("operand not word aligned");
 	expect_pgm_int();
 	asm volatile(" spx 0(%0) " : : "r"(1));
 	check_pgm_int_code(PGM_INT_CODE_SPECIFICATION);
+	report_prefix_pop();
 
+	report_prefix_push("operand outside memory");
 	expect_pgm_int();
 	asm volatile(" spx 0(%0) " : : "r"(-8L));
 	check_pgm_int_code(PGM_INT_CODE_ADDRESSING);
+	report_prefix_pop();
 
+	report_prefix_push("new prefix outside memory");
 	new_prefix = get_ram_size() & 0x7fffe000;
 	/* TODO: Remove host_is_tcg() checks once CIs are using QEMU >= 7.1 */
 	if (!host_is_tcg() && (get_ram_size() - new_prefix < 2 * PAGE_SIZE)) {
@@ -95,6 +100,7 @@ static void test_spx(void)
 		else
 			report_skip("inaccessible prefix area");
 	}
+	report_prefix_pop();
 }
 
 /* Test the STORE CPU ADDRESS instruction */
Signature · 1 line
2.36.1
Reviewed-by on v2 2/2
#5 lore raw

Re: [PATCH v2 2/2] s390x: intercept: make sure all output lines are unique

Quoted 9 lines · Claudio Imbrenda

The intercept test has the same output line twice for two different testcases.

Fix this by adding report_prefix_push() as appropriate.

---
  s390x/intercept.c | 6 ++++++
  1 file changed, 6 insertions(+)