[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v1 00/16] xen: framework for UART emulators



The series introduces a driver framework to abstract UART emulators in the
hypervisor under drivers/vuart.

That allows for architecture-independent handling of virtual UARTs in the
console driver and simplifies enabling new UART emulators.

The framework is gated by CONFIG_HAS_VUART, which is automatically enabled
once the user enables any UART emulator.

Current implementation supports maximum of one vUART of each kind per domain.

All current UART emulators (Arm) are switched to the new framework.

This works origins from [1].

Conceptually, there are 3 parts in the series:
- PL011 emulator cleanup: patches 1-6
- Simple MMIO-based UART emulator cleanup: patches 7-10, depends on the common
  header introduced in vpl011 cleanup
- vUART driver framework: patches 11-16, depends on the cleanup part

[1] 
https://lore.kernel.org/xen-devel/20250103-vuart-ns8250-v3-v1-0-c5d36b31d66c@xxxxxxxx/
[2] CI: https://gitlab.com/xen-project/people/dmukhin/xen/-/pipelines/1885641957

Denis Mukhin (16):
  arm/vpl011: rename virtual PL011 Kconfig option
  arm/vpl011: move DT node parsing to PL011 emulator code
  arm/vpl011: use vuart_ prefix in vpl011 public calls
  arm/vpl011: use raw spin_lock_{irqrestore,irqsave}
  arm/vpl011: use void pointer in domain struct
  arm/vpl011: remove vpl011 header file
  arm/vuart: rename 'virtual UART' Kconfig option
  arm/vuart: move simple MMIO-based vUART declarations to common header
  arm/vuart: use void pointer in domain struct
  arm/vuart: merge vuart_print_char() with vuart_mmio_write()
  xen/domain: introduce common emulation flags
  xen/domain: introduce domain-emu.h
  drivers/vuart: move PL011 emulator code
  drivers/vuart: move simple MMIO-based UART emulator
  drivers/vuart: introduce framework for UART emulators
  drivers/vuart: hook simple MMIO-based UART to vUART framework

 xen/arch/arm/Kconfig                          |  15 -
 xen/arch/arm/Makefile                         |   2 -
 xen/arch/arm/configs/tiny64_defconfig         |   2 +-
 xen/arch/arm/dom0less-build.c                 |  76 +---
 xen/arch/arm/domain.c                         |  11 +-
 xen/arch/arm/domctl.c                         |  15 +-
 xen/arch/arm/include/asm/domain.h             |  20 +-
 xen/arch/arm/include/asm/kernel.h             |   3 -
 xen/arch/arm/include/asm/vpl011.h             |  91 -----
 xen/arch/arm/vuart.c                          | 139 -------
 xen/arch/arm/vuart.h                          |  54 ---
 xen/arch/arm/xen.lds.S                        |   1 +
 xen/arch/ppc/include/asm/domain.h             |   1 +
 xen/arch/ppc/xen.lds.S                        |   1 +
 xen/arch/riscv/include/asm/domain.h           |   1 +
 xen/arch/riscv/xen.lds.S                      |   1 +
 xen/arch/x86/domain.c                         |   2 +-
 xen/arch/x86/domctl.c                         |   2 +-
 xen/arch/x86/include/asm/domain.h             |  48 ++-
 xen/arch/x86/xen.lds.S                        |   1 +
 xen/common/domain.c                           |  13 +
 xen/common/keyhandler.c                       |   4 +
 xen/drivers/Kconfig                           |   2 +
 xen/drivers/Makefile                          |   1 +
 xen/drivers/char/console.c                    |  11 +-
 xen/drivers/vuart/Kconfig                     |  23 ++
 xen/drivers/vuart/Makefile                    |   3 +
 xen/drivers/vuart/vuart-mmio.c                | 189 ++++++++++
 .../vpl011.c => drivers/vuart/vuart-pl011.c}  | 347 +++++++++++++-----
 xen/drivers/vuart/vuart.c                     |  95 +++++
 xen/include/xen/domain-emu.h                  |  33 ++
 xen/include/xen/domain.h                      |   2 +
 xen/include/xen/sched.h                       |   2 +
 xen/include/xen/vuart.h                       |  72 ++++
 xen/include/xen/xen.lds.h                     |  10 +
 35 files changed, 771 insertions(+), 522 deletions(-)
 delete mode 100644 xen/arch/arm/include/asm/vpl011.h
 delete mode 100644 xen/arch/arm/vuart.c
 delete mode 100644 xen/arch/arm/vuart.h
 create mode 100644 xen/drivers/vuart/Kconfig
 create mode 100644 xen/drivers/vuart/Makefile
 create mode 100644 xen/drivers/vuart/vuart-mmio.c
 rename xen/{arch/arm/vpl011.c => drivers/vuart/vuart-pl011.c} (71%)
 create mode 100644 xen/drivers/vuart/vuart.c
 create mode 100644 xen/include/xen/domain-emu.h
 create mode 100644 xen/include/xen/vuart.h

-- 
2.34.1





 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.