summaryrefslogtreecommitdiffstats
path: root/include/hw/ppc/spapr_xive.h
diff options
context:
space:
mode:
authorCédric Le Goater2019-05-13 10:42:33 +0200
committerDavid Gibson2019-05-29 03:39:45 +0200
commit38afd772f802ff787ea16af73b0c0d24a8c46b6c (patch)
treefed30007e103eab9060ee0eec1309e819f312056 /include/hw/ppc/spapr_xive.h
parentspapr: Print out extra hints when CAS negotiation of interrupt mode fails (diff)
downloadqemu-38afd772f802ff787ea16af73b0c0d24a8c46b6c.tar.gz
qemu-38afd772f802ff787ea16af73b0c0d24a8c46b6c.tar.xz
qemu-38afd772f802ff787ea16af73b0c0d24a8c46b6c.zip
spapr/xive: add KVM support
This introduces a set of helpers when KVM is in use, which create the KVM XIVE device, initialize the interrupt sources at a KVM level and connect the interrupt presenters to the vCPU. They also handle the initialization of the TIMA and the source ESB memory regions of the controller. These have a different type under KVM. They are 'ram device' memory mappings, similarly to VFIO, exposed to the guest and the associated VMAs on the host are populated dynamically with the appropriate pages using a fault handler. Signed-off-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Message-Id: <20190513084245.25755-3-clg@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'include/hw/ppc/spapr_xive.h')
-rw-r--r--include/hw/ppc/spapr_xive.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/hw/ppc/spapr_xive.h b/include/hw/ppc/spapr_xive.h
index fc3e9652f9..0edcc762de 100644
--- a/include/hw/ppc/spapr_xive.h
+++ b/include/hw/ppc/spapr_xive.h
@@ -38,6 +38,10 @@ typedef struct SpaprXive {
/* TIMA mapping address */
hwaddr tm_base;
MemoryRegion tm_mmio;
+
+ /* KVM support */
+ int fd;
+ void *tm_mmap;
} SpaprXive;
bool spapr_xive_irq_claim(SpaprXive *xive, uint32_t lisn, bool lsi);
@@ -49,5 +53,11 @@ void spapr_dt_xive(SpaprMachineState *spapr, uint32_t nr_servers, void *fdt,
uint32_t phandle);
void spapr_xive_set_tctx_os_cam(XiveTCTX *tctx);
void spapr_xive_mmio_set_enabled(SpaprXive *xive, bool enable);
+void spapr_xive_map_mmio(SpaprXive *xive);
+
+/*
+ * KVM XIVE device helpers
+ */
+void kvmppc_xive_connect(SpaprXive *xive, Error **errp);
#endif /* PPC_SPAPR_XIVE_H */