From 8b57d5c523f8f1a650188ffa58939e1c5aaa6254 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Tue, 27 Dec 2022 19:02:23 +0000 Subject: i386/xen: Reserve Xen special pages for console, xenstore rings 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 Reviewed-by: Paul Durrant --- target/i386/kvm/xen-emu.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'target/i386/kvm') diff --git a/target/i386/kvm/xen-emu.c b/target/i386/kvm/xen-emu.c index c210ff9d91..75bcf7b630 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; } -- cgit v1.2.3