Skip to contentSkip to conversation

s390x: css: check the CSS is working with any ISC

PATCH In review Pierre Morel 3 participants 6 messages Aug 12, 2021 – Aug 23, 2021 KVM

lore
Share & tools
lore
#0 lore raw

cover s390x: css: check the CSS is working with any ISC

Picking the ISC used by Linux for I/O to make the CSS checks may cause a bias.

Let's check all possible ISC for I/O to verify that QEMU/KVM is really ISC independent.

Pierre Morel (1):
s390x: css: check the CSS is working with any ISC

 s390x/css.c | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/1 s390x: css: check the CSS is working with any ISC

In the previous version we did only check that one ISC dedicated by Linux for I/O is working fine.

However, there is no reason to prefer one ISC to another ISC, we are free to take anyone.

Let's check all possible ISC to verify that QEMU/KVM is really ISC independent.

---
 s390x/css.c | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)
s390x/css.c +17 -8
index c340c539..aa005309 100644
@@ -22,6 +22,7 @@
 
 #define DEFAULT_CU_TYPE		0x3832 /* virtio-ccw */
 static unsigned long cu_type = DEFAULT_CU_TYPE;
+static int io_isc;
 
 static int test_device_sid;
 static struct senseid *senseid;
@@ -46,7 +47,7 @@ static void test_enable(void)
 		return;
 	}
 
-	cc = css_enable(test_device_sid, IO_SCH_ISC);
+	cc = css_enable(test_device_sid, io_isc);
 
 	report(cc == 0, "Enable subchannel %08x", test_device_sid);
 }
@@ -67,7 +68,7 @@ static void test_sense(void)
 		return;
 	}
 
