From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: Janosch Frank <frankja@linux.ibm.com>
Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org,
david@redhat.com, thuth@redhat.com, seiden@linux.ibm.com,
mhartmay@linux.ibm.com
Subject: Re: [kvm-unit-tests PATCH 1/8] lib: s390x: sie: Add sca allocation and freeing
Date: Tue, 23 Nov 2021 11:51:14 +0100 [thread overview]
Message-ID: <20211123115114.65f48dd4@p-imbrenda> (raw)
In-Reply-To: <20211123103956.2170-2-frankja@linux.ibm.com>
On Tue, 23 Nov 2021 10:39:49 +0000
Janosch Frank <frankja@linux.ibm.com> wrote:
> For protected guests we always need a ESCA so let's add functions to
> create and destroy SCAs on demand. We don't have scheduling and I
> don't expect multiple VCPU SIE in the next few months so SCA content
> handling is not added.
>
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
> ---
> lib/s390x/sie.c | 12 ++++++++++++
> lib/s390x/sie.h | 2 ++
> 2 files changed, 14 insertions(+)
>
> diff --git a/lib/s390x/sie.c b/lib/s390x/sie.c
> index b965b314..51d3b94e 100644
> --- a/lib/s390x/sie.c
> +++ b/lib/s390x/sie.c
> @@ -55,6 +55,16 @@ void sie(struct vm *vm)
> vm->save_area.guest.grs[15] = vm->sblk->gg15;
> }
>
> +void sie_guest_sca_create(struct vm *vm)
> +{
> + vm->sca = (struct esca_block *)alloc_page();
> +
> + /* Let's start out with one page of ESCA for now */
> + vm->sblk->scaoh = ((uint64_t)vm->sca >> 32);
> + vm->sblk->scaol = (uint64_t)vm->sca & ~0x3fU;
> + vm->sblk->ecb2 |= ECB2_ESCA;
> +}
> +
> /* Initializes the struct vm members like the SIE control block. */
> void sie_guest_create(struct vm *vm, uint64_t guest_mem, uint64_t guest_mem_len)
> {
> @@ -80,4 +90,6 @@ void sie_guest_destroy(struct vm *vm)
> {
> free_page(vm->crycb);
> free_page(vm->sblk);
> + if (vm->sblk->ecb2 & ECB2_ESCA)
> + free_page(vm->sca);
> }
> diff --git a/lib/s390x/sie.h b/lib/s390x/sie.h
> index 7ef7251b..f34e3c80 100644
> --- a/lib/s390x/sie.h
> +++ b/lib/s390x/sie.h
> @@ -191,6 +191,7 @@ struct vm_save_area {
> struct vm {
> struct kvm_s390_sie_block *sblk;
> struct vm_save_area save_area;
> + void *sca; /* System Control Area */
> uint8_t *crycb; /* Crypto Control Block */
> /* Ptr to first guest page */
> uint8_t *guest_mem;
> @@ -203,6 +204,7 @@ void sie(struct vm *vm);
> void sie_expect_validity(void);
> void sie_check_validity(uint16_t vir_exp);
> void sie_handle_validity(struct vm *vm);
> +void sie_guest_sca_create(struct vm *vm);
> void sie_guest_create(struct vm *vm, uint64_t guest_mem, uint64_t guest_mem_len);
> void sie_guest_destroy(struct vm *vm);
>
next prev parent reply other threads:[~2021-11-23 11:41 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-23 10:39 [kvm-unit-tests PATCH 0/8] s390x: sie: Add PV snippet support Janosch Frank
2021-11-23 10:39 ` [kvm-unit-tests PATCH 1/8] lib: s390x: sie: Add sca allocation and freeing Janosch Frank
2021-11-23 10:51 ` Claudio Imbrenda [this message]
2021-11-23 10:39 ` [kvm-unit-tests PATCH 2/8] s390x: sie: Add PV fields to SIE control block Janosch Frank
2021-11-23 10:52 ` Claudio Imbrenda
2021-11-23 10:39 ` [kvm-unit-tests PATCH 3/8] s390x: sie: Add UV information into VM struct Janosch Frank
2021-11-23 10:54 ` Claudio Imbrenda
2021-11-23 12:49 ` Janosch Frank
2021-11-23 10:39 ` [kvm-unit-tests PATCH 4/8] s390x: uv: Add more UV call functions Janosch Frank
2021-11-23 10:56 ` Claudio Imbrenda
2021-11-23 10:39 ` [kvm-unit-tests PATCH 5/8] s390x: lib: Extend UV library with PV guest management Janosch Frank
2021-11-23 11:13 ` Claudio Imbrenda
2021-11-23 10:39 ` [kvm-unit-tests PATCH 6/8] lib: s390: sie: Add PV guest register handling Janosch Frank
2021-11-23 11:14 ` Claudio Imbrenda
2021-11-23 10:39 ` [kvm-unit-tests PATCH 7/8] s390x: snippets: Add PV support Janosch Frank
2021-11-23 11:22 ` Claudio Imbrenda
2021-11-26 13:28 ` Janosch Frank
2021-12-03 9:29 ` Janosch Frank
2022-01-13 13:10 ` Janosch Frank
2022-01-13 13:17 ` Claudio Imbrenda
2021-11-23 10:39 ` [kvm-unit-tests PATCH 8/8] s390x: sie: Add PV diag test Janosch Frank
2021-11-23 11:41 ` Claudio Imbrenda
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=20211123115114.65f48dd4@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=mhartmay@linux.ibm.com \
--cc=seiden@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