From: Steffen Eiden <seiden@linux.ibm.com>
To: Janosch Frank <frankja@linux.ibm.com>, kvm@vger.kernel.org
Cc: imbrenda@linux.ibm.com, nrb@linux.ibm.com, scgl@linux.ibm.com,
thuth@redhat.com
Subject: Re: [kvm-unit-tests PATCH v3 5/6] lib: s390x: Enable reusability of VMs that were in PV mode
Date: Fri, 21 Oct 2022 11:40:31 +0200 [thread overview]
Message-ID: <f615f244-e5d6-1f2e-7976-10ff6bcd055e@linux.ibm.com> (raw)
In-Reply-To: <20221021063902.10878-6-frankja@linux.ibm.com>
On 10/21/22 08:39, Janosch Frank wrote:
> Convert the sblk to non-PV when the PV guest is destroyed.
>
> Early return in uv_init() instead of running into the assert. This is
> necessary since snippet_pv_init() will always call uv_init().
>
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
> ---
> lib/s390x/uv.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/lib/s390x/uv.c b/lib/s390x/uv.c
> index b2a43424..383271a5 100644
> --- a/lib/s390x/uv.c
> +++ b/lib/s390x/uv.c
> @@ -76,7 +76,8 @@ void uv_init(void)
> int cc;
>
> /* Let's not do this twice */
> - assert(!initialized);
> + if (initialized)
> + return;
> /* Query is done on initialization but let's check anyway */
> assert(uvcb_qui.header.rc == 1 || uvcb_qui.header.rc == 0x100);
>
> @@ -188,6 +189,14 @@ void uv_destroy_guest(struct vm *vm)
> free_pages(vm->uv.conf_var_stor);
>
> free_pages((void *)(vm->uv.asce & PAGE_MASK));
> + memset(&vm->uv, 0, sizeof(vm->uv));
> +
> + /* Convert the sblk back to non-PV */
> + vm->save_area.guest.asce = stctg(1);
> + vm->sblk->sdf = 0;
> + vm->sblk->sidad = 0;
> + vm->sblk->pv_handle_cpu = 0;
> + vm->sblk->pv_handle_config = 0;
> }
>
> int uv_unpack(struct vm *vm, uint64_t addr, uint64_t len, uint64_t tweak)
next prev parent reply other threads:[~2022-10-21 9:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-21 6:38 [kvm-unit-tests PATCH v3 0/6] s390x: PV fixups Janosch Frank
2022-10-21 6:38 ` [kvm-unit-tests PATCH v3 1/6] s390x: snippets: asm: Add a macro to write an exception PSW Janosch Frank
2022-10-21 6:38 ` [kvm-unit-tests PATCH v3 2/6] s390x: MAKEFILE: Use $< instead of pathsubst Janosch Frank
2022-10-21 6:38 ` [kvm-unit-tests PATCH v3 3/6] lib: s390x: sie: Improve validity handling and make it vm specific Janosch Frank
2022-10-21 6:39 ` [kvm-unit-tests PATCH v3 4/6] lib: s390x: Use a new asce for each PV guest Janosch Frank
2022-10-21 7:03 ` Claudio Imbrenda
2022-10-21 6:39 ` [kvm-unit-tests PATCH v3 5/6] lib: s390x: Enable reusability of VMs that were in PV mode Janosch Frank
2022-10-21 9:40 ` Steffen Eiden [this message]
2022-10-21 6:39 ` [kvm-unit-tests PATCH v3 6/6] lib: s390x: sie: Properly populate SCA Janosch Frank
2022-10-21 7:46 ` [kvm-unit-tests PATCH v3 0/6] s390x: PV fixups Claudio Imbrenda
2022-10-21 8:41 ` 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=f615f244-e5d6-1f2e-7976-10ff6bcd055e@linux.ibm.com \
--to=seiden@linux.ibm.com \
--cc=frankja@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=nrb@linux.ibm.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox