summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2015-12-08 20:07:05 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2015-12-08 20:07:05 +0000
commiteb70680d846e8f0107247891d61bb81f048a9607 (patch)
tree3d03c95e3e68441531aaf38393991b284b5c08e3 /sys/dev
parent26e528f31ad7acdba365c3446b044bed991d3210 (diff)
Communicate the selected IDT vector to the Hypervisor
OK mlarkin, reyk
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pv/xen.c34
-rw-r--r--sys/dev/pv/xenvar.h2
2 files changed, 36 insertions, 0 deletions
diff --git a/sys/dev/pv/xen.c b/sys/dev/pv/xen.c
index cfa68c61dca..3a4e75f7012 100644
--- a/sys/dev/pv/xen.c
+++ b/sys/dev/pv/xen.c
@@ -27,6 +27,8 @@
#include <uvm/uvm_extern.h>
+#include <machine/i82489var.h>
+
#include <dev/pv/pvvar.h>
#include <dev/pv/xenreg.h>
#include <dev/pv/xenvar.h>
@@ -37,6 +39,7 @@ int xen_init_hypercall(struct xen_softc *);
int xen_getversion(struct xen_softc *);
int xen_getfeatures(struct xen_softc *);
int xen_init_info_page(struct xen_softc *);
+int xen_init_cbvec(struct xen_softc *);
int xen_match(struct device *, void *, void *);
void xen_attach(struct device *, struct device *, void *);
@@ -87,6 +90,8 @@ xen_attach(struct device *parent, struct device *self, void *aux)
if (xen_init_info_page(sc))
return;
+
+ xen_init_cbvec(sc);
}
void
@@ -399,3 +404,32 @@ xen_init_info_page(struct xen_softc *sc)
sc->sc_ipg, pa);
return (0);
}
+
+int
+xen_init_cbvec(struct xen_softc *sc)
+{
+ struct xen_hvm_param xhp;
+
+ if ((sc->sc_features & XENFEAT_CBVEC) == 0)
+ return (ENOENT);
+
+ xhp.domid = DOMID_SELF;
+ xhp.index = HVM_PARAM_CALLBACK_IRQ;
+ xhp.value = HVM_CALLBACK_VECTOR(LAPIC_XEN_VECTOR);
+ if (xen_hypercall(sc, hvm_op, 2, HVMOP_set_param, &xhp)) {
+ /* Will retry with the xspd(4) PCI interrupt */
+ return (ENOENT);
+ }
+ DPRINTF("%s: registered callback IDT vector %d\n",
+ sc->sc_dev.dv_xname, LAPIC_XEN_VECTOR);
+
+ sc->sc_cbvec = 1;
+
+ return (0);
+}
+
+void
+xen_intr(void)
+{
+ /* stub */
+}
diff --git a/sys/dev/pv/xenvar.h b/sys/dev/pv/xenvar.h
index b5db26dbbc5..7c5d2446b3f 100644
--- a/sys/dev/pv/xenvar.h
+++ b/sys/dev/pv/xenvar.h
@@ -33,6 +33,8 @@ struct xen_softc {
#define XENFEAT_CBVEC (1<<8)
struct shared_info *sc_ipg; /* HYPERVISOR_shared_info */
+
+ int sc_cbvec; /* callback was installed */
};
extern struct xen_softc *xen_sc;