qemu-e2k/hw/char
David Woodhouse a72ccc7fc4 hw/xen: add support for Xen primary console in emulated mode
The primary console is special because the toolstack maps a page into
the guest for its ring, and also allocates the guest-side event channel.
The guest's grant table is even primed to export that page using a known
grant ref#. Add support for all that in emulated mode, so that we can
have a primary console.

For reasons unclear, the backends running under real Xen don't just use
a mapping of the well-known GNTTAB_RESERVED_CONSOLE grant ref (which
would also be in the ring-ref node in XenStore). Instead, the toolstack
sets the ring-ref node of the primary console to the GFN of the guest
page. The backend is expected to handle that special case and map it
with foreignmem operations instead.

We don't have an implementation of foreignmem ops for emulated Xen mode,
so just make it map GNTTAB_RESERVED_CONSOLE instead. This would probably
work for real Xen too, but we can't work out how to make real Xen create
a primary console of type "ioemu" to make QEMU drive it, so we can't
test that; might as well leave it as it is for now under Xen.

Now at last we can boot the Xen PV shim and run PV kernels in QEMU.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
2023-11-07 08:54:20 +00:00
..
avr_usart.c
bcm2835_aux.c
cadence_uart.c hw/other: spelling fixes 2023-09-21 11:31:16 +03:00
cmsdk-apb-uart.c
debugcon.c
digic-uart.c
escc.c ui/input: Constify QemuInputHandler structure 2023-10-19 23:13:28 +02:00
etraxfs_ser.c
exynos4210_uart.c
goldfish_tty.c
grlib_apbuart.c
ibex_uart.c
imx_serial.c hw/other: spelling fixes 2023-09-21 11:31:16 +03:00
ipoctal232.c
Kconfig
mcf_uart.c hw/char/mcf_uart: Have mcf_uart_create() return DeviceState 2023-11-01 07:31:05 +01:00
mchp_pfsoc_mmuart.c
meson.build
nrf51_uart.c
omap_uart.c
parallel-isa.c
parallel.c
pl011.c hw/char/pl011: Replace magic values by register field definitions 2023-08-31 19:47:43 +02:00
renesas_sci.c
riscv_htif.c hw/char: riscv_htif: replace exit calls with proper shutdown 2023-10-12 12:35:36 +10:00
sclpconsole-lm.c
sclpconsole.c
serial-isa.c
serial-pci-multi.c
serial-pci.c
serial.c hw/other: spelling fixes 2023-09-21 11:31:16 +03:00
sh_serial.c
shakti_uart.c
sifive_uart.c
spapr_vty.c
stm32f2xx_usart.c hw/char/stm32f2xx_usart: Update IRQ when DR is written 2023-11-02 13:36:45 +00:00
terminal3270.c
trace-events hw/xen: update Xen console to XenDevice model 2023-11-07 08:54:20 +00:00
trace.h
virtio-console.c
virtio-serial-bus.c
xen_console.c hw/xen: add support for Xen primary console in emulated mode 2023-11-07 08:54:20 +00:00
xilinx_uartlite.c