[PATCH v3 00/14] TYPE_SERIAL cleanup

Bernhard Beschow posted 14 patches 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260305220911.131508-1-shentey@gmail.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, "Cédric Le Goater" <clg@kaod.org>, Steven Lee <steven_lee@aspeedtech.com>, Troy Lee <leetroy@gmail.com>, Jamin Lin <jamin_lin@aspeedtech.com>, Andrew Jeffery <andrew@codeconstruct.com.au>, Joel Stanley <joel@jms.id.au>, Richard Henderson <richard.henderson@linaro.org>, Helge Deller <deller@gmx.de>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>
include/hw/char/serial-mm.h |   3 -
include/hw/char/serial.h    |   8 ++-
include/qemu/fifo8.h        |  10 +--
hw/arm/aspeed_ast27x0-ssp.c |   7 +-
hw/arm/aspeed_ast27x0-tsp.c |   7 +-
hw/char/diva-gsp.c          |  23 +++---
hw/char/serial-isa.c        |  17 +++--
hw/char/serial-mm.c         |  59 ++--------------
hw/char/serial-pci-multi.c  |  23 +++---
hw/char/serial-pci.c        |  11 ++-
hw/char/serial.c            | 137 +++++++++++++++++++++++++-----------
util/fifo8.c                |  10 +--
hw/arm/Kconfig              |   2 +-
hw/char/trace-events        |   4 +-
14 files changed, 157 insertions(+), 164 deletions(-)
[PATCH v3 00/14] TYPE_SERIAL cleanup
Posted by Bernhard Beschow 1 month ago
This series consists of cosmetic changes around TYPE_SERIAL. The biggest change
is having it derive from TYPE_SYS_BUS_DEVICE which 1) eliminates usage of
qemu_{un,}register_reset() and 2) stops all its users from accessing private
data. The latter allows TYPE_SERIAL to be ported to Rust in the (near) future.

v3:
* Pick up further R-b tags. Thanks!
* Add patch "hw/char/{diva-gsp,serial-pci-multi}: Fix deinitialization order"
  (Peter)
* Justify switching to serial_io_ops in certain cases in TYPE_SERIAL_MM (Peter)

v2:
* Pick up R-b tags. Thanks!
* Ad patch to free consumers of TYPE_SERIAL from setting up MemoryRegionOps;
  configure via properties instead which should resolve odd code (Peter)
* Improve wording in one commit message (Peter)
* Sort patches by moving char/serial last
-> Keep "Avoid implicit conversion when tracing" untouched for now. Can be
  omitted if deemed inappropriate.

Testing done:
* Boot mpc8544ds machine with Linux and interact with it on the serial console
* Boot q35 machine with Arch Linux and interact with it on the serial console
* Make check
* Make check-functional with all architectures enabled:
    Summary of Failures:

    238/313 func-thorough+func-aarch64-thorough+thorough - qemu:func-aarch64-tcg_plugins          ERROR             0.72s   exit status 1
    309/313 func-thorough+func-x86_64-thorough+thorough - qemu:func-x86_64-vhost_user_bridge      TIMEOUT          90.01s   killed by signal 15 SIGTERM
    311/313 func-thorough+func-x86_64-thorough+thorough - qemu:func-x86_64-rebuild_vmfd           ERROR            33.64s   exit status 1

    Ok:                257
    Fail:              2
    Skipped:           53
    Timeout:           1

Bernhard Beschow (14):
  hw/arm/Kconfig: Fix serial selection for NPCM8XX
  hw/char/{diva-gsp,serial-pci-multi}: Fix deinitialization order
  hw/arm/aspeed_ast27x0-{ssp, tsp}: Do not access SerialMM internals
    directly
  util/fifo8: Make all read-only methods const-correct
  hw/char/serial: Remove explicit cast from void pointer
  hw/char/serial: Prefer fifo8 methods over open-coding
  hw/char/serial: Reuse fifo8_num_used()
  hw/char/serial: Remove unhelpful comment
  hw/char/serial: Add constants for Line Control Register
  hw/char/serial: Remove redundant reset
  hw/char/serial: Avoid implicit conversion when tracing
  hw/char/serial: Keep MemoryRegionOps private
  hw/char/serial: Inherit from SysBusDevice
  hw/char/serial: Plug into reset framework

 include/hw/char/serial-mm.h |   3 -
 include/hw/char/serial.h    |   8 ++-
 include/qemu/fifo8.h        |  10 +--
 hw/arm/aspeed_ast27x0-ssp.c |   7 +-
 hw/arm/aspeed_ast27x0-tsp.c |   7 +-
 hw/char/diva-gsp.c          |  23 +++---
 hw/char/serial-isa.c        |  17 +++--
 hw/char/serial-mm.c         |  59 ++--------------
 hw/char/serial-pci-multi.c  |  23 +++---
 hw/char/serial-pci.c        |  11 ++-
 hw/char/serial.c            | 137 +++++++++++++++++++++++++-----------
 util/fifo8.c                |  10 +--
 hw/arm/Kconfig              |   2 +-
 hw/char/trace-events        |   4 +-
 14 files changed, 157 insertions(+), 164 deletions(-)

-- 
2.53.0
Re: [PATCH v3 00/14] TYPE_SERIAL cleanup
Posted by Philippe Mathieu-Daudé 1 month ago
On 5/3/26 23:08, Bernhard Beschow wrote:
> This series consists of cosmetic changes around TYPE_SERIAL. The biggest change
> is having it derive from TYPE_SYS_BUS_DEVICE which 1) eliminates usage of
> qemu_{un,}register_reset() and 2) stops all its users from accessing private
> data. The latter allows TYPE_SERIAL to be ported to Rust in the (near) future.


> Bernhard Beschow (14):
>    hw/arm/Kconfig: Fix serial selection for NPCM8XX
>    hw/char/{diva-gsp,serial-pci-multi}: Fix deinitialization order
>    hw/arm/aspeed_ast27x0-{ssp, tsp}: Do not access SerialMM internals
>      directly
>    util/fifo8: Make all read-only methods const-correct
>    hw/char/serial: Remove explicit cast from void pointer
>    hw/char/serial: Prefer fifo8 methods over open-coding
>    hw/char/serial: Reuse fifo8_num_used()
>    hw/char/serial: Remove unhelpful comment
>    hw/char/serial: Add constants for Line Control Register
>    hw/char/serial: Remove redundant reset
>    hw/char/serial: Avoid implicit conversion when tracing

Queueing 1-11, thanks!

>    hw/char/serial: Keep MemoryRegionOps private
>    hw/char/serial: Inherit from SysBusDevice
>    hw/char/serial: Plug into reset framework