Skip to contentSkip to conversation

s390x: intercept: fence one test when using TCG

PATCH Superseded Claudio Imbrenda 3 participants 3 messages Jul 21, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 s390x/intercept.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
s390x/intercept.c +2 -1
index 54bed5a4..c48818c2 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,7 @@ 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) {
+	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);
Signature · 1 line
2.36.1
#1 lore raw
Quoted 28 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.

---
  s390x/intercept.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
s390x/intercept.c +1 -0
index 54bed5a4..c48818c2 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)));
 

s390x/intercept.c static void test_spx(void) · line 80

Quoted 5 lines
s390x/intercept.c +1 -1
@@ -76,7 +77,7 @@ 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) {
+	if (!host_is_tcg() && (get_ram_size() - new_prefix < 2 * PAGE_SIZE)) {

Could you please add a comment à la

/* TODO: Remove host_is_tcg() once CIs are using QEMU >= 7.1 */

?

Thomas

#2 lore raw
In reply to Claudio Imbrenda
Quoted 28 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.

---
  s390x/intercept.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
s390x/intercept.c +1 -0
index 54bed5a4..c48818c2 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)));
 

s390x/intercept.c static void test_spx(void) · line 80

Quoted 5 lines
s390x/intercept.c +1 -1
@@ -76,7 +77,7 @@ 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) {
+	if (!host_is_tcg() && (get_ram_size() - new_prefix < 2 * PAGE_SIZE)) {

I'm ok with this if we also do a report_skip() that states that we skip because of a QEMU bug which will lead to a SIGABORT.

I don't see an easy way to fence this more precisely. We could pass the QEMU version and check it but there are also backports to consider. So it's not a one size fits all solution...

Quoted 3 lines
s390x/intercept.c +0 -0
  		expect_pgm_int();
  		asm volatile("spx	%0 " : : "Q"(new_prefix));
  		check_pgm_int_code(PGM_INT_CODE_ADDRESSING);