[kvm-unit-tests PATCH v3 13/16] s390x: css: checking for CSS extensions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We verify that these extensions are not install before running simple
tests.

Signed-off-by: Pierre Morel <pmorel@xxxxxxxxxxxxx>
---
 lib/s390x/css.h |  2 ++
 s390x/css.c     | 31 +++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/lib/s390x/css.h b/lib/s390x/css.h
index d824e34..08b2974 100644
--- a/lib/s390x/css.h
+++ b/lib/s390x/css.h
@@ -338,7 +338,9 @@ struct chsc_scsc {
 	uint8_t reserved[9];
 	struct chsc_header res;
 	uint32_t res_fmt;
+#define CSSC_ORB_EXTENSIONS		0
 #define CSSC_EXTENDED_MEASUREMENT_BLOCK 48
+#define CSSC_FC_EXTENSIONS		88
 	uint64_t general_char[255];
 	uint64_t chsc_char[254];
 };
diff --git a/s390x/css.c b/s390x/css.c
index 26f5da6..f8c6688 100644
--- a/s390x/css.c
+++ b/s390x/css.c
@@ -229,6 +229,35 @@ static void ssch_orb_ctrl(void)
 	}
 }
 
+static void ssch_orb_extension(void)
+{
+	if (!css_test_general_feature(CSSC_ORB_EXTENSIONS)) {
+		report_skip("ORB extensions not installed");
+		return;
+	}
+	/* Place holder for checking ORB extensions */
+	report_info("ORB extensions installed but not tested");
+}
+
+static void ssch_orb_fcx(void)
+{
+	uint32_t tmp = orb->ctrl;
+
+	if (!css_test_general_feature(CSSC_FC_EXTENSIONS)) {
+		report_skip("Fibre-channel extensions not installed");
+		return;
+	}
+
+	report_prefix_push("Channel-Program Type Control");
+	orb->ctrl |= ORB_CTRL_CPTC;
+	expect_pgm_int();
+	ssch(test_device_sid, orb);
+	check_pgm_int_code(PGM_INT_CODE_OPERAND);
+	report_prefix_pop();
+
+	orb->ctrl = tmp;
+}
+
 static struct tests ssh_tests[] = {
 	{ "privilege", ssch_privilege },
 	{ "orb cpa zero", ssch_orb_cpa_zero },
@@ -238,6 +267,8 @@ static struct tests ssh_tests[] = {
 	{ "CCW in DMA31", ssch_ccw_dma31 },
 	{ "ORB MIDAW unsupported", ssch_orb_midaw },
 	{ "ORB reserved CTRL bits", ssch_orb_ctrl },
+	{ "ORB extensions", ssch_orb_extension},
+	{ "FC extensions", ssch_orb_fcx},
 	{ NULL, NULL }
 };
 
-- 
2.17.1




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux