public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Pierre Morel <pmorel@linux.ibm.com>
To: Cornelia Huck <cohuck@redhat.com>
Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org,
	frankja@linux.ibm.com, david@redhat.com, thuth@redhat.com,
	drjones@redhat.com
Subject: Re: [kvm-unit-tests PATCH v11 9/9] s390x: css: ssch/tsch with sense and interrupt
Date: Thu, 9 Jul 2020 15:18:25 +0200	[thread overview]
Message-ID: <9aba6196-edd4-4eb0-1e1c-e6410291863b@linux.ibm.com> (raw)
In-Reply-To: <20200709141348.6ae5ff18.cohuck@redhat.com>



On 2020-07-09 14:13, Cornelia Huck wrote:
> On Thu,  9 Jul 2020 10:07:48 +0200
> Pierre Morel <pmorel@linux.ibm.com> wrote:
> 
>> After a channel is enabled we start a SENSE_ID command using
>> the SSCH instruction to recognize the control unit and device.
>>
>> This tests the success of SSCH, the I/O interruption and the TSCH
>> instructions.
>>
>> The SENSE_ID command response is tested to report 0xff inside
>> its reserved field and to report the same control unit type
>> as the cu_type kernel argument.
>>
>> Without the cu_type kernel argument, the test expects a device
>> with a default control unit type of 0x3832, a.k.a virtio-net-ccw.
>>
>> Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
>> ---
>>   lib/s390x/asm/arch_def.h |   1 +
>>   lib/s390x/css.h          |  35 ++++++++
>>   lib/s390x/css_lib.c      | 183 +++++++++++++++++++++++++++++++++++++++
>>   s390x/css.c              |  80 +++++++++++++++++
>>   4 files changed, 299 insertions(+)
> 
> (...)
> 
>> diff --git a/lib/s390x/css_lib.c b/lib/s390x/css_lib.c
>> index eda68a4..c64edd5 100644
>> --- a/lib/s390x/css_lib.c
>> +++ b/lib/s390x/css_lib.c
>> @@ -16,6 +16,7 @@
>>   #include <interrupt.h>
>>   #include <asm/arch_def.h>
>>   #include <asm/time.h>
>> +#include <asm/arch_def.h>
>>   
>>   #include <css.h>
>>   
>> @@ -103,6 +104,9 @@ retry:
>>   	/* Update the SCHIB to enable the channel and set the ISC */
>>   	pmcw->flags |= flags;
>>   
>> +	/* Set Interruption Subclass to IO_SCH_ISC */
>> +	pmcw->flags |= (isc << PMCW_ISC_SHIFT);
> 
> But isn't the isc already contained in 'flags'? I think you should just
> delete these two lines.

right.

> 
>> +
>>   	/* Tell the CSS we want to modify the subchannel */
>>   	cc = msch(schid, &schib);
>>   	if (cc) {
> 
> (...)
> 
>> +/* wait_and_check_io_completion:
>> + * @schid: the subchannel ID
>> + *
>> + * Makes the most common check to validate a successful I/O
>> + * completion.
>> + * Only report failures.
>> + */
>> +int wait_and_check_io_completion(int schid)
>> +{
>> +	int ret = 0;
>> +
>> +	wait_for_interrupt(PSW_MASK_IO);
>> +
>> +	report_prefix_push("check I/O completion");
>> +
>> +	if (lowcore_ptr->io_int_param != schid) {
>> +		report(0, "interrupt parameter: expected %08x got %08x",
>> +		       schid, lowcore_ptr->io_int_param);
>> +		ret = -1;
>> +		goto end;
>> +	}
>> +
>> +	/* Verify that device status is valid */
>> +	if (!(irb.scsw.ctrl & SCSW_SC_PENDING)) {
>> +		report(0, "No status pending after interrupt. Subch Ctrl: %08x",
>> +		       irb.scsw.ctrl);
>> +		ret = -1;
>> +		goto end;
>> +	}
>> +
>> +	if (!(irb.scsw.ctrl & (SCSW_SC_SECONDARY | SCSW_SC_PRIMARY))) {
>> +		report(0, "Primary or secondary status missing. Subch Ctrl: %08x",
>> +		       irb.scsw.ctrl);
>> +		ret = -1;
>> +		goto end;
>> +	}
>> +
>> +	if (!(irb.scsw.dev_stat & (SCSW_DEVS_DEV_END | SCSW_DEVS_SCH_END))) {
>> +		report(0, "No device end nor sch end. Dev. status: %02x",
> 
> s/nor/or/ ?

OK

> 
>> +		       irb.scsw.dev_stat);
>> +		ret = -1;
>> +		goto end;
>> +	}
>> +
>> +	if (irb.scsw.sch_stat & !(SCSW_SCHS_PCI | SCSW_SCHS_IL)) {
> 
> Did you mean ~(SCSW_SCHS_PCI | SCSW_SCHS_IL)?

grrr... yes, thanks.

> 
> If yes, why do think a PCI may show up?

Should not in the current implementation.
I thought I can add it as a general test.

Regards,
Pierre

-- 
Pierre Morel
IBM Lab Boeblingen

  reply	other threads:[~2020-07-09 13:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-09  8:07 [kvm-unit-tests PATCH v11 0/9] s390x: Testing the Channel Subsystem I/O Pierre Morel
2020-07-09  8:07 ` [kvm-unit-tests PATCH v11 1/9] s390x: saving regs for interrupts Pierre Morel
2020-07-09  8:07 ` [kvm-unit-tests PATCH v11 2/9] s390x: I/O interrupt registration Pierre Morel
2020-07-09  8:07 ` [kvm-unit-tests PATCH v11 3/9] s390x: export the clock get_clock_ms() utility Pierre Morel
2020-07-09  8:07 ` [kvm-unit-tests PATCH v11 4/9] s390x: clock and delays calculations Pierre Morel
2020-07-09  8:07 ` [kvm-unit-tests PATCH v11 5/9] s390x: define function to wait for interrupt Pierre Morel
2020-07-09  8:07 ` [kvm-unit-tests PATCH v11 6/9] s390x: Library resources for CSS tests Pierre Morel
2020-07-09  8:07 ` [kvm-unit-tests PATCH v11 7/9] s390x: css: stsch, enumeration test Pierre Morel
2020-07-09  8:07 ` [kvm-unit-tests PATCH v11 8/9] s390x: css: msch, enable test Pierre Morel
2020-07-09 11:40   ` Cornelia Huck
2020-07-09 13:12     ` Pierre Morel
2020-07-09 13:30       ` Cornelia Huck
2020-07-09 13:41         ` Pierre Morel
2020-07-09 13:52           ` Cornelia Huck
2020-07-09 13:58             ` Pierre Morel
2020-07-09 14:22               ` Cornelia Huck
2020-07-09 14:38                 ` Pierre Morel
2020-07-09  8:07 ` [kvm-unit-tests PATCH v11 9/9] s390x: css: ssch/tsch with sense and interrupt Pierre Morel
2020-07-09 12:13   ` Cornelia Huck
2020-07-09 13:18     ` Pierre Morel [this message]
2020-07-09 13:33       ` Cornelia Huck
2020-07-09 13:38         ` Pierre Morel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9aba6196-edd4-4eb0-1e1c-e6410291863b@linux.ibm.com \
    --to=pmorel@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=drjones@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox