diff options
author | David Woodhouse <dwmw@amazon.co.uk> | 2022-12-07 09:19:31 +0000 |
---|---|---|
committer | David Woodhouse <dwmw@amazon.co.uk> | 2023-03-01 08:22:49 +0000 |
commit | d40ddd529004709350202114fc1c2fc99127647d (patch) | |
tree | 8f2a7bef965043ac4b14d3168044f78eba53412e /hw/i386/kvm/meson.build | |
parent | c789b9ef5f80ac471a270bf65cd22024594671a5 (diff) | |
download | qemu-d40ddd529004709350202114fc1c2fc99127647d.zip qemu-d40ddd529004709350202114fc1c2fc99127647d.tar.gz qemu-d40ddd529004709350202114fc1c2fc99127647d.tar.bz2 |
hw/xen: Add xen_overlay device for emulating shared xenheap pages
For the shared info page and for grant tables, Xen shares its own pages
from the "Xen heap" to the guest. The guest requests that a given page
from a certain address space (XENMAPSPACE_shared_info, etc.) be mapped
to a given GPA using the XENMEM_add_to_physmap hypercall.
To support that in qemu when *emulating* Xen, create a memory region
(migratable) and allow it to be mapped as an overlay when requested.
Xen theoretically allows the same page to be mapped multiple times
into the guest, but that's hard to track and reinstate over migration,
so we automatically *unmap* any previous mapping when creating a new
one. This approach has been used in production with.... a non-trivial
number of guests expecting true Xen, without any problems yet being
noticed.
This adds just the shared info page for now. The grant tables will be
a larger region, and will need to be overlaid one page at a time. I
think that means I need to create separate aliases for each page of
the overall grant_frames region, so that they can be mapped individually.
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
Diffstat (limited to 'hw/i386/kvm/meson.build')
-rw-r--r-- | hw/i386/kvm/meson.build | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/i386/kvm/meson.build b/hw/i386/kvm/meson.build index 95467f1..6165cbf 100644 --- a/hw/i386/kvm/meson.build +++ b/hw/i386/kvm/meson.build @@ -4,5 +4,6 @@ i386_kvm_ss.add(when: 'CONFIG_APIC', if_true: files('apic.c')) i386_kvm_ss.add(when: 'CONFIG_I8254', if_true: files('i8254.c')) i386_kvm_ss.add(when: 'CONFIG_I8259', if_true: files('i8259.c')) i386_kvm_ss.add(when: 'CONFIG_IOAPIC', if_true: files('ioapic.c')) +i386_kvm_ss.add(when: 'CONFIG_XEN_EMU', if_true: files('xen_overlay.c')) i386_ss.add_all(when: 'CONFIG_KVM', if_true: i386_kvm_ss) |