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 1/3] s390x: Move pfmf to lib and make address void
Date: Tue, 27 Aug 2019 17:23:03 +0200	[thread overview]
Message-ID: <e722fde9-d00a-ca65-91a3-9c7801c2352a@redhat.com> (raw)
In-Reply-To: <20190827134936.1705-2-frankja@linux.ibm.com>

On 27/08/2019 15.49, Janosch Frank wrote:
> It's needed by other tests soon.
> 
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
> ---
>  lib/s390x/asm/mem.h | 31 ++++++++++++++++++++++
>  s390x/pfmf.c        | 63 ++++++++++++++-------------------------------
>  2 files changed, 50 insertions(+), 44 deletions(-)
[...]
> @@ -80,15 +49,18 @@ static void test_1m_key(void)
>  {
>  	int i;
>  	bool rp = true;
> -	union r1 r1;
> +	union pfmf_r1 r1;
>  	union skey skey;
> +	void *addr = pagebuf;
>  
>  	report_prefix_push("1M");
>  	r1.val = 0;
>  	r1.reg.sk = 1;
> -	r1.reg.fsc = FSC_1M;
> +	r1.reg.fsc = PFMF_FSC_1M;
>  	r1.reg.key = 0x30;
> -	pfmf(r1.val, (unsigned long) pagebuf);
> +	while (addr != pagebuf + 256 * PAGE_SIZE) {
> +	       addr = pfmf(r1.val, addr);
> +	}

Why this change? If PFMF gets interrupted, the PSW should still point to
the PFMF instruction, so no need to loop here ... or do I miss something?

(See PoP, chapter "Execution of Interruptible Instructions")

>  	for (i = 0; i < 256; i++) {
>  		skey.val = get_storage_key((unsigned long) pagebuf + i * PAGE_SIZE);
>  		skey.val &= SKEY_ACC | SKEY_FP;
> @@ -103,15 +75,15 @@ static void test_1m_key(void)
>  
>  static void test_4k_clear(void)
>  {
> -	union r1 r1;
> +	union pfmf_r1 r1;
>  
>  	r1.val = 0;
>  	r1.reg.cf = 1;
> -	r1.reg.fsc = FSC_4K;
> +	r1.reg.fsc = PFMF_FSC_4K;
>  
>  	report_prefix_push("4K");
>  	memset(pagebuf, 42, PAGE_SIZE);
> -	pfmf(r1.val, (unsigned long) pagebuf);
> +	pfmf(r1.val, pagebuf);
>  	report("clear memory", !memcmp(pagebuf, pagebuf + PAGE_SIZE, PAGE_SIZE));
>  	report_prefix_pop();
>  }
> @@ -119,16 +91,19 @@ static void test_4k_clear(void)
>  static void test_1m_clear(void)
>  {
>  	int i;
> -	union r1 r1;
> +	union pfmf_r1 r1;
>  	unsigned long sum = 0;
> +	void *addr = pagebuf;
>  
>  	r1.val = 0;
>  	r1.reg.cf = 1;
> -	r1.reg.fsc = FSC_1M;
> +	r1.reg.fsc = PFMF_FSC_1M;
>  
>  	report_prefix_push("1M");
>  	memset(pagebuf, 42, PAGE_SIZE * 256);
> -	pfmf(r1.val, (unsigned long) pagebuf);
> +	while (addr != pagebuf + 256 * PAGE_SIZE) {
> +	       addr = pfmf(r1.val, addr);
> +	}

dito.

 Thomas


  reply	other threads:[~2019-08-27 15:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-27 13:49 [kvm-unit-tests PATCH 0/3] s390x: Add skey removal facility test Janosch Frank
2019-08-27 13:49 ` [kvm-unit-tests PATCH 1/3] s390x: Move pfmf to lib and make address void Janosch Frank
2019-08-27 15:23   ` Thomas Huth [this message]
2019-08-27 13:49 ` [kvm-unit-tests PATCH 2/3] s390x: Storage key library functions now take void ptr addresses Janosch Frank
2019-08-27 15:28   ` Thomas Huth
2019-08-27 13:49 ` [kvm-unit-tests PATCH 3/3] s390x: Add storage key removal facility Janosch Frank
2019-08-27 17:58   ` Thomas Huth
2019-08-28  6:26     ` Janosch Frank
2019-08-28  7:56       ` Thomas Huth

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=e722fde9-d00a-ca65-91a3-9c7801c2352a@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