From: Christian Borntraeger <borntraeger@linux.ibm.com>
To: Janosch Frank <frankja@linux.ibm.com>, qemu-s390x@nongnu.org
Cc: qemu-devel@nongnu.org, seiden@linux.ibm.com,
mhartmay@linux.ibm.com, thuth@redhat.com, david@redhat.com,
mimu@linux.ibm.com
Subject: Re: [PATCH] s390x: do a subsystem reset before the unprotect on reboot
Date: Wed, 6 Sep 2023 15:41:17 +0200 [thread overview]
Message-ID: <b32fe1b9-e05d-971b-41d7-0ab925853014@linux.ibm.com> (raw)
In-Reply-To: <20230901114851.154357-1-frankja@linux.ibm.com>
Am 01.09.23 um 13:48 schrieb Janosch Frank:
> Bound APQNs have to be reset before tearing down the secure config via
> s390_machine_unprotect(). Otherwise the Ultravisor will return a error
> code.
>
> So let's do a subsystem_reset() which includes a AP reset before the
> unprotect call. We'll do a full device_reset() afterwards which will
> reset some devices twice. That's ok since we can't move the
> device_reset() before the unprotect as it includes a CPU clear reset
> which the Ultravisor does not expect at that point in time.
>
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Makes sense.
Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
> ---
>
> I'm not able to test this for the PV AP case right new, that has to
> wait to early next week. However Marc told me that the non-AP PV test
> works fine now.
>
> ---
> hw/s390x/s390-virtio-ccw.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
> index 3dd0b2372d..2d75f2131f 100644
> --- a/hw/s390x/s390-virtio-ccw.c
> +++ b/hw/s390x/s390-virtio-ccw.c
> @@ -438,10 +438,20 @@ static void s390_machine_reset(MachineState *machine, ShutdownCause reason)
> switch (reset_type) {
> case S390_RESET_EXTERNAL:
> case S390_RESET_REIPL:
> + /*
> + * Reset the subsystem which includes a AP reset. If a PV
> + * guest had APQNs attached the AP reset is a prerequisite to
> + * unprotecting since the UV checks if all APQNs are reset.
> + */
> + subsystem_reset();
> if (s390_is_pv()) {
> s390_machine_unprotect(ms);
> }
>
> + /*
> + * Device reset includes CPU clear resets so this has to be
> + * done AFTER the unprotect call above.
> + */
> qemu_devices_reset(reason);
> s390_crypto_reset();
>
next prev parent reply other threads:[~2023-09-06 13:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-23 14:22 [PATCH v4 0/5] s390: Enable AP instructions for pv-guests Steffen Eiden
2023-08-23 14:22 ` [PATCH v4 1/5] s390x/ap: fix missing subsystem reset registration Steffen Eiden
2023-08-23 14:22 ` [PATCH v4 2/5] s390x: switch pv and subsystem reset ordering on reboot Steffen Eiden
2023-08-31 16:21 ` Marc Hartmayer
2023-09-01 6:31 ` Janosch Frank
2023-09-01 11:48 ` [PATCH] s390x: do a subsystem reset before the unprotect " Janosch Frank
2023-09-06 12:49 ` Viktor Mihajlovski
2023-09-06 13:41 ` Christian Borntraeger [this message]
2023-08-23 14:22 ` [PATCH v4 3/5] NOTFORMERGE update linux-headers/asm-s390/kvm.h Steffen Eiden
2023-08-23 14:22 ` [PATCH v4 4/5] target/s390x/kvm: Refactor AP functionalities Steffen Eiden
2023-08-23 14:22 ` [PATCH v4 5/5] target/s390x: AP-passthrough for PV guests Steffen Eiden
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=b32fe1b9-e05d-971b-41d7-0ab925853014@linux.ibm.com \
--to=borntraeger@linux.ibm.com \
--cc=david@redhat.com \
--cc=frankja@linux.ibm.com \
--cc=mhartmay@linux.ibm.com \
--cc=mimu@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--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;
as well as URLs for NNTP newsgroup(s).