aboutsummaryrefslogtreecommitdiff
path: root/hw/xen
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw@amazon.co.uk>2023-10-16 16:00:23 +0100
committerDavid Woodhouse <dwmw@amazon.co.uk>2023-11-07 08:54:20 +0000
commita72ccc7fc449748d79914439ddf5c12a6e9fd6a6 (patch)
tree0b2d62e3f56567b5cba2e6ff1163b3c6e19b0277 /hw/xen
parent9b773746908072bf0ec64aec12d02515ebcd717b (diff)
downloadqemu-a72ccc7fc449748d79914439ddf5c12a6e9fd6a6.zip
qemu-a72ccc7fc449748d79914439ddf5c12a6e9fd6a6.tar.gz
qemu-a72ccc7fc449748d79914439ddf5c12a6e9fd6a6.tar.bz2
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>
Diffstat (limited to 'hw/xen')
-rw-r--r--hw/xen/xen-bus.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c
index 3ffd1a5..cc6f1b3 100644
--- a/hw/xen/xen-bus.c
+++ b/hw/xen/xen-bus.c
@@ -922,6 +922,11 @@ void xen_device_notify_event_channel(XenDevice *xendev,
}
}
+unsigned int xen_event_channel_get_local_port(XenEventChannel *channel)
+{
+ return channel->local_port;
+}
+
void xen_device_unbind_event_channel(XenDevice *xendev,
XenEventChannel *channel,
Error **errp)