qemu/hw/xen
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
..
Kconfig xen: add CONFIG_XEN_BUS and CONFIG_XEN_EMU options for Xen emulation 2023-03-01 08:22:49 +00:00
meson.build hw/xen: cleanup sourcesets 2023-10-18 10:01:01 +02:00
trace-events xen-hvm: reorganize xen-hvm and move common function to xen-hvm-common 2023-06-15 16:45:59 -07:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
xen-backend.c hw/xen: do not repeatedly try to create a failing backend device 2023-11-07 08:54:20 +00:00
xen-bus-helper.c hw/xen: Add xenstore operations to allow redirection to internal emulation 2023-03-07 17:04:30 +00:00
xen-bus.c hw/xen: add support for Xen primary console in emulated mode 2023-11-07 08:54:20 +00:00
xen-host-pci-device.c xen: Use ERRP_GUARD() 2020-07-10 15:18:09 +02:00
xen-host-pci-device.h Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
xen-hvm-common.c xen: Don't pass MemoryListener around by value 2023-08-01 10:22:33 +01:00
xen-legacy-backend.c hw/xen: update Xen console to XenDevice model 2023-11-07 08:54:20 +00:00
xen-mapcache.c hw/i386/xen/: move xen-mapcache.c to hw/xen/ 2023-06-15 16:45:58 -07:00
xen-operations.c xen: Drop support for Xen versions below 4.7.1 2023-06-07 15:07:10 +01:00
xen_devconfig.c hw/xen: automatically assign device index to block devices 2023-11-07 08:54:20 +00:00
xen_pt.c exec/memory: Add symbolic value for memory listener priority for accel 2023-06-28 14:27:59 +02:00
xen_pt.h bulk: Do not declare function prototypes using 'extern' keyword 2023-08-31 19:47:43 +02:00
xen_pt_config_init.c hw/xen: Rename xen_common.h to xen_native.h 2023-03-07 17:04:30 +00:00
xen_pt_graphics.c hw/xen: Add xenstore operations to allow redirection to internal emulation 2023-03-07 17:04:30 +00:00
xen_pt_load_rom.c pci: add romsize property 2021-02-05 08:52:58 -05:00
xen_pt_msi.c hw/xen: Rename xen_common.h to xen_native.h 2023-03-07 17:04:30 +00:00
xen_pt_stub.c xen/pt: reserve PCI slot 2 for Intel igd-passthru 2023-03-06 11:27:37 +00:00
xen_pvdev.c xen: spelling fix 2023-09-08 13:08:52 +03:00