From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 08:43:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33CEC1FD for ; Mon, 4 Aug 2014 08:43:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0519626CA for ; Mon, 4 Aug 2014 08:43:28 +0000 (UTC) Received: from royger (uid 1332) (envelope-from royger@FreeBSD.org) id 58bb by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 08:43:27 +0000 From: Roger Pau Monné Date: Mon, 4 Aug 2014 08:43:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269508 - head/sys/x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53df47af.58bb.34704d8@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 08:43:28 -0000 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));