qemu-e2k/hw/i386/kvm
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
..
apic.c i386/kvm: The value passed to strerror should be positive 2021-06-05 21:01:17 +02:00
clock.c kvm: i386: require KVM_CAP_ADJUST_CLOCK 2023-10-25 19:53:38 +02:00
clock.h hw/i386: Rename 'hw/kvm/clock.h' -> 'hw/i386/kvm/clock.h' 2023-08-31 19:47:43 +02:00
i8254.c kvm: i8254: require KVM_CAP_PIT2 and KVM_CAP_PIT_STATE2 2023-10-25 19:53:38 +02:00
i8259.c hw/intc: Extract the IRQ counting functions into a separate file 2023-01-13 16:22:57 +01:00
ioapic.c sysemu/kvm: Restrict kvm_pc_setup_irq_routing() to x86 targets 2023-09-07 13:32:37 +02:00
meson.build hw/xen: add support for Xen primary console in emulated mode 2023-11-07 08:54:20 +00:00
trace-events hw/xen: add support for Xen primary console in emulated mode 2023-11-07 08:54:20 +00:00
trace.h hw/xen: Implement emulated PIRQ hypercall support 2023-03-01 09:09:01 +00:00
xen_evtchn.c hw/xen: Clean up event channel 'type_val' handling to use union 2023-11-07 08:54:20 +00:00
xen_evtchn.h hw/xen: Simplify emulated Xen platform init 2023-06-07 15:07:10 +01:00
xen_gnttab.c hw/xen: add support for Xen primary console in emulated mode 2023-11-07 08:54:20 +00:00
xen_gnttab.h hw/xen: Implement soft reset for emulated gnttab 2023-03-07 17:04:30 +00:00
xen_overlay.c hw/xen: Support mapping grant frames 2023-03-01 09:07:52 +00:00
xen_overlay.h hw/xen: Support mapping grant frames 2023-03-01 09:07:52 +00:00
xen_primary_console.c hw/xen: add support for Xen primary console in emulated mode 2023-11-07 08:54:20 +00:00
xen_primary_console.h hw/xen: add support for Xen primary console in emulated mode 2023-11-07 08:54:20 +00:00
xen_xenstore.c hw/xen: add support for Xen primary console in emulated mode 2023-11-07 08:54:20 +00:00
xen_xenstore.h hw/xen: Add xen_xenstore device for xenstore emulation 2023-03-01 09:08:26 +00:00
xen-stubs.c hw/xen: add support for Xen primary console in emulated mode 2023-11-07 08:54:20 +00:00
xenstore_impl.c i386: spelling fixes 2023-09-20 07:54:34 +03:00
xenstore_impl.h hw/xen: Add xenstore operations to allow redirection to internal emulation 2023-03-07 17:04:30 +00:00