public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Janosch Frank <frankja@linux.ibm.com>
To: Nina Schoetterl-Glausch <nsg@linux.ibm.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	Thomas Huth <thuth@redhat.com>, Nico Boehr <nrb@linux.ibm.com>
Cc: Andrew Jones <andrew.jones@linux.dev>,
	linux-s390@vger.kernel.org, David Hildenbrand <david@redhat.com>,
	kvm@vger.kernel.org
Subject: Re: [kvm-unit-tests PATCH v2 3/5] s390x: Add library functions for exiting from snippet
Date: Mon, 8 Jan 2024 14:33:29 +0100	[thread overview]
Message-ID: <1f818fb8-9d69-43ba-9270-d4f387e7acf4@linux.ibm.com> (raw)
In-Reply-To: <00dc269c9a487b4601fc27c97771240e0b407ff6.camel@linux.ibm.com>

On 1/8/24 13:58, Nina Schoetterl-Glausch wrote:
> On Mon, 2024-01-08 at 13:47 +0100, Janosch Frank wrote:
>> On 1/5/24 23:54, Nina Schoetterl-Glausch wrote:
>>> It is useful to be able to force an exit to the host from the snippet,
>>> as well as do so while returning a value.
>>> Add this functionality, also add helper functions for the host to check
>>> for an exit and get or check the value.
>>> Use diag 0x44 and 0x9c for this.
>>> Add a guest specific snippet header file and rename snippet.h to reflect
>>> that it is host specific.
>>>
>>> Signed-off-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
>>> ---
>>>    s390x/Makefile                          |  1 +
>>>    lib/s390x/asm/arch_def.h                | 13 ++++++++
>>>    lib/s390x/sie.h                         |  1 +
>>>    lib/s390x/snippet-guest.h               | 26 +++++++++++++++
>>>    lib/s390x/{snippet.h => snippet-host.h} | 10 ++++--
>>>    lib/s390x/sie.c                         | 31 ++++++++++++++++++
>>>    lib/s390x/snippet-host.c                | 42 +++++++++++++++++++++++++
>>>    lib/s390x/uv.c                          |  2 +-
>>>    s390x/mvpg-sie.c                        |  2 +-
>>>    s390x/pv-diags.c                        |  2 +-
>>>    s390x/pv-icptcode.c                     |  2 +-
>>>    s390x/pv-ipl.c                          |  2 +-
>>>    s390x/sie-dat.c                         |  2 +-
>>>    s390x/spec_ex-sie.c                     |  2 +-
>>>    s390x/uv-host.c                         |  2 +-
>>>    15 files changed, 129 insertions(+), 11 deletions(-)
>>>    create mode 100644 lib/s390x/snippet-guest.h
>>>    rename lib/s390x/{snippet.h => snippet-host.h} (92%)
>>>    create mode 100644 lib/s390x/snippet-host.c
> 
> [..]
>   
>>> +bool sie_is_diag_icpt(struct vm *vm, unsigned int diag)
>>> +{
>>> +	union {
>>> +		struct {
>>> +			uint64_t     : 16;
>>> +			uint64_t ipa : 16;
>>> +			uint64_t ipb : 32;
>>> +		};
>>> +		struct {
>>> +			uint64_t          : 16;
>>> +			uint64_t opcode   :  8;
>>> +			uint64_t r_1      :  4;
>>> +			uint64_t r_2      :  4;
>>> +			uint64_t r_base   :  4;
>>> +			uint64_t displace : 12;
>>> +			uint64_t zero     : 16;
>>> +		};
>>> +	} instr = { .ipa = vm->sblk->ipa, .ipb = vm->sblk->ipb };
>>> +	uint64_t code;
>>> +
>>> +	assert(diag == 0x44 || diag == 0x9c);
>>
>> You're calling it is_diag_icpt and only allow two.
>> Do you have a reason for clamping this down?
> 
> I should have left the comment.
> They're just "not implemented".
> The PoP doesn't specify how diags are generally interpreted,
> so I intended that if any other diags are needed whoever needs them
> just checks if the existing logic works or if changes are required.
>>

Right, but 288, 308 and 500 are being used in the PV sie tests and could 
be integrated.

  reply	other threads:[~2024-01-08 13:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-05 22:54 [kvm-unit-tests PATCH v2 0/5] s390x: STFLE nested interpretation Nina Schoetterl-Glausch
2024-01-05 22:54 ` [kvm-unit-tests PATCH v2 1/5] lib: Add pseudo random functions Nina Schoetterl-Glausch
2024-01-08  9:02   ` Andrew Jones
2024-01-05 22:54 ` [kvm-unit-tests PATCH v2 2/5] s390x: lib: Remove double include Nina Schoetterl-Glausch
2024-01-31  9:04   ` Janosch Frank
2024-01-05 22:54 ` [kvm-unit-tests PATCH v2 3/5] s390x: Add library functions for exiting from snippet Nina Schoetterl-Glausch
2024-01-08 12:47   ` Janosch Frank
2024-01-08 12:58     ` Nina Schoetterl-Glausch
2024-01-08 13:33       ` Janosch Frank [this message]
2024-01-05 22:54 ` [kvm-unit-tests PATCH v2 4/5] s390x: Use library functions for snippet exit Nina Schoetterl-Glausch
2024-01-05 22:54 ` [kvm-unit-tests PATCH v2 5/5] s390x: Add test for STFLE interpretive execution (format-0) Nina Schoetterl-Glausch

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=1f818fb8-9d69-43ba-9270-d4f387e7acf4@linux.ibm.com \
    --to=frankja@linux.ibm.com \
    --cc=andrew.jones@linux.dev \
    --cc=david@redhat.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=nrb@linux.ibm.com \
    --cc=nsg@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox