summaryrefslogtreecommitdiff
path: root/sys/dev/pv
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2016-04-19 18:15:42 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2016-04-19 18:15:42 +0000
commit7beb634c39cc948303938b2f62baa81b6d1ccbb3 (patch)
treea961dfd995bea692347aeef43ca186a2b5b20820 /sys/dev/pv
parent4857fc8937b08f233ca96a8d929432f7ba514784 (diff)
Bind event channels to backend domains
This is another piece of the QubesOS "chained VM" puzzle reported by Marco Peereboom.
Diffstat (limited to 'sys/dev/pv')
-rw-r--r--sys/dev/pv/if_xnf.c5
-rw-r--r--sys/dev/pv/xen.c5
-rw-r--r--sys/dev/pv/xenstore.c4
-rw-r--r--sys/dev/pv/xenvar.h6
4 files changed, 11 insertions, 9 deletions
diff --git a/sys/dev/pv/if_xnf.c b/sys/dev/pv/if_xnf.c
index 2f9a02fbe36..67a905e1636 100644
--- a/sys/dev/pv/if_xnf.c
+++ b/sys/dev/pv/if_xnf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_xnf.c,v 1.21 2016/04/19 14:19:44 mikeb Exp $ */
+/* $OpenBSD: if_xnf.c,v 1.22 2016/04/19 18:15:41 mikeb Exp $ */
/*
* Copyright (c) 2015, 2016 Mike Belopuhov
@@ -253,7 +253,8 @@ xnf_attach(struct device *parent, struct device *self, void *aux)
return;
}
- if (xen_intr_establish(0, &sc->sc_xih, xnf_intr, sc, ifp->if_xname)) {
+ if (xen_intr_establish(0, &sc->sc_xih, sc->sc_domid, xnf_intr, sc,
+ ifp->if_xname)) {
printf(": failed to establish an interrupt\n");
return;
}
diff --git a/sys/dev/pv/xen.c b/sys/dev/pv/xen.c
index 117409a5163..a2b5dfc3623 100644
--- a/sys/dev/pv/xen.c
+++ b/sys/dev/pv/xen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xen.c,v 1.54 2016/04/19 14:19:44 mikeb Exp $ */
+/* $OpenBSD: xen.c,v 1.55 2016/04/19 18:15:41 mikeb Exp $ */
/*
* Copyright (c) 2015 Mike Belopuhov
@@ -662,7 +662,7 @@ xen_intr_signal(xen_intr_handle_t xih)
}
int
-xen_intr_establish(evtchn_port_t port, xen_intr_handle_t *xih,
+xen_intr_establish(evtchn_port_t port, xen_intr_handle_t *xih, int domain,
void (*handler)(void *), void *arg, char *name)
{
struct xen_softc *sc = xen_sc;
@@ -693,6 +693,7 @@ xen_intr_establish(evtchn_port_t port, xen_intr_handle_t *xih,
/* We're being asked to allocate a new event port */
memset(&eau, 0, sizeof(eau));
eau.dom = DOMID_SELF;
+ eau.remote_dom = domain;
if (xen_evtchn_hypercall(sc, EVTCHNOP_alloc_unbound, &eau,
sizeof(eau)) != 0) {
DPRINTF("%s: failed to allocate new event port\n",
diff --git a/sys/dev/pv/xenstore.c b/sys/dev/pv/xenstore.c
index a1705b2471c..c4647cfe3d2 100644
--- a/sys/dev/pv/xenstore.c
+++ b/sys/dev/pv/xenstore.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xenstore.c,v 1.27 2016/02/05 10:30:37 mikeb Exp $ */
+/* $OpenBSD: xenstore.c,v 1.28 2016/04/19 18:15:41 mikeb Exp $ */
/*
* Copyright (c) 2015 Mike Belopuhov
@@ -226,7 +226,7 @@ xs_attach(struct xen_softc *sc)
pmap_kenter_pa((vaddr_t)xs->xs_ring, pa, PROT_READ | PROT_WRITE);
pmap_update(pmap_kernel());
- if (xen_intr_establish(xs->xs_port, &xs->xs_ih, xs_intr, xs,
+ if (xen_intr_establish(xs->xs_port, &xs->xs_ih, 0, xs_intr, xs,
sc->sc_dev.dv_xname))
goto fail_2;
diff --git a/sys/dev/pv/xenvar.h b/sys/dev/pv/xenvar.h
index f5ca5491822..a23a615775b 100644
--- a/sys/dev/pv/xenvar.h
+++ b/sys/dev/pv/xenvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: xenvar.h,v 1.31 2016/04/19 13:55:19 mikeb Exp $ */
+/* $OpenBSD: xenvar.h,v 1.32 2016/04/19 18:15:41 mikeb Exp $ */
/*
* Copyright (c) 2015 Mike Belopuhov
@@ -114,8 +114,8 @@ typedef uint32_t xen_intr_handle_t;
void xen_intr(void);
void xen_intr_ack(void);
void xen_intr_signal(xen_intr_handle_t);
-int xen_intr_establish(evtchn_port_t, xen_intr_handle_t *, void (*)(void *),
- void *, char *);
+int xen_intr_establish(evtchn_port_t, xen_intr_handle_t *, int,
+ void (*)(void *), void *, char *);
int xen_intr_disestablish(xen_intr_handle_t);
void xen_intr_enable(void);
void xen_intr_mask(xen_intr_handle_t);