summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroyger <royger@FreeBSD.org>2014-08-04 08:43:27 +0000
committerroyger <royger@FreeBSD.org>2014-08-04 08:43:27 +0000
commit8d27fa514fc678424ba2a314b7db3623c20b5488 (patch)
tree8b2c53e8f7f379c270cbdfa2a98aeca7197adfa5
parenteb7b09e785fab81b14e9ab4facb46c82d1f1b92f (diff)
downloadFreeBSD-src-8d27fa514fc678424ba2a314b7db3623c20b5488.zip
FreeBSD-src-8d27fa514fc678424ba2a314b7db3623c20b5488.tar.gz
xen: mask all event channels on init
Mask all event channels during initialization. This is done so that we don't receive spurious interrupts while dynamically registering new event channels. There's a small window during registration where an event channel can fire before we have attached a handler to it. Sponsored by: Citrix Systems R&D x86/xen/xen_intr.c: - Mask all event channels on init.
-rw-r--r--sys/x86/xen/xen_intr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/x86/xen/xen_intr.c b/sys/x86/xen/xen_intr.c
index b02917c..a3f7f41 100644
--- a/sys/x86/xen/xen_intr.c
+++ b/sys/x86/xen/xen_intr.c
@@ -584,6 +584,7 @@ xen_intr_handle_upcall(struct trapframe *trap_frame)
static int
xen_intr_init(void *dummy __unused)
{
+ shared_info_t *s = HYPERVISOR_shared_info;
struct xen_intr_pcpu_data *pcpu;
struct physdev_pirq_eoi_gmfn eoi_gmfn;
int i, rc;
@@ -607,6 +608,9 @@ xen_intr_init(void *dummy __unused)
xen_intr_intrcnt_add(i);
}
+ for (i = 0; i < nitems(s->evtchn_mask); i++)
+ atomic_store_rel_long(&s->evtchn_mask[i], ~0);
+
/* Try to register PIRQ EOI map */
xen_intr_pirq_eoi_map = malloc(PAGE_SIZE, M_XENINTR, M_WAITOK | M_ZERO);
eoi_gmfn.gmfn = atop(vtophys(xen_intr_pirq_eoi_map));
OpenPOWER on IntegriCloud