Skip to content

Drop compile time limit on number of serial ports

Peter Maydell qemu-devel 1 version Applied

Status from this message: Applied to master, with minor tweak in patch 13.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest13 patches 35 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/13hw/char/serial: Allow disconnected chardevshw/char/serial.c+0 -52 replies
2/13hw/arm/fsl-imx*: Don't create "null" chardevs for serial deviceshw/arm/fsl-imx25.c hw/arm/fsl-imx31.c hw/arm/fsl-imx6.c+3 -344 replies
3/13hw/mips/boston.c: Don't create "null" chardevs for serial deviceshw/mips/boston.c+0 -42 replies
4/13hw/mips/mips_malta: Don't create "null" chardevs for serial deviceshw/mips/mips_malta.c+0 -52 replies
5/13hw/xtensa/xtfpga.c: Don't create "null" chardevs for serial deviceshw/xtensa/xtfpga.c+0 -42 replies
6/13vl.c: Provide accessor function serial_hd() for serial_hds[] arrayinclude/sysemu/sysemu.h vl.c+12 -02 replies
7/13Change references to serial_hds[] to serial_hd()hw/arm/allwinner-a10.c hw/arm/aspeed_soc.c hw/arm/bcm2835_peripherals.c +62 more+143 -1433 replies
8/13Remove checks on MAX_SERIAL_PORTS that are just bounds checkshw/arm/fsl-imx25.c hw/arm/fsl-imx31.c hw/arm/fsl-imx6.c +4 more+8 -202 replies
9/13hw/char/exynos4210_uart.c: Remove unneeded handling of NULL chardevhw/char/exynos4210_uart.c+0 -203 replies
10/13serial-isa: Use MAX_ISA_SERIAL_PORTS instead of MAX_SERIAL_PORTShw/char/serial-isa.c hw/i386/pc.c hw/mips/mips_r4k.c +3 more+12 -92 replies
11/13superio: Don't use MAX_SERIAL_PORTS for serial port limitinclude/hw/isa/superio.h+3 -11 reply
12/13vl.c: Remove compile time limit on number of serial portsinclude/sysemu/sysemu.h vl.c+7 -105 replies
13/13vl.c: new function max_serial_hds()hw/ppc/spapr.c include/sysemu/sysemu.h vl.c+10 -33 replies

Reviews trailers per patch

All 13 patches have a Reviewed-by or Acked-by.

PatchPhilippe Mathieu-DaudéThomas Huth
1/13R-b T-b A-b
2/13R-b R-b
3/13R-b T-b R-b
4/13R-b T-b R-b
5/13R-b T-b R-b
6/13R-b T-b R-b
7/13R-b
8/13R-b R-b
9/13R-b R-b
10/13R-b T-b R-b
11/13R-b T-b
12/13R-b T-b R-b
13/13R-b T-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 00/13] Drop compile time limit on number of serial ports

For many years, QEMU has had a compile time restriction on how many serial port devices you can create and configure with the -serial argument. This is 4, largely because for x86 PC the traditional number of ISA serial devices is 4, and nobody's ever changed the limit since.

This patchset drops the compile time limit.

The first patch removes an unnecessary check in hw/char/serial that insisted that it was not talking to a NULL chardev. Our newly set direction is that we want to allow NULL chardev pointers, rather than requiring UARTs and boards to create "null" backends, so drop the check. (I have looked at the code and it should all be fine with a NULL pointer here, including the tricky bit where qemu_chr_fe_add_watch() returns 0 and the required behaviour is "insta-drain the FIFO".)

The next 4 patches drop unnecessary creations of "null" chardevs. These have to go here because in most cases they were writing back to the serial_hds[] array, which is about to go away.

Patch 6 implements an accessor function serial_hd() which can be used to replace direct reads of serial_hds[].

Patch 7 is purely mechanical and replaces serial_hds[x] with serial_hd(x).

Patches 8 through 11 remove or rename various uses of the MAX_SERIAL_PORTS #define that shouldn't really be using it.

Patch 12 then makes the serial_hds array be dynamically reallocated.

Patch 13 adds a "what actually is the highest serial_hds entry" function for the benefit of spapr, which is the only remaining user of MAX_SERIAL_PORTS.

Testing: I tested mips-malta and imx6 by hand; others are only tested via 'make check' (which did find some bugs for me!)

thanks
-- PMM

