public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Janosch Frank <frankja@linux.ibm.com>, kvm@vger.kernel.org
Cc: linux-s390@vger.kernel.org, david@redhat.com
Subject: Re: [kvm-unit-tests PATCH v2 4/4] s390x: Add storage key removal facility
Date: Wed, 28 Aug 2019 14:02:43 +0200	[thread overview]
Message-ID: <3ea4cb74-4fe4-d2bd-7fe4-550df9c355e6@redhat.com> (raw)
In-Reply-To: <20190828113615.4769-5-frankja@linux.ibm.com>

On 28/08/2019 13.36, Janosch Frank wrote:
> The storage key removal facility (stfle bit 169) makes all key related
> instructions result in a special operation exception if they handle a
> key.
> 
> Let's make sure that the skey and pfmf tests only run non key code
> (pfmf) or not at all (skey).
> 
> Also let's test this new facility. As lots of instructions are
> affected by this, only some of them are tested for now.
> 
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
> ---
>  s390x/Makefile |   1 +
>  s390x/pfmf.c   |  10 ++++
>  s390x/skey.c   |   5 ++
>  s390x/skrf.c   | 128 +++++++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 144 insertions(+)
>  create mode 100644 s390x/skrf.c
[...]
> +static void test_mvcos(void)
> +{
> +	uint64_t r3 = 64;
> +	uint8_t *src = pagebuf;
> +	uint8_t *dst = pagebuf + PAGE_SIZE;
> +	/* K bit set, as well as keys */
> +	register unsigned long oac asm("0") = 0xf002f002;
> +
> +	report_prefix_push("mvcos");
> +	expect_pgm_int();
> +	asm volatile("mvcos	%[dst],%[src],%[len]"
> +		     : [dst] "+Q" (*(dst))
> +		     : [src] "Q" (*(src)), [len] "d" (r3), "d" (oac)

Just a nit: I think you could write "*dst" instead of "*(dst)" and
"*src" instead of "*(src)".

> +		     : "cc", "memory");
> +	check_pgm_int_code(PGM_INT_CODE_SPECIAL_OPERATION);
> +	report_prefix_pop();
> +}
> +
> +static void test_spka(void)
> +{
> +	report_prefix_push("spka");
> +	expect_pgm_int();
> +	asm volatile("spka	0xf0(0)\n");
> +	check_pgm_int_code(PGM_INT_CODE_SPECIAL_OPERATION);
> +	report_prefix_pop();
> +}
> +
> +static void test_tprot(void)
> +{
> +	report_prefix_push("tprot");
> +	expect_pgm_int();
> +	asm volatile("tprot	%[addr],0xf0(0)\n"
> +		     : : [addr] "a" (pagebuf) : );
> +	check_pgm_int_code(PGM_INT_CODE_SPECIAL_OPERATION);
> +	report_prefix_pop();
> +}
> +
> +int main(void)
> +{
> +	report_prefix_push("skrf");
> +	if (!test_facility(169)) {
> +		report_skip("storage key removal facility not available\n");
> +		goto done;
> +	}
> +
> +	test_facilities();
> +	test_skey();
> +	test_pfmf();
> +	test_psw_key();
> +	test_mvcos();
> +	test_spka();
> +	test_tprot();
> +
> +done:
> +	report_prefix_pop();
> +	return report_summary();
> +}

I can't say much about the technical details here (since I don't have
the doc for that "removal facility"), but apart from that, the patch
looks fine to me now.

Acked-by: Thomas Huth <thuth@redhat.com>

(and I'll wait one or two more days for additional reviews before
queuing the patches)

  reply	other threads:[~2019-08-28 12:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-28 11:36 [kvm-unit-tests PATCH v2 0/4] s390x: Add skey removal facility test Janosch Frank
2019-08-28 11:36 ` [kvm-unit-tests PATCH v2 1/4] s390x: Move pfmf to lib and make address void Janosch Frank
2019-08-28 11:39   ` Thomas Huth
2019-08-28 11:36 ` [kvm-unit-tests PATCH v2 2/4] s390x: Storage key library functions now take void ptr addresses Janosch Frank
2019-08-28 11:36 ` [kvm-unit-tests PATCH v2 3/4] s390x: Bump march to zEC12 Janosch Frank
2019-08-28 11:41   ` Thomas Huth
2019-08-28 11:36 ` [kvm-unit-tests PATCH v2 4/4] s390x: Add storage key removal facility Janosch Frank
2019-08-28 12:02   ` Thomas Huth [this message]
2019-08-28 14:05     ` 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=3ea4cb74-4fe4-d2bd-7fe4-550df9c355e6@redhat.com \
    --to=thuth@redhat.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    /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