Re: [kvm-unit-tests PATCH v2 5/8] s390x: lib: css: add SCSW ctrl expectations to check I/O completion

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

 





On 3/30/21 2:10 PM, Cornelia Huck wrote:
On Thu, 25 Mar 2021 10:39:04 +0100
Pierre Morel <pmorel@xxxxxxxxxxxxx> wrote:

When checking for an I/O completion may need to check the cause of
the interrupt depending on the test case.

"When we check for the completion of an I/O, we may need to check..." ?


yes, thanks


Let's provide the tests the possibility to check if the last
valid IRQ received is for the function expected after executing

"Let's make it possible for the tests to check whether the last valid
IRB received indicates the expected functions..." ?


better too :)


an instruction or sequence of instructions and if all ctrl flags
of the SCSW are set as expected.

Signed-off-by: Pierre Morel <pmorel@xxxxxxxxxxxxx>
---
  lib/s390x/css.h     |  4 ++--
  lib/s390x/css_lib.c | 21 ++++++++++++++++-----
  s390x/css.c         |  4 ++--
  3 files changed, 20 insertions(+), 9 deletions(-)


(...)

diff --git a/lib/s390x/css_lib.c b/lib/s390x/css_lib.c
index 1e5c409..55e70e6 100644
--- a/lib/s390x/css_lib.c
+++ b/lib/s390x/css_lib.c
@@ -488,21 +488,25 @@ struct ccw1 *ccw_alloc(int code, void *data, int count, unsigned char flags)
/* wait_and_check_io_completion:
   * @schid: the subchannel ID
+ * @ctrl : expected SCSW control flags
   */
-int wait_and_check_io_completion(int schid)
+int wait_and_check_io_completion(int schid, uint32_t ctrl)
  {
  	wait_for_interrupt(PSW_MASK_IO);
-	return check_io_completion(schid);
+	return check_io_completion(schid, ctrl);
  }
/* check_io_completion:
   * @schid: the subchannel ID
+ * @ctrl : expected SCSW control flags
   *
- * Makes the most common check to validate a successful I/O
- * completion.
+ * If the ctrl parameter is not null check the IRB SCSW ctrl
+ * against the ctrl parameter.
+ * Otherwise, makes the most common check to validate a successful
+ * I/O completion.

What about:

"Perform some standard checks to validate a successful I/O completion.
If the ctrl parameter is not zero, additionally verify that the
specified bits are indicated in the IRB SCSW ctrl flags."

Yes, looks better, thanks


   * Only report failures.
   */
-int check_io_completion(int schid)
+int check_io_completion(int schid, uint32_t ctrl)
  {
  	int ret = 0;

With Thomas' suggested change,

Reviewed-by: Cornelia Huck <cohuck@xxxxxxxxxx>


Thanks,
Pierre

--
Pierre Morel
IBM Lab Boeblingen



[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