From: Marc Zyngier <maz@kernel.org>
To: Gavin Shan <gshan@redhat.com>
Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org,
qemu-devel@nongnu.org, shan.gavin@gmail.com
Subject: Re: [PATCH] hw/char/pl011: Output characters using best-effort mode
Date: Thu, 20 Feb 2020 09:10:11 +0000 [thread overview]
Message-ID: <f3c8adba729d050ba2144cc9c834fe82@kernel.org> (raw)
In-Reply-To: <20200220060108.143668-1-gshan@redhat.com>
On 2020-02-20 06:01, Gavin Shan wrote:
> Currently, PL011 is used by ARM virt board by default. It's possible to
> block the system from booting. With below parameters in command line,
> the
> backend could run into endless attempts of transmitting packets, which
> can't succeed because of running out of sending buffer. The socket
> might
> be not accepted n server side. It's not correct because disconnected
> serial port shouldn't stop the system from booting.
>
> -machine virt,gic-version=3 -cpu max -m 4096
> -monitor none -serial tcp:127.0.0.1:50900
>
> The issue can be reproduced by starting a program which listens on TCP
> port 50900 and then sleep without accepting any incoming connections.
> On
> the other hand, a VM is started with above parameters and modified qemu
> where the PL011 is flooded with 5000K data after it's created.
> Eventually,
> the flooding won't proceed and stops after transmitting 2574K data.
> It's
> basically to simulate tons of output from EDK-II and demonstrates how
> the
> tons of output can block the system from booting.
>
> This fixes the issue by using newly added API
> qemu_chr_fe_try_write_all(),
> which provides another type of service (best-effort). It's different
> from
> qemu_chr_fe_write_all() as the data will be dropped if the backend has
> been running into so-called broken state or 50 attempts of
> transmissions.
> The broken state is cleared if the data is transmitted at once.
I don't think dropping the serial port output is an acceptable outcome.
If someone decides to log their console with something that is very slow
(because they decide to carve every bit of it into stone), it shouldn't
be QEMU's decision to just give up on it. Specially if the console is
over TCP, which garantees no loss of data. Someone wanting to have the
behaviour you describe would probably use UDP as the transport protocol
and deal with the consequences.
Similarly, QEMU doesn't drop data on the floor when a write to a disk
image that results in a block allocation fails because the host
filesystem
is full.
Thanks,
M.
--
Jazz is not dead. It just smells funny...
next prev parent reply other threads:[~2020-02-20 9:10 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-20 6:01 [PATCH] hw/char/pl011: Output characters using best-effort mode Gavin Shan
2020-02-20 8:47 ` Philippe Mathieu-Daudé
2020-02-20 9:07 ` Gavin Shan
2020-02-20 9:10 ` Marc Zyngier [this message]
2020-02-20 10:10 ` Peter Maydell
2020-02-21 4:24 ` Gavin Shan
2020-02-21 9:09 ` Marc Zyngier
2020-02-23 23:57 ` Gavin Shan
2020-02-21 10:21 ` Peter Maydell
2020-02-21 11:44 ` Paolo Bonzini
2020-02-21 12:44 ` Peter Maydell
2020-02-21 13:09 ` Paolo Bonzini
2020-02-21 13:14 ` Peter Maydell
2020-02-21 18:15 ` Paolo Bonzini
2020-02-23 23:45 ` Gavin Shan
2020-02-23 23:26 ` Gavin Shan
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=f3c8adba729d050ba2144cc9c834fe82@kernel.org \
--to=maz@kernel.org \
--cc=gshan@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=shan.gavin@gmail.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).