[PATCH v4 0/5] Series of fixes for PL011 char device

Evgeny Iakovlev posted 5 patches 2 weeks, 2 days ago
hw/char/pl011.c         | 121 +++++++++++++++++++++++++++++++++-------
include/hw/char/pl011.h |   5 +-
2 files changed, 105 insertions(+), 21 deletions(-)
[PATCH v4 0/5] Series of fixes for PL011 char device
Posted by Evgeny Iakovlev 2 weeks, 2 days ago
v4:
* Fixed post_load hook to be backwards-migratable
* Refactored some code in 5/5 as per review comments

v3:
* Introduced a post_load hook for PL011State migration for
  backwards-compatibility due to some input state fragility.
* No longer touching irq lines in reset method
* Minor changes based on review feedback.

v2:
* Moved FIFO depth refactoring part of FIFO flags change into its own
  commit.
* Added a reset method for PL011


Evgeny Iakovlev (5):
  hw/char/pl011: refactor FIFO depth handling code
  hw/char/pl011: add post_load hook for backwards-compatibility
  hw/char/pl011: implement a reset method
  hw/char/pl011: better handling of FIFO flags on LCR reset
  hw/char/pl011: check if UART is enabled before RX or TX operation

 hw/char/pl011.c         | 121 +++++++++++++++++++++++++++++++++-------
 include/hw/char/pl011.h |   5 +-
 2 files changed, 105 insertions(+), 21 deletions(-)

-- 
2.34.1
Re: [PATCH v4 0/5] Series of fixes for PL011 char device
Posted by Peter Maydell 6 days, 11 hours ago
On Mon, 23 Jan 2023 at 16:23, Evgeny Iakovlev
<eiakovlev@linux.microsoft.com> wrote:
>
> v4:
> * Fixed post_load hook to be backwards-migratable
> * Refactored some code in 5/5 as per review comments
>
> v3:
> * Introduced a post_load hook for PL011State migration for
>   backwards-compatibility due to some input state fragility.
> * No longer touching irq lines in reset method
> * Minor changes based on review feedback.
>
> v2:
> * Moved FIFO depth refactoring part of FIFO flags change into its own
>   commit.
> * Added a reset method for PL011

Patch 5 in this series breaks "make check" for both the
boot-serial-test and the migration-test (both of which
have some simple code that writes to the serial port).
I suspect in both cases that the guest code is just not
bothering to set the UART control register correctly,
because it's never needed to do so in the past.

(This does make me wonder about the utility of making
this change -- it seems likely that we're going to break
naive bare-metal intended-to-work-on-QEMU code and not
really benefit any real-world runs-on-real-hardware
code, which is presumably just enabling TX and RX and
leaving it that way.)

I've taken patches 1-4 into target-arm.next.

thanks
-- PMM