Re: [kvm-unit-tests PATCH 3/4] s390x: cpumodel: FMT4 SCLP test

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

 



On 10.05.21 17:00, Janosch Frank wrote:
SCLP is also part of the cpumodel, so we need to make sure that the
features indicated via read info / read cpu info are correct.

Signed-off-by: Janosch Frank <frankja@xxxxxxxxxxxxx>
---
  s390x/cpumodel.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++-
  1 file changed, 58 insertions(+), 1 deletion(-)

diff --git a/s390x/cpumodel.c b/s390x/cpumodel.c
index 4dd8b96f..619c3dc7 100644
--- a/s390x/cpumodel.c
+++ b/s390x/cpumodel.c
@@ -2,14 +2,69 @@
  /*
   * Test the known dependencies for facilities
   *
- * Copyright 2019 IBM Corp.
+ * Copyright 2019, 2021 IBM Corp.
   *
   * Authors:
   *    Christian Borntraeger <borntraeger@xxxxxxxxxx>
+ *    Janosch Frank <frankja@xxxxxxxxxxxxx>
   */
#include <asm/facility.h>
  #include <vm.h>
+#include <sclp.h>
+#include <uv.h>
+#include <asm/uv.h>
+
+static void test_sclp_missing_sief2_implications(void)
+{
+	/* Virtualization related facilities */
+	report(!sclp_facilities.has_64bscao, "!64bscao");
+	report(!sclp_facilities.has_pfmfi, "!pfmfi");
+	report(!sclp_facilities.has_gsls, "!gsls");
+	report(!sclp_facilities.has_cmma, "!cmma");
+	report(!sclp_facilities.has_esca, "!esca");
+	report(!sclp_facilities.has_kss, "!kss");
+	report(!sclp_facilities.has_ibs, "!ibs");
+
+	/* Virtualization related facilities reported via CPU entries */
+	report(!sclp_facilities.has_sigpif, "!sigpif");
+	report(!sclp_facilities.has_sief2, "!sief2");
+	report(!sclp_facilities.has_skeyi, "!skeyi");
+	report(!sclp_facilities.has_siif, "!siif");
+	report(!sclp_facilities.has_cei, "!cei");
+	report(!sclp_facilities.has_ib, "!ib");
+}
+
+static void test_sclp_features_fmt4(void)
+{
+	/*
+	 * STFLE facilities are handled by the Ultravisor but SCLP
+	 * facilities are advertised by the hypervisor.
+	 */
+	report_prefix_push("PV guest implies");
+
+	/* General facilities */
+	report(!sclp_facilities.has_diag318, "!diag318");
+
+	/*
+	 * Virtualization related facilities, all of which are
+	 * unavailable because there's no virtualization support in a
+	 * protected guest.
+	 */
+	test_sclp_missing_sief2_implications();
+
+	report_prefix_pop();
+}
+
+static void test_sclp_features(void)
+{
+	report_prefix_push("sclp");
+
+	if (uv_os_is_guest())
+		test_sclp_features_fmt4();
+
+	report_prefix_pop();
+}
static struct {
  	int facility;
@@ -60,6 +115,8 @@ int main(void)
  	}
  	report_prefix_pop();
+ test_sclp_features();
+
  	report_prefix_pop();
  	return report_summary();
  }


Acked-by: David Hildenbrand <david@xxxxxxxxxx>

--
Thanks,

David / dhildenb




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux