Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Aug 2014 08:43:27 +0000 (UTC)
From:      Roger Pau Monné <royger@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r269508 - head/sys/x86/xen
Message-ID:  <53df47af.58bb.34704d8@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: royger
Date: Mon Aug  4 08:43:27 2014
New Revision: 269508
URL: http://svnweb.freebsd.org/changeset/base/269508

Log:
  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.

Modified:
  head/sys/x86/xen/xen_intr.c

Modified: head/sys/x86/xen/xen_intr.c
==============================================================================
--- head/sys/x86/xen/xen_intr.c	Mon Aug  4 08:42:29 2014	(r269507)
+++ head/sys/x86/xen/xen_intr.c	Mon Aug  4 08:43:27 2014	(r269508)
@@ -584,6 +584,7 @@ xen_intr_handle_upcall(struct trapframe 
 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));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53df47af.58bb.34704d8>