SLOF/board-qemu
Jordan Niethe dd4d4ea0ad virtio-serial: Do not close stdout on quiesce
Commit 76fee95 ("slof: Only close stdout for virtio-serial devices")
says that commit cf28264 ("virtio-serial: Rework shutdown sequence")
fixed a hang. The problem was believed to be that it was necessary to
close stdout to shutdown the underlying virtio device.

Commit cf28264 ("virtio-serial: Rework shutdown sequence") closed stdout
on quiesce. This meant when prom_init() called write on stdout after
quiesce, there is a use after free so this is unreliable, and can also
hang (especially after reboots).

Quiescing is intended to put hardware into a safe state for the client
to take over. It is incorrect for SLOF to close ihandles that the client
could still be using, even after a quiesce.

Rather than closing the stdout device, all that needs to happen is to
ensure virtio-serial-shutdown gets called. On quiesce, close the virtio
device, but leave the stdout device itself open.

Commit 8174acd ("virtio-serial: Close device completely") handles reads
and writes as no-ops if the underlying virtio device is closed so there
is no problem with the client calling "write" on stdout after this, but
no output will be displayed.

Fixes: cf28264 ("virtio-serial: Rework shutdown sequence")
Debugged-by: Kautuk Consul <kconsul@linux.vnet.ibm.com>
Co-developed-by: Kautuk Consul <kconsul@linux.vnet.ibm.com>
Signed-off-by: Kautuk Consul <kconsul@linux.vnet.ibm.com>
Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2023-09-18 18:20:45 +10:00
..
include Fix typos in the board-qemu folder 2023-02-28 15:23:05 +11:00
llfw board-qemu: Fix comment about SLOF start address 2020-06-24 10:30:28 +10:00
romfs Do not link libnet to net-snk anymore, and remove net-snk from board-qemu 2016-10-17 11:02:16 +11:00
slof virtio-serial: Do not close stdout on quiesce 2023-09-18 18:20:45 +10:00
Makefile tpm: Add TPM CRQ driver implementation 2020-02-21 14:03:07 +11:00
Makefile.dirs Initial qemu/KVM board support 2011-03-22 15:22:00 +01:00
config dhcparch define missing in compilation 2014-06-12 23:57:12 +05:30