All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Janosch Frank <frankja@linux.ibm.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: Thu, 15 Oct 2020 15:56:43 +0200	[thread overview]
Message-ID: <e5b92b5c-93ef-462f-e597-e5436f414f21@redhat.com> (raw)
In-Reply-To: <d90a2c37-46b7-5fc9-efb8-c5a6bb1c6d7e@linux.ibm.com>

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.

>> +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?

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

 Thomas


  reply	other threads:[~2020-10-15 13:57 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 [this message]
2020-10-16  6:58     ` Janosch Frank

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=e5b92b5c-93ef-462f-e597-e5436f414f21@redhat.com \
    --to=thuth@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --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 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.