Skip to contentSkip to conversation

s390x: verify EQBS/SQBS is unavailable

PATCH Superseded Nico Boehr 1 participant 1 message Aug 3, 2022 KVM

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Nico Boehr

author
#0 lore raw

PATCH v2 1/1 s390x: verify EQBS/SQBS is unavailable

QEMU doesn't provide EQBS/SQBS instructions, so we should check they result in an exception.

---
 s390x/intercept.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
s390x/intercept.c +29 -0
index 9e826b6c79ad..d342f273b3c0 100644
@@ -197,6 +197,34 @@ static void test_diag318(void)
 
 }
 
+static void test_qbs(void)
+{
+	report_prefix_push("qbs");
+	if (!host_is_qemu()) {
+		report_skip("QEMU-only test");
+		report_prefix_pop();
+		return;
+	}
+
+	report_prefix_push("sqbs");
+	expect_pgm_int();
+	asm volatile(
+		"	.insn   rsy,0xeb000000008a,0,0,0(0)\n"
+		: : : "memory", "cc", "1");
+	check_pgm_int_code(PGM_INT_CODE_OPERATION);
+	report_prefix_pop();
+
+	report_prefix_push("eqbs");
+	expect_pgm_int();
+	asm volatile(
+		"	.insn   rrf,0xb99c0000,0,0,0,0\n"
+		: : : "memory", "cc", "1");
+	check_pgm_int_code(PGM_INT_CODE_OPERATION);
+	report_prefix_pop();
+
+	report_prefix_pop();
+}
+
 struct {
 	const char *name;
 	void (*func)(void);
@@ -208,6 +236,7 @@ struct {
 	{ "stidp", test_stidp, false },
 	{ "testblock", test_testblock, false },
 	{ "diag318", test_diag318, false },
+	{ "qbs", test_qbs, false },
 	{ NULL, NULL, false }
 };
 
Signature · 1 line
2.36.1