All of lore.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,
	imbrenda@linux.ibm.com
Subject: Re: [kvm-unit-tests PATCH v2 3/5] s390x: css: implementing Set CHannel Monitor
Date: Fri, 12 Feb 2021 16:51:53 +0100	[thread overview]
Message-ID: <1b3b3b05-6961-d217-b398-d7a41ef4910a@linux.ibm.com> (raw)
In-Reply-To: <20210212115307.627abe8a.cohuck@redhat.com>



On 2/12/21 11:53 AM, Cornelia Huck wrote:
> On Wed, 10 Feb 2021 14:20:12 +0100
> Pierre Morel <pmorel@linux.ibm.com> wrote:
> 
>> We implement the call of the Set CHannel Monitor instruction,
>> starting the monitoring of the all Channel Sub System, and
>> initializing channel subsystem monitoring.
>>
>> An initial test reports the presence of the extended measurement
>> block feature.
>>
>> Several tests on SCHM verify the error reporting of the hypervisor.
> 
> Combine these two into one sentence?
> 
> "Initial tests report the presence of the extended measurement block
> feature, and verify the error reporting of the hypervisor for SCHM."
> 
> Also, you add the infrastructure for enabling measurements at the
> subchannel -- either mention this in the patch description or move it
> to a separate patch or the first user?

yes, I change for one of these solutions, thanks.

> 
>>
>> Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
>> ---
>>   lib/s390x/css.h     | 19 +++++++++++-
>>   lib/s390x/css_lib.c | 74 +++++++++++++++++++++++++++++++++++++++++++++
>>   s390x/css.c         | 36 ++++++++++++++++++++++
>>   3 files changed, 128 insertions(+), 1 deletion(-)
>>
> 
> (...)
> 
>> diff --git a/lib/s390x/css_lib.c b/lib/s390x/css_lib.c
>> index 5426a6b..355881d 100644
>> --- a/lib/s390x/css_lib.c
>> +++ b/lib/s390x/css_lib.c
>> @@ -267,6 +267,80 @@ retry:
>>   	return -1;
>>   }
>>   
>> +static bool schib_update(int schid, uint64_t mb, uint16_t mbi, uint16_t flags,
>> +		  bool format1)
> 
> Maybe schib_update_mb()?

yes, it is dedicated.

> 
>> +{
>> +	struct pmcw *pmcw = &schib.pmcw;
>> +	int cc;
>> +
>> +	/* Read the SCHIB for this subchannel */
>> +	cc = stsch(schid, &schib);
>> +	if (cc) {
>> +		report_info("stsch: sch %08x failed with cc=%d", schid, cc);
>> +		return false;
>> +	}
>> +
>> +	/* Update the SCHIB to enable the measurement block */
>> +	pmcw->flags |= flags;
> 
> Do we also want to be able to disable it again?

Yes, I can add the disabling of the measurement on a channel.
In the test I disable it for the system but we may need this later.


> 
>> +
>> +	if (format1)
>> +		pmcw->flags2 |= PMCW_MBF1;
>> +	else
>> +		pmcw->flags2 &= ~PMCW_MBF1;
>> +
>> +	pmcw->mbi = mbi;
>> +	schib.mbo = mb;
>> +
>> +	/* Tell the CSS we want to modify the subchannel */
>> +	cc = msch(schid, &schib);
>> +	if (cc) {
>> +		/*
>> +		 * If the subchannel is status pending or
>> +		 * if a function is in progress,
>> +		 * we consider both cases as errors.
>> +		 */
>> +		report_info("msch: sch %08x failed with cc=%d", schid, cc);
>> +		return false;
>> +	}
>> +
>> +	/*
>> +	 * Read the SCHIB again to verify the measurement block origin
>> +	 */
>> +	cc = stsch(schid, &schib);
>> +	if (cc) {
>> +		report_info("stsch: updating sch %08x failed with cc=%d",
>> +			    schid, cc);
>> +		return false;
>> +	}
> 
> Hm, you only do the stsch, but do not check the result (that is done by
> the caller) -- remove the misleading comment or replace it with "Read
> the SCHIB again"?

right, "Read the SCHIB again"

> 
>> +
>> +	return true;
>> +}
>> +
> 
> (...)
> 
> Otherwise, LGTM.
> 

Thanks,
Pierre

-- 
Pierre Morel
IBM Lab Boeblingen

  reply	other threads:[~2021-02-12 15:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-10 13:20 [kvm-unit-tests PATCH v2 0/5] CSS Mesurement Block Pierre Morel
2021-02-10 13:20 ` [kvm-unit-tests PATCH v2 1/5] s390x: css: Store CSS Characteristics Pierre Morel
2021-02-12 10:32   ` Cornelia Huck
2021-02-12 15:35     ` Pierre Morel
2021-02-10 13:20 ` [kvm-unit-tests PATCH v2 2/5] s390x: css: simplifications of the tests Pierre Morel
2021-02-12 10:36   ` Cornelia Huck
2021-02-12 15:36     ` Pierre Morel
2021-02-10 13:20 ` [kvm-unit-tests PATCH v2 3/5] s390x: css: implementing Set CHannel Monitor Pierre Morel
2021-02-12 10:53   ` Cornelia Huck
2021-02-12 15:51     ` Pierre Morel [this message]
2021-02-10 13:20 ` [kvm-unit-tests PATCH v2 4/5] s390x: css: testing measurement block format 0 Pierre Morel
2021-02-12 11:12   ` Cornelia Huck
2021-02-12 15:59     ` Pierre Morel
2021-02-10 13:20 ` [kvm-unit-tests PATCH v2 5/5] s390x: css: testing measurement block format 1 Pierre Morel
2021-02-12 11:15   ` Cornelia Huck
2021-02-12 16:04     ` 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=1b3b3b05-6961-d217-b398-d7a41ef4910a@linux.ibm.com \
    --to=pmorel@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.