On 25/5/23 14:55, Peter Maydell wrote:
On Thu, 25 May 2023 at 13:52, Alex Bennée <alex.ben...@linaro.org> wrote:


Peter Maydell <peter.mayd...@linaro.org> writes:

On Mon, 22 May 2023 at 16:32, Philippe Mathieu-Daudé <phi...@linaro.org> wrote:

Do not transmit characters when UART or transmitter are disabled.

Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>

Last time somebody tried to add checks on the tx/rx enable bits
for the PL011 it broke 'make check' because the hand-rolled
UART code in boot-serial-test and migration-test doesn't
set up the UART control register strictly correctly:

https://lore.kernel.org/qemu-devel/cafeaca8zdmjp7g0evpxcb1jisgarzabqpv0xr5wqur213mb...@mail.gmail.com/

Hmm I ran 'make check-qtest' my build directory only targets aarch64,
I probably missed the arm (32-bit) tests :/

Given that imposing these checks doesn't help anything
much and might break naive bare-metal tested-only-on-QEMU
code, is it worthwhile ?

Surely we aim to be a correct model so the fix should be in our naive
and incorrect code?

In our own test suites, sure -- we should probably fix that
even if we don't change the PL011 model to require it.
But if we let this kind of thing get past us in our own testsuite,
it suggests there's probably a lot of similar naive code out
there in the world -- these Arm boards with PL011s are pretty
commonly used for "my first bare metal assembly program" stuff
and there's a lot of cargo-culting of how to do things like
serial output, and programs that were never tested on any
real hardware...

OK. I'll add a comment, keep the current behavior when TX is
disabled, but add a GUEST_ERROR log message.

Reply via email to