diff options
author | David Woodhouse <dwmw@amazon.co.uk> | 2022-12-23 17:39:23 +0000 |
---|---|---|
committer | David Woodhouse <dwmw@amazon.co.uk> | 2023-03-01 09:08:26 +0000 |
commit | c08f5d0e53b00f101c6aab7b5c7eabe22bab1962 (patch) | |
tree | 7d2cc12ef590cceab1aca734fb4e7d8928f2680e /target | |
parent | 794fba23a53ac714589f84f868202d0cfcb41cd2 (diff) |
hw/xen: Add xen_xenstore device for xenstore emulation
Just the basic shell, with the event channel hookup. It only dumps the
buffer for now; a real ring implmentation will come in a subsequent patch.
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
Diffstat (limited to 'target')
-rw-r--r-- | target/i386/kvm/xen-emu.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/target/i386/kvm/xen-emu.c b/target/i386/kvm/xen-emu.c index d2c88ef0d9..50965b56f3 100644 --- a/target/i386/kvm/xen-emu.c +++ b/target/i386/kvm/xen-emu.c @@ -27,6 +27,7 @@ #include "hw/i386/kvm/xen_overlay.h" #include "hw/i386/kvm/xen_evtchn.h" #include "hw/i386/kvm/xen_gnttab.h" +#include "hw/i386/kvm/xen_xenstore.h" #include "hw/xen/interface/version.h" #include "hw/xen/interface/sched.h" @@ -179,6 +180,9 @@ int kvm_xen_init(KVMState *s, uint32_t hypercall_msr) return ret; } + /* The page couldn't be overlaid until KVM was initialized */ + xen_xenstore_reset(); + return 0; } @@ -789,6 +793,9 @@ static bool handle_get_param(struct kvm_xen_exit *exit, X86CPU *cpu, case HVM_PARAM_STORE_PFN: hp.value = XEN_SPECIAL_PFN(XENSTORE); break; + case HVM_PARAM_STORE_EVTCHN: + hp.value = xen_xenstore_get_port(); + break; default: return false; } @@ -1383,6 +1390,11 @@ int kvm_xen_soft_reset(void) return err; } + err = xen_xenstore_reset(); + if (err) { + return err; + } + return 0; } |