]> www.infradead.org Git - users/dwmw2/qemu.git/commit
i386/xen: manage and save/restore Xen guest long_mode setting
authorDavid Woodhouse <dwmw@amazon.co.uk>
Mon, 12 Dec 2022 14:03:41 +0000 (14:03 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Mon, 30 Jan 2023 18:33:59 +0000 (18:33 +0000)
commit90315e48f57b15e21dbdc7f5ae6e8b115c32c66c
tree8f351ad079da3cda568bbf211c33f74fc7b3b80a
parent2a900c6afec03476f7386dd25e382c2cd05ee3c1
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>
hw/i386/kvm/xen_overlay.c
hw/i386/kvm/xen_overlay.h
target/i386/kvm/xen-emu.c