-	ret = css_enable(test_device_sid, IO_SCH_ISC);
+	ret = css_enable(test_device_sid, io_isc);
 	if (ret) {
 		report(0, "Could not enable the subchannel: %08x",
 		       test_device_sid);
@@ -142,7 +143,6 @@ static void sense_id(void)
 
 static void css_init(void)
 {
-	assert(register_io_int_func(css_irq_io) == 0);
 	lowcore_ptr->io_int_param = 0;
 
 	report(get_chsc_scsc(), "Store Channel Characteristics");
@@ -351,11 +351,20 @@ int main(int argc, char *argv[])
 	int i;
 
 	report_prefix_push("Channel Subsystem");
-	enable_io_isc(0x80 >> IO_SCH_ISC);
-	for (i = 0; tests[i].name; i++) {
-		report_prefix_push(tests[i].name);
-		tests[i].func();
-		report_prefix_pop();
+
+	for (io_isc = 0; io_isc < 8; io_isc++) {
+		report_info("ISC: %d\n", io_isc);
+
+		enable_io_isc(0x80 >> io_isc);
+		assert(register_io_int_func(css_irq_io) == 0);
+
+		for (i = 0; tests[i].name; i++) {
+			report_prefix_push(tests[i].name);
+			tests[i].func();
+			report_prefix_pop();
+		}
+
+		unregister_io_int_func(css_irq_io);
 	}
 	report_prefix_pop();
 
Signature · 1 line
2.25.1
#2 lore raw
Quoted 8 lines · Pierre Morel

In the previous version we did only check that one ISC dedicated by Linux for I/O is working fine.

However, there is no reason to prefer one ISC to another ISC, we are free to take anyone.

Let's check all possible ISC to verify that QEMU/KVM is really ISC independent.

It's probably a good idea to test for a non-standard isc. Not sure whether we need all of them, but it doesn't hurt.

Do you also have plans for a test to verify the priority handling for the different iscs?

Quoted 6 lines
---
 s390x/css.c | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

(...)

Quoted 13 lines
s390x/css.c +0 -2
@@ -142,7 +143,6 @@ static void sense_id(void)
 
 static void css_init(void)
 {
-	assert(register_io_int_func(css_irq_io) == 0);
 	lowcore_ptr->io_int_param = 0;
 
 	report(get_chsc_scsc(), "Store Channel Characteristics");
@@ -351,11 +351,20 @@ int main(int argc, char *argv[])
 	int i;
 
 	report_prefix_push("Channel Subsystem");
-	enable_io_isc(0x80 >> IO_SCH_ISC);

s390x/css.c int main(int argc, char *argv[]) · line 359

Quoted 10 lines
s390x/css.c +6 -4
-	for (i = 0; tests[i].name; i++) {
-		report_prefix_push(tests[i].name);
-		tests[i].func();
-		report_prefix_pop();
+
+	for (io_isc = 0; io_isc < 8; io_isc++) {
+		report_info("ISC: %d\n", io_isc);
+
+		enable_io_isc(0x80 >> io_isc);
+		assert(register_io_int_func(css_irq_io) == 0);

Why are you registering/deregistering the irq handler multiple times? It should be the same, regardless of the isc?

Quoted 12 lines
s390x/css.c +8 -0
+
+		for (i = 0; tests[i].name; i++) {
+			report_prefix_push(tests[i].name);
+			tests[i].func();
+			report_prefix_pop();
+		}
+
+		unregister_io_int_func(css_irq_io);
 	}
 	report_prefix_pop();
 
#3 lore raw
Quoted 8 lines · Cornelia Huck
Quoted 6 lines · Pierre Morel

In the previous version we did only check that one ISC dedicated by Linux for I/O is working fine.

However, there is no reason to prefer one ISC to another ISC, we are free to take anyone.

Quoted 8 lines
Quoted 2 lines

Let's check all possible ISC to verify that QEMU/KVM is really ISC independent.

It's probably a good idea to test for a non-standard isc. Not sure whether we need all of them, but it doesn't hurt.

Do you also have plans for a test to verify the priority handling for the different iscs?

No, I did not think about this yet.

Quoted 21 lines
Quoted 7 lines
---
  s390x/css.c | 25 +++++++++++++++++--------
  1 file changed, 17 insertions(+), 8 deletions(-)

(...)

Quoted 11 lines
s390x/css.c +0 -1
@@ -142,7 +143,6 @@ static void sense_id(void)
 
  static void css_init(void)
  {
-	assert(register_io_int_func(css_irq_io) == 0);
  	lowcore_ptr->io_int_param = 0;
 
  	report(get_chsc_scsc(), "Store Channel Characteristics");
@@ -351,11 +351,20 @@ int main(int argc, char *argv[])
  	int i;
 
Quoted 15 lines

s390x/css.c int main(int argc, char *argv[]) · line 359

Quoted 12 lines
s390x/css.c +6 -5
  	report_prefix_push("Channel Subsystem");
-	enable_io_isc(0x80 >> IO_SCH_ISC);
-	for (i = 0; tests[i].name; i++) {
-		report_prefix_push(tests[i].name);
-		tests[i].func();
-		report_prefix_pop();
+
+	for (io_isc = 0; io_isc < 8; io_isc++) {
+		report_info("ISC: %d\n", io_isc);
+
+		enable_io_isc(0x80 >> io_isc);
+		assert(register_io_int_func(css_irq_io) == 0);

Why are you registering/deregistering the irq handler multiple times? It should be the same, regardless of the isc?

Yes, right, did not pay attention when pushing all in the loop, I will get it out of the loop.

Thanks,
Pierre

Signature · 2 lines
Pierre Morel
IBM Lab Boeblingen
#4 lore raw
In reply to Pierre Morel
Quoted 54 lines · Pierre Morel

In the previous version we did only check that one ISC dedicated by Linux for I/O is working fine.

However, there is no reason to prefer one ISC to another ISC, we are free to take anyone.

Let's check all possible ISC to verify that QEMU/KVM is really ISC independent.

---
  s390x/css.c | 25 +++++++++++++++++--------
  1 file changed, 17 insertions(+), 8 deletions(-)
s390x/css.c +3 -3
index c340c539..aa005309 100644
@@ -22,6 +22,7 @@
 
  #define DEFAULT_CU_TYPE		0x3832 /* virtio-ccw */
  static unsigned long cu_type = DEFAULT_CU_TYPE;
+static int io_isc;
 
  static int test_device_sid;
  static struct senseid *senseid;
@@ -46,7 +47,7 @@ static void test_enable(void)
  		return;
  	}
 
-	cc = css_enable(test_device_sid, IO_SCH_ISC);
+	cc = css_enable(test_device_sid, io_isc);
 
  	report(cc == 0, "Enable subchannel %08x", test_device_sid);
  }
@@ -67,7 +68,7 @@ static void test_sense(void)
  		return;
  	}
 
-	ret = css_enable(test_device_sid, IO_SCH_ISC);
+	ret = css_enable(test_device_sid, io_isc);
  	if (ret) {
  		report(0, "Could not enable the subchannel: %08x",
  		       test_device_sid);
@@ -142,7 +143,6 @@ static void sense_id(void)
 
  static void css_init(void)
  {
-	assert(register_io_int_func(css_irq_io) == 0);
  	lowcore_ptr->io_int_param = 0;
 
  	report(get_chsc_scsc(), "Store Channel Characteristics");
@@ -351,11 +351,20 @@ int main(int argc, char *argv[])
  	int i;

s390x/css.c int main(int argc, char *argv[]) · line 356

Quoted 10 lines
s390x/css.c +3 -5
 
  	report_prefix_push("Channel Subsystem");
-	enable_io_isc(0x80 >> IO_SCH_ISC);
-	for (i = 0; tests[i].name; i++) {
-		report_prefix_push(tests[i].name);
-		tests[i].func();
-		report_prefix_pop();
+
+	for (io_isc = 0; io_isc < 8; io_isc++) {
+		report_info("ISC: %d\n", io_isc);

Would it make sense to add the "ISC" string as a prefix with report_prefix_push() instead, so that the tests get individual test names?

Thomas

Quoted 14 lines
s390x/css.c +10 -0
+		enable_io_isc(0x80 >> io_isc);
+		assert(register_io_int_func(css_irq_io) == 0);
+
+		for (i = 0; tests[i].name; i++) {
+			report_prefix_push(tests[i].name);
+			tests[i].func();
+			report_prefix_pop();
+		}
+
+		unregister_io_int_func(css_irq_io);
  	}
  	report_prefix_pop();
 
#5 lore raw
Quoted 60 lines · Thomas Huth
Quoted 46 lines · Pierre Morel

In the previous version we did only check that one ISC dedicated by Linux for I/O is working fine.

However, there is no reason to prefer one ISC to another ISC, we are free to take anyone.

Let's check all possible ISC to verify that QEMU/KVM is really ISC independent.

---
  s390x/css.c | 25 +++++++++++++++++--------

  1 file changed, 17 insertions(+), 8 deletions(-)
s390x/css.c +3 -3
index c340c539..aa005309 100644
@@ -22,6 +22,7 @@
   #define DEFAULT_CU_TYPE        0x3832 /* virtio-ccw */
   static unsigned long cu_type = DEFAULT_CU_TYPE;
+static int io_isc;
   static int test_device_sid;
   static struct senseid *senseid;
@@ -46,7 +47,7 @@ static void test_enable(void)
           return;
       }
-    cc = css_enable(test_device_sid, IO_SCH_ISC);
+    cc = css_enable(test_device_sid, io_isc);
       report(cc == 0, "Enable subchannel %08x", test_device_sid);
   }
@@ -67,7 +68,7 @@ static void test_sense(void)
           return;
       }
-    ret = css_enable(test_device_sid, IO_SCH_ISC);
+    ret = css_enable(test_device_sid, io_isc);
       if (ret) {
           report(0, "Could not enable the subchannel: %08x",
                  test_device_sid);
@@ -142,7 +143,6 @@ static void sense_id(void)
   static void css_init(void)
   {
-    assert(register_io_int_func(css_irq_io) == 0);
       lowcore_ptr->io_int_param = 0;
       report(get_chsc_scsc(), "Store Channel Characteristics");

s390x/css.c int main(int argc, char *argv[]) · line 355

Quoted 10 lines
s390x/css.c +3 -5
@@ -351,11 +351,20 @@ int main(int argc, char *argv[])
       int i;
       report_prefix_push("Channel Subsystem");
-    enable_io_isc(0x80 >> IO_SCH_ISC);
-    for (i = 0; tests[i].name; i++) {
-        report_prefix_push(tests[i].name);
-        tests[i].func();
-        report_prefix_pop();
+
+    for (io_isc = 0; io_isc < 8; io_isc++) {
+        report_info("ISC: %d\n", io_isc);

Would it make sense to add the "ISC" string as a prefix with report_prefix_push() instead, so that the tests get individual test names?

Quoted 2 lines

 Thomas

Yes, this would make a better description I think.

Thanks,
Pierre

Signature · 2 lines
Pierre Morel
IBM Lab Boeblingen