From: "Marc Hartmayer" <mhartmay@linux.ibm.com>
To: Steffen Eiden <seiden@linux.ibm.com>,
qemu-s390x@nongnu.org, qemu-devel@nongnu.org
Cc: Janosch Frank <frankja@linux.ibm.com>,
Thomas Huth <thuth@redhat.com>,
David Hildenbrand <david@redhat.com>,
Michael Mueller <mimu@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>
Subject: Re: [PATCH v4 2/5] s390x: switch pv and subsystem reset ordering on reboot
Date: Thu, 31 Aug 2023 18:21:31 +0200 [thread overview]
Message-ID: <87o7in2nec.fsf@linux.ibm.com> (raw)
In-Reply-To: <20230823142219.1046522-3-seiden@linux.ibm.com>
On Wed, Aug 23, 2023 at 04:22 PM +0200, Steffen Eiden <seiden@linux.ibm.com> wrote:
> From: Janosch Frank <frankja@linux.ibm.com>
>
> 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 switch the ordering around to make that happen.
>
> Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
> ---
> hw/s390x/s390-virtio-ccw.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
> index 4b36c9970e..795dd53d68 100644
> --- a/hw/s390x/s390-virtio-ccw.c
> +++ b/hw/s390x/s390-virtio-ccw.c
> @@ -442,13 +442,13 @@ static void s390_machine_reset(MachineState *machine, ShutdownCause reason)
> switch (reset_type) {
> case S390_RESET_EXTERNAL:
> case S390_RESET_REIPL:
> + qemu_devices_reset(reason);
> + s390_crypto_reset();
> +
> if (s390_is_pv()) {
> s390_machine_unprotect(ms);
> }
>
> - qemu_devices_reset(reason);
> - s390_crypto_reset();
> -
> /* configure and start the ipl CPU only */
> run_on_cpu(cs, s390_do_cpu_ipl, RUN_ON_CPU_NULL);
> break;
> --
> 2.41.0
>
Unfortunately, this breaks things for me. You can reproduce the problem
easily… Start an SE guest via direct kernel boot and reboot the guest
after the guest has booted.
e.g.
$ sudo qemu-system-s390x -smp 2 --machine accel=kvm,aes-key-wrap=off -kernel /var/lib/libvirt/images/hades/vmlinux-s390x.se.img -m 2048 -nographic -nodefaults -chardev stdio,id=c1,mux=on -device sclpconsole,chardev=c1 -append "earlyprintk"
…
# reboot # (console in the guest)
…
[ 3.966496] systemd-shutdown[1]: Syncing filesystems and block devices.
[ 3.966606] systemd-shutdown[1]: Rebooting.
qemu-system-s390x: CPU reset failed on CPU 0 type aec4
qemu-system-s390x: CPU reset failed on CPU 1 type aec4
qemu-system-s390x: KVM PV command 4 (KVM_PV_VERIFY) failed: header rc 102 rrc 1b IOCTL rc: -22
Protected boot has failed: 0xa02
--
Kind regards / Beste Grüße
Marc Hartmayer
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Gregor Pillen
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
next prev parent reply other threads:[~2023-08-31 16:22 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 [this message]
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
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=87o7in2nec.fsf@linux.ibm.com \
--to=mhartmay@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=david@redhat.com \
--cc=frankja@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).