From owner-svn-src-head@freebsd.org Sun Jul 17 20:34:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDF81B9C672; Sun, 17 Jul 2016 20:34:47 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F96C1AE8; Sun, 17 Jul 2016 20:34:47 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6HKYkux078380; Sun, 17 Jul 2016 20:34:46 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6HKYkOr078379; Sun, 17 Jul 2016 20:34:46 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201607172034.u6HKYkOr078379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Sun, 17 Jul 2016 20:34:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302972 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Sun, 17 Jul 2016 20:34:47 -0000 Author: grehan Date: Sun Jul 17 20:34:46 2016 New Revision: 302972 URL: https://svnweb.freebsd.org/changeset/base/302972 Log: Disallow interrupt requests on disabled endpoints. Submitted by: Leon Dang MFC after: 3 days Modified: head/usr.sbin/bhyve/pci_xhci.c Modified: head/usr.sbin/bhyve/pci_xhci.c ============================================================================== --- head/usr.sbin/bhyve/pci_xhci.c Sun Jul 17 19:24:28 2016 (r302971) +++ head/usr.sbin/bhyve/pci_xhci.c Sun Jul 17 20:34:46 2016 (r302972) @@ -2537,9 +2537,11 @@ static int pci_xhci_dev_intr(struct usb_hci *hci, int epctx) { struct pci_xhci_dev_emu *dev; + struct xhci_dev_ctx *dev_ctx; struct xhci_trb evtrb; struct pci_xhci_softc *sc; struct pci_xhci_portregs *p; + struct xhci_endp_ctx *ep_ctx; int error; int dir_in; int epid; @@ -2578,6 +2580,14 @@ pci_xhci_dev_intr(struct usb_hci *hci, i goto done; } + dev_ctx = dev->dev_ctx; + ep_ctx = &dev_ctx->ctx_ep[epid]; + if ((ep_ctx->dwEpCtx0 & 0x7) == XHCI_ST_EPCTX_DISABLED) { + DPRINTF(("xhci device interrupt on disabled endpoint %d\r\n", + epid)); + return (0); + } + DPRINTF(("xhci device interrupt on endpoint %d\r\n", epid)); pci_xhci_device_doorbell(sc, hci->hci_port, epid, 0);