summary refs log tree commit diff stats
path: root/hw/i386/kvm/xen_overlay.h
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw@amazon.co.uk>2022-12-12 14:03:41 +0000
committerDavid Woodhouse <dwmw@amazon.co.uk>2023-03-01 08:22:49 +0000
commit110a0ea59f263b6e382ee22c70c31c2364d11eb0 (patch)
tree76da7af19618d7457e471d9efe6a7acf0702231e /hw/i386/kvm/xen_overlay.h
parente21be724eaf5dfdf1ac3595e0c808b775ec262f2 (diff)
downloadfocaccia-qemu-110a0ea59f263b6e382ee22c70c31c2364d11eb0.tar.gz
focaccia-qemu-110a0ea59f263b6e382ee22c70c31c2364d11eb0.zip
i386/xen: manage and save/restore Xen guest long_mode setting
Xen will "latch" the guest's 32-bit or 64-bit ("long mode") setting when
the guest writes the MSR to fill in the hypercall page, or when the guest
sets the event channel callback in HVM_PARAM_CALLBACK_IRQ.

KVM handles the former and sets the kernel's long_mode flag accordingly.
The latter will be handled in userspace. Keep them in sync by noticing
when a hypercall is made in a mode that doesn't match qemu's idea of
the guest mode, and resyncing from the kernel. Do that same sync right
before serialization too, in case the guest has set the hypercall page
but hasn't yet made a system call.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
Diffstat (limited to 'hw/i386/kvm/xen_overlay.h')
-rw-r--r--hw/i386/kvm/xen_overlay.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/i386/kvm/xen_overlay.h b/hw/i386/kvm/xen_overlay.h
index 00cff05bb0..5c46a0b036 100644
--- a/hw/i386/kvm/xen_overlay.h
+++ b/hw/i386/kvm/xen_overlay.h
@@ -17,4 +17,8 @@ void xen_overlay_create(void);
 int xen_overlay_map_shinfo_page(uint64_t gpa);
 void *xen_overlay_get_shinfo_ptr(void);
 
+int xen_sync_long_mode(void);
+int xen_set_long_mode(bool long_mode);
+bool xen_is_long_mode(void);
+
 #endif /* QEMU_XEN_OVERLAY_H */