mbox series

[00/12] hw/char/pl011: Implement TX (async) FIFO to avoid blocking the main loop

Message ID 20230522153144.30610-1-philmd@linaro.org
Headers show
Series hw/char/pl011: Implement TX (async) FIFO to avoid blocking the main loop | expand

Message

Philippe Mathieu-Daudé May 22, 2023, 3:31 p.m. UTC
Hi,

This series add support for (async) FIFO on the transmit path
of the PL011 UART.

- First we add fifo8_peek_buf() to the fifo8 API (patches 1-3),
- Then we massage a bit the pl011 model to ease development
  (patches 4-11),
- Finally we add the TX FIFO implementation using a chardev
  front-end 'watch' callback.

The last patch is RFC mostly because I don't know what is the
best way to resolve adding a new migratable field without
breaking the migration stream.

Tested with qtest/avocado/TRS test suites:

 trs-workspace$ make test
 Startup finished in 6min 40.596s (kernel) + 38.786s (userspace) = 7min 19.382s.
 RESULTS - date.DateTest.test_date: PASSED (46.90s)
 RESULTS - df.DfTest.test_df: PASSED (2.29s)
 RESULTS - parselogs.ParseLogsTest.test_parselogs: PASSED (23.45s)
 RESULTS - ping.PingTest.test_ping: PASSED (0.05s)
 RESULTS - python.PythonTest.test_python3: PASSED (2.72s)
 RESULTS - rtc.RTCTest.test_rtc: PASSED (51.84s)
 RESULTS - ssh.SSHTest.test_ssh: PASSED (4.56s)
 RESULTS - systemd.SystemdBasicTests.test_systemd_basic: PASSED (2.33s)
 RESULTS - systemd.SystemdBasicTests.test_systemd_failed: PASSED (4.41s)
 RESULTS - systemd.SystemdBasicTests.test_systemd_list: PASSED (30.07s)
 RESULTS - systemd.SystemdJournalTests.test_systemd_boot_time: PASSED (2.42s)
 RESULTS - systemd.SystemdJournalTests.test_systemd_journal: PASSED (2.62s)
 RESULTS - systemd.SystemdServiceTests.test_systemd_disable_enable: PASSED (40.34s)
 RESULTS - systemd.SystemdServiceTests.test_systemd_status: PASSED (2.43s)
 RESULTS - systemd.SystemdServiceTests.test_systemd_stop_start: PASSED (9.23s)
 RESULTS - opteetest.OpteeTestSuite.test_opteetest_xtest: PASSED (329.89s)
 RESULTS - soafeetestsuite.SoafeeTestSuite.test_soafee: PASSED (272.07s)
 RESULTS - tpm.TpmTestSuite.test_tpm: PASSED (53.61s)
 RESULTS - ptest.PtestRunnerTest.test_ptestrunner_expectfail: SKIPPED (0.00s)
 RESULTS - ptest.PtestRunnerTest.test_ptestrunner_expectsuccess: SKIPPED (0.00s)
 RESULTS - systemd.SystemdServiceTests.test_systemd_disable_enable_ro: SKIPPED (0.00s)
 SUMMARY:
 trs-image () - Ran 21 tests in 883.291s
 trs-image - OK - All required tests passed (successes=18, skipped=3, failures=0, errors=0)

Philippe Mathieu-Daudé (12):
  util/fifo8: Fix typo in fifo8_push_all() description
  util/fifo8: Allow fifo8_pop_buf() to not populate popped length
  util/fifo8: Introduce fifo8_peek_buf()
  hw/char/pl011: Display register name in trace events
  hw/char/pl011: Remove duplicated PL011_INT_[RT]X definitions
  hw/char/pl011: Replace magic values by register field definitions
  hw/char/pl011: Split RX/TX path of pl011_reset_fifo()
  hw/char/pl011: Extract pl011_write_tx() from pl011_write()
  hw/char/pl011: Check if transmitter is enabled
  hw/char/pl011: Check if receiver is enabled
  hw/char/pl011: Rename RX FIFO methods
  hw/char/pl011: Implement TX FIFO

 include/hw/char/pl011.h |   2 +
 include/qemu/fifo8.h    |  38 ++++++--
 hw/char/pl011.c         | 209 +++++++++++++++++++++++++++++++++-------
 util/fifo8.c            |  28 +++++-
 hw/char/trace-events    |  12 ++-
 5 files changed, 239 insertions(+), 50 deletions(-)