[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 48/62] i386/xen: Reserve Xen special pages for console, xenstore r
From: |
Paolo Bonzini |
Subject: |
[PULL 48/62] i386/xen: Reserve Xen special pages for console, xenstore rings |
Date: |
Thu, 2 Mar 2023 13:30:15 +0100 |
From: David Woodhouse <dwmw@amazon.co.uk>
Xen has eight frames at 0xfeff8000 for this; we only really need two for
now and KVM puts the identity map at 0xfeffc000, so limit ourselves to
four.
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
---
include/sysemu/kvm_xen.h | 9 +++++++++
target/i386/kvm/xen-emu.c | 10 ++++++++++
2 files changed, 19 insertions(+)
diff --git a/include/sysemu/kvm_xen.h b/include/sysemu/kvm_xen.h
index 49afa0eb9e43..b2aafaf7abdd 100644
--- a/include/sysemu/kvm_xen.h
+++ b/include/sysemu/kvm_xen.h
@@ -30,4 +30,13 @@ uint16_t kvm_xen_get_gnttab_max_frames(void);
#define kvm_xen_has_cap(cap) (!!(kvm_xen_get_caps() & \
KVM_XEN_HVM_CONFIG_ ## cap))
+#define XEN_SPECIAL_AREA_ADDR 0xfeff8000UL
+#define XEN_SPECIAL_AREA_SIZE 0x4000UL
+
+#define XEN_SPECIALPAGE_CONSOLE 0
+#define XEN_SPECIALPAGE_XENSTORE 1
+
+#define XEN_SPECIAL_PFN(x) ((XEN_SPECIAL_AREA_ADDR >> TARGET_PAGE_BITS) + \
+ XEN_SPECIALPAGE_##x)
+
#endif /* QEMU_SYSEMU_KVM_XEN_H */
diff --git a/target/i386/kvm/xen-emu.c b/target/i386/kvm/xen-emu.c
index c210ff9d91be..75bcf7b6306f 100644
--- a/target/i386/kvm/xen-emu.c
+++ b/target/i386/kvm/xen-emu.c
@@ -23,6 +23,7 @@
#include "hw/pci/msi.h"
#include "hw/i386/apic-msidef.h"
+#include "hw/i386/e820_memory_layout.h"
#include "hw/i386/kvm/xen_overlay.h"
#include "hw/i386/kvm/xen_evtchn.h"
#include "hw/i386/kvm/xen_gnttab.h"
@@ -169,6 +170,15 @@ int kvm_xen_init(KVMState *s, uint32_t hypercall_msr)
}
s->xen_caps = xen_caps;
+
+ /* Tell fw_cfg to notify the BIOS to reserve the range. */
+ ret = e820_add_entry(XEN_SPECIAL_AREA_ADDR, XEN_SPECIAL_AREA_SIZE,
+ E820_RESERVED);
+ if (ret < 0) {
+ fprintf(stderr, "e820_add_entry() table is full\n");
+ return ret;
+ }
+
return 0;
}
--
2.39.1
- [PULL 23/62] i386/xen: handle VCPUOP_register_runstate_memory_area, (continued)
- [PULL 23/62] i386/xen: handle VCPUOP_register_runstate_memory_area, Paolo Bonzini, 2023/03/02
- [PULL 24/62] i386/xen: implement HYPERVISOR_event_channel_op, Paolo Bonzini, 2023/03/02
- [PULL 33/62] hw/xen: Implement EVTCHNOP_bind_ipi, Paolo Bonzini, 2023/03/02
- [PULL 30/62] hw/xen: Implement EVTCHNOP_close, Paolo Bonzini, 2023/03/02
- [PULL 35/62] hw/xen: Implement EVTCHNOP_alloc_unbound, Paolo Bonzini, 2023/03/02
- [PULL 37/62] hw/xen: Implement EVTCHNOP_bind_vcpu, Paolo Bonzini, 2023/03/02
- [PULL 40/62] hw/xen: Support HVM_PARAM_CALLBACK_TYPE_GSI callback, Paolo Bonzini, 2023/03/02
- [PULL 44/62] hw/xen: Support mapping grant frames, Paolo Bonzini, 2023/03/02
- [PULL 51/62] hw/xen: Add xen_xenstore device for xenstore emulation, Paolo Bonzini, 2023/03/02
- [PULL 47/62] i386/xen: handle PV timer hypercalls, Paolo Bonzini, 2023/03/02
- [PULL 48/62] i386/xen: Reserve Xen special pages for console, xenstore rings,
Paolo Bonzini <=
- [PULL 50/62] hw/xen: Add backend implementation of interdomain event channel support, Paolo Bonzini, 2023/03/02
- [PULL 46/62] hw/xen: Implement GNTTABOP_query_size, Paolo Bonzini, 2023/03/02
- [PULL 43/62] hw/xen: Add xen_gnttab device for grant table emulation, Paolo Bonzini, 2023/03/02
- [PULL 56/62] hw/xen: Support GSI mapping to PIRQ, Paolo Bonzini, 2023/03/02
- [PULL 55/62] hw/xen: Implement emulated PIRQ hypercall support, Paolo Bonzini, 2023/03/02
- [PULL 54/62] i386/xen: Implement HYPERVISOR_physdev_op, Paolo Bonzini, 2023/03/02
- [PULL 57/62] hw/xen: Support MSI mapping to PIRQ, Paolo Bonzini, 2023/03/02
- [PULL 53/62] hw/xen: Automatically add xen-platform PCI device for emulated Xen guests, Paolo Bonzini, 2023/03/02
- [PULL 61/62] qapi: Add 'acpi' field to 'query-machines' output, Paolo Bonzini, 2023/03/02
- [PULL 59/62] i386/xen: Document Xen HVM emulation, Paolo Bonzini, 2023/03/02