From owner-freebsd-bugs@freebsd.org Mon Oct 8 19:53:50 2018 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F99610C9C98 for ; Mon, 8 Oct 2018 19:53:50 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id D661C7AA0F for ; Mon, 8 Oct 2018 19:53:49 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 956BA10C9C97; Mon, 8 Oct 2018 19:53:49 +0000 (UTC) Delivered-To: bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71A8510C9C96 for ; Mon, 8 Oct 2018 19:53:49 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E1237AA0D for ; Mon, 8 Oct 2018 19:53:49 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 549331E4E for ; Mon, 8 Oct 2018 19:53:48 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w98Jrmpa097288 for ; Mon, 8 Oct 2018 19:53:48 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w98Jrmsb097287 for bugs@FreeBSD.org; Mon, 8 Oct 2018 19:53:48 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 232084] bhyve crashes with SIGSEGV under NetBSD guest and xhci Date: Mon, 08 Oct 2018 19:53:48 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: olevole@olevole.ru X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Oct 2018 19:53:50 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D232084 Bug ID: 232084 Summary: bhyve crashes with SIGSEGV under NetBSD guest and xhci Product: Base System Version: CURRENT Hardware: amd64 OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: olevole@olevole.ru Hello. NetBSD works fine in bhyve, except for the case when the bhyve emulates eXtensible Host Controller Interface (xHCI) USB controller. ( -s 30,xhci,tablet ) LLDB output upon bhyve crash (guest screen: https://pasteboard.co/HFAqTOk.p= ng ): https://github.com/freebsd/freebsd/blob/ebeb3285f598d6c1214c49598c951493d09= e1067/usr.sbin/bhyve/pci_xhci.c#L735 Process 57083 stopped * thread #20, name =3D 'vcpu 0', stop reason =3D signal SIGSEGV: invalid address (fault address: 0x0) frame #0: 0x00000000002587d8 bhyve`pci_xhci_insert_event(sc=3D0x00000008010a5100, evtrb=3D0x00007fffddbeba78, do_intr=3D0) at pci_xhci.c:735 732 rts =3D &sc->rtsregs; 733 734 erdp =3D rts->intrreg.erdp & ~0xF; -> 735 erdp_idx =3D (erdp - rts->erstba_p[rts->er_deq_seg].qwEvrsTablePtr) / 736 sizeof(struct xhci_trb); 737 738 DPRINTF(("pci_xhci: insert event 0[%lx] 2[%x] 3[%x]\r\n" (lldb) frame variable erdp_idx (int) erdp_idx =3D 0 in all likelihood, the problem in the rts->erstba_p structure because when I commenting 735 line ( erdp_idx is used only in DPRINTF debug output ) the next stop when working with this structure again, e.g: Process 58354 stopped * thread #20, name =3D 'vcpu 0', stop reason =3D signal SIGSEGV: invalid address (fault address: 0x8) frame #0: 0x0000000000258881 bhyve`pci_xhci_insert_event(sc=3D0x00000008010a5100, evtrb=3D0x00007fffddbeba78, do_intr=3D0) at pci_xhci.c:750 747 evtrbptr =3D &rts->erst_p[rts->er_enq_idx]; 748 749 /* TODO: multi-segment table */ -> 750 if (rts->er_events_cnt >=3D rts->erstba_p->dwEvrsTableSize)= { 751 DPRINTF(("pci_xhci[%d] cannot insert event; ring full\r\n", 752 __LINE__)); 753 err =3D XHCI_TRB_ERROR_EV_RING_FULL; What can I do to find out the reasons for this behavior? Thanks! --=20 You are receiving this mail because: You are the assignee for the bug.=