Peter Maydell (13):
hw/char/serial: Allow disconnected chardevs hw/arm/fsl-imx*: Don't create "null" chardevs for serial devices hw/mips/boston.c: Don't create "null" chardevs for serial devices hw/mips/mips_malta: Don't create "null" chardevs for serial devices hw/xtensa/xtfpga.c: Don't create "null" chardevs for serial devices vl.c: Provide accessor function serial_hd() for serial_hds[] array Change references to serial_hds[] to serial_hd()
Remove checks on MAX_SERIAL_PORTS that are just bounds checks hw/char/exynos4210_uart.c: Remove unneeded handling of NULL chardev
serial-isa: Use MAX_ISA_SERIAL_PORTS instead of MAX_SERIAL_PORTS
superio: Don't use MAX_SERIAL_PORTS for serial port limit vl.c: Remove compile time limit on number of serial ports vl.c: new function max_serial_hds()

 include/hw/char/serial.h                 |  3 +++
 include/hw/isa/superio.h                 |  4 +++-
 include/sysemu/sysemu.h                  |  9 +++++---
 hw/arm/allwinner-a10.c                   |  4 ++--
 hw/arm/aspeed_soc.c                      |  4 ++--
 hw/arm/bcm2835_peripherals.c             |  4 ++--
 hw/arm/digic.c                           |  2 +-
 hw/arm/fsl-imx25.c                       | 14 +-----------
 hw/arm/fsl-imx31.c                       | 14 +-----------
 hw/arm/fsl-imx6.c                        | 17 ++-------------
 hw/arm/fsl-imx7.c                        |  4 +---
 hw/arm/highbank.c                        |  2 +-
 hw/arm/integratorcp.c                    |  4 ++--
 hw/arm/kzm.c                             |  4 ++--
 hw/arm/mps2-tz.c                         |  3 +--
 hw/arm/mps2.c                            |  6 ++----
 hw/arm/msf2-soc.c                        |  4 ++--
 hw/arm/musicpal.c                        |  8 +++----
 hw/arm/omap1.c                           |  6 +++---
 hw/arm/omap2.c                           | 10 ++++-----
 hw/arm/pxa2xx.c                          | 16 +++++++-------
 hw/arm/realview.c                        |  8 +++----
 hw/arm/stellaris.c                       |  2 +-
 hw/arm/stm32f205_soc.c                   |  3 +--
 hw/arm/strongarm.c                       |  2 +-
 hw/arm/versatilepb.c                     |  8 +++----
 hw/arm/vexpress.c                        |  8 +++----
 hw/arm/virt.c                            |  4 ++--
 hw/arm/xilinx_zynq.c                     |  4 ++--
 hw/arm/xlnx-zynqmp.c                     |  2 +-
 hw/char/exynos4210_uart.c                | 20 ------------------
 hw/char/serial-isa.c                     | 14 ++++++------
 hw/char/serial.c                         |  5 -----
 hw/char/xen_console.c                    |  2 +-
 hw/cris/axis_dev88.c                     |  2 +-
 hw/hppa/machine.c                        |  4 ++--
 hw/i386/pc.c                             |  2 +-
 hw/isa/isa-superio.c                     |  4 ++--
 hw/lm32/lm32_boards.c                    |  8 +++----
 hw/lm32/milkymist.c                      |  4 ++--
 hw/m68k/mcf5206.c                        |  4 ++--
 hw/m68k/mcf5208.c                        |  6 +++---
 hw/microblaze/petalogix_ml605_mmu.c      |  2 +-
 hw/microblaze/petalogix_s3adsp1800_mmu.c |  2 +-
 hw/mips/boston.c                         |  6 +-----
 hw/mips/mips_jazz.c                      |  8 +++----
 hw/mips/mips_malta.c                     |  7 +-----
 hw/mips/mips_mipssim.c                   |  4 ++--
 hw/mips/mips_r4k.c                       |  2 +-
 hw/misc/macio/macio.c                    |  4 ++--
 hw/moxie/moxiesim.c                      |  4 ++--
 hw/nios2/10m50_devboard.c                |  2 +-
 hw/openrisc/openrisc_sim.c               |  2 +-
 hw/ppc/e500.c                            | 12 +++++------
 hw/ppc/pnv.c                             |  2 +-
 hw/ppc/ppc405_uc.c                       | 16 +++++++-------
 hw/ppc/ppc440_bamboo.c                   |  8 +++----
 hw/ppc/sam460ex.c                        |  8 +++----
 hw/ppc/spapr.c                           |  6 +++---
 hw/ppc/virtex_ml507.c                    |  2 +-
 hw/riscv/sifive_e.c                      |  4 ++--
 hw/riscv/sifive_u.c                      |  4 ++--
 hw/riscv/spike.c                         |  4 ++--
 hw/riscv/virt.c                          |  2 +-
 hw/sh4/r2d.c                             |  2 +-
 hw/sh4/sh7750.c                          |  4 ++--
 hw/sparc/leon3.c                         |  4 ++--
 hw/sparc/sun4m.c                         |  4 ++--
 hw/sparc64/niagara.c                     |  4 ++--
 hw/sparc64/sun4u.c                       |  4 ++--
 hw/xtensa/sim.c                          |  4 ++--
 hw/xtensa/xtfpga.c                       |  6 +-----
 vl.c                                     | 27 ++++++++++++++++++------
 73 files changed, 184 insertions(+), 244 deletions(-)
Signature · 1 line
2.17.0