kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Janosch Frank <frankja@linux.ibm.com>
To: Thomas Huth <thuth@redhat.com>,
	Collin Walling <walling@linux.ibm.com>,
	kvm@vger.kernel.org
Cc: david@redhat.com, cohuck@redhat.com
Subject: Re: [PATCH v1] self_tests/kvm: sync_regs and reset tests for diag318
Date: Fri, 16 Oct 2020 08:58:29 +0200	[thread overview]
Message-ID: <59127983-82a2-a6c7-8ad3-703577bf38b3@linux.ibm.com> (raw)
In-Reply-To: <e5b92b5c-93ef-462f-e597-e5436f414f21@redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 2822 bytes --]

On 10/15/20 3:56 PM, Thomas Huth wrote:
> On 15/10/2020 14.40, Janosch Frank wrote:
>> On 10/14/20 9:27 PM, Collin Walling wrote:
>>> The DIAGNOSE 0x0318 instruction, unique to s390x, is a privileged call
>>> that must be intercepted via SIE, handled in userspace, and the
>>> information set by the instruction is communicated back to KVM.
>>
>> It might be nice to have a few words in here about what information can
>> be set via the diag.
>>
>>>
>>> To test the instruction interception, an ad-hoc handler is defined which
>>> simply has a VM execute the instruction and then userspace will extract
>>> the necessary info. The handler is defined such that the instruction
>>> invocation occurs only once. It is up the the caller to determine how the
>>> info returned by this handler should be used.
>>>
>>> The diag318 info is communicated from userspace to KVM via a sync_regs
>>> call. This is tested during a sync_regs test, where the diag318 info is
>>> requested via the handler, then the info is stored in the appropriate
>>> register in KVM via a sync registers call.
>>>
>>> The diag318 info is checked to be 0 after a normal and clear reset.
>>>
>>> If KVM does not support diag318, then the tests will print a message
>>> stating that diag318 was skipped, and the asserts will simply test
>>> against a value of 0.
>>>
>>> Signed-off-by: Collin Walling <walling@linux.ibm.com>
>>
>> Checkpatch throws lots of errors on this patch.
>> Could you check if my workflow misteriously introduced windows line
>> endings or if they were introduced on your side?
> 
> How did you feed the patch into checkpatch? IIRC mails are often sent with
> CR-LF line endings by default - it's "git am" that is converting the line
> endings back to the Unix default. So for running a patch through checkpatch,
> you might need to do "git am" first and then export it again.

Uh right, that's why I asked in the first place
With git am checkpatch is a lot happier and it would be even happier if
I would have looked at the V1 and not at the RFC I reviewed on Monday...

> 
>>> +uint64_t get_diag318_info(void)
>>> +{
>>> +	static uint64_t diag318_info;
>>> +	static bool printed_skip;
>>> +
>>> +	/*
>>> +	 * If KVM does not support diag318, then return 0 to
>>> +	 * ensure tests do not break.
>>> +	 */
>>> +	if (!kvm_check_cap(KVM_CAP_S390_DIAG318)) {
>>> +		if (!printed_skip) {
>>> +			fprintf(stdout, "KVM_CAP_S390_DIAG318 not supported. "
>>
>> Whitespace after .
>>
>>> +				"Skipping diag318 test.\n");
> 
> It's a multi-line text, so the whitespace is needed, isn't it?

I missed that second line as it is indented to the stdout and not to the
first string.

> 
>>> +			printed_skip = true;
>>> +		}
>>> +		return 0;
>>> +	}
> 
>  Thomas
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2020-10-16  6:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-14 19:27 [PATCH v1] self_tests/kvm: sync_regs and reset tests for diag318 Collin Walling
2020-10-15  7:55 ` Thomas Huth
2020-10-15 15:26   ` Collin Walling
2020-10-15 16:14     ` Thomas Huth
2020-10-15 12:40 ` Janosch Frank
2020-10-15 13:56   ` Thomas Huth
2020-10-16  6:58     ` Janosch Frank [this message]

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=59127983-82a2-a6c7-8ad3-703577bf38b3@linux.ibm.com \
    --to=frankja@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=thuth@redhat.com \
    --cc=walling@linux.ibm.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;
as well as URLs for NNTP newsgroup(s).