All of lore.kernel.org
 help / color / mirror / Atom feed
From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
Cc: Thomas Huth <thuth@redhat.com>,
	Janosch Frank <frankja@linux.ibm.com>,
	David Hildenbrand <david@redhat.com>,
	kvm@vger.kernel.org, linux-s390@vger.kernel.org
Subject: Re: [kvm-unit-tests PATCH v3 3/3] s390x: Test effect of storage keys on diag 308
Date: Tue, 24 May 2022 17:01:33 +0200	[thread overview]
Message-ID: <20220524170133.64edfada@p-imbrenda> (raw)
In-Reply-To: <20220523132406.1820550-4-scgl@linux.ibm.com>

On Mon, 23 May 2022 15:24:06 +0200
Janis Schoetterl-Glausch <scgl@linux.ibm.com> wrote:

> Test that key-controlled protection does not apply to diag 308.
> 
> Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>

Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>

> ---
>  s390x/skey.c | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/s390x/skey.c b/s390x/skey.c
> index a55034b5..074667e2 100644
> --- a/s390x/skey.c
> +++ b/s390x/skey.c
> @@ -300,6 +300,31 @@ static void test_store_cpu_address(void)
>  	report_prefix_pop();
>  }
>  
> +static void test_diag_308(void)
> +{
> +	uint16_t response;
> +	uint32_t *ipib = (uint32_t *)pagebuf;
> +
> +	report_prefix_push("DIAG 308");
> +	WRITE_ONCE(ipib[0], 0); /* Invalid length */
> +	set_storage_key(ipib, 0x28, 0);
> +	/* key-controlled protection does not apply */
> +	asm volatile (
> +		"lr	%%r2,%[ipib]\n\t"
> +		"spka	0x10\n\t"
> +		"diag	%%r2,%[code],0x308\n\t"
> +		"spka	0\n\t"
> +		"lr	%[response],%%r3\n"
> +		: [response] "=d" (response)
> +		: [ipib] "d" (ipib),
> +		  [code] "d" (5)
> +		: "%r2", "%r3"
> +	);
> +	report(response == 0x402, "no exception on fetch, response: invalid IPIB");
> +	set_storage_key(ipib, 0x00, 0);
> +	report_prefix_pop();
> +}
> +
>  /*
>   * Perform CHANNEL SUBSYSTEM CALL (CHSC)  instruction while temporarily executing
>   * with access key 1.
> @@ -712,6 +737,7 @@ int main(void)
>  	test_chg();
>  	test_test_protection();
>  	test_store_cpu_address();
> +	test_diag_308();
>  	test_channel_subsystem_call();
>  
>  	setup_vm();


      reply	other threads:[~2022-05-24 15:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-23 13:24 [kvm-unit-tests PATCH v3 0/4] More skey instr. emulation test Janis Schoetterl-Glausch
2022-05-23 13:24 ` [kvm-unit-tests PATCH v3 1/3] s390x: Test TEID values in storage key test Janis Schoetterl-Glausch
2022-05-24 15:09   ` Claudio Imbrenda
2022-06-08 17:03     ` Janis Schoetterl-Glausch
2022-06-09  7:44       ` Claudio Imbrenda
2022-05-23 13:24 ` [kvm-unit-tests PATCH v3 2/3] s390x: Test effect of storage keys on some more instructions Janis Schoetterl-Glausch
2022-05-25  6:05   ` Claudio Imbrenda
2022-05-23 13:24 ` [kvm-unit-tests PATCH v3 3/3] s390x: Test effect of storage keys on diag 308 Janis Schoetterl-Glausch
2022-05-24 15:01   ` Claudio Imbrenda [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=20220524170133.64edfada@p-imbrenda \
    --to=imbrenda@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=scgl@linux.ibm.com \
    --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.