From nobody Sat Oct 30 02:33:55 2021 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 675C0181CF3A for ; Sat, 30 Oct 2021 02:33:55 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hh3Jg28fXz4VQc for ; Sat, 30 Oct 2021 02:33:55 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2ACD022551 for ; Sat, 30 Oct 2021 02:33:55 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 19U2Xt72054138 for ; Sat, 30 Oct 2021 02:33:55 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 19U2Xtre054137 for bugs@FreeBSD.org; Sat, 30 Oct 2021 02:33:55 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 259541] [smartpqi] panic: Segment size is not aligned, in a call to bus_dmamap_load_ccb() from smartpqi_cam_action. Date: Sat, 30 Oct 2021 02:33:55 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: khng@freebsd.org 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 List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D259541 Bug ID: 259541 Summary: [smartpqi] panic: Segment size is not aligned, in a call to bus_dmamap_load_ccb() from smartpqi_cam_action. Product: Base System Version: Unspecified Hardware: amd64 OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: khng@freebsd.org The following is a stack trace and ddb(4) show pcpu output: ---- db> show pcpu cpuid =3D 151 dynamic pcpu =3D 0xfffffe020877ca40 curthread =3D 0xfffffe019120a1e0: pid 571 tid 106262 critnest 1 "fsck_ms= dosfs" curpcb =3D 0xfffffe019120a6f0 fpcurthread =3D 0xfffffe019120a1e0: pid 571 "fsck_msdosfs" idlethread =3D 0xfffffe01a0eb9900: tid 100154 "idle: cpu151" self =3D 0xffffffff82ea7000 curpmap =3D 0xfffffe019120f518 tssp =3D 0xffffffff82ea7384 rsp0 =3D 0xfffffe03dda97000 kcr3 =3D 0xffffffffffffffff ucr3 =3D 0xffffffffffffffff scr3 =3D 0x0 gs32p =3D 0xffffffff82ea7404 ldt =3D 0xffffffff82ea7444 tss =3D 0xffffffff82ea7434 curvnet =3D 0 spin locks held: db> bt Tracing pid 571 tid 106262 td 0xfffffe019120a1e0 kdb_enter() at kdb_enter+0x37/frame 0xfffffe03dda966d0 vpanic() at vpanic+0x1b8/frame 0xfffffe03dda96730 panic() at panic+0x43/frame 0xfffffe03dda96790 bounce_bus_dmamap_load_ma() at bounce_bus_dmamap_load_ma+0x3a9/frame 0xfffffe03dda96810 _bus_dmamap_load_bio() at _bus_dmamap_load_bio+0x113/frame 0xfffffe03dda968= 70 bus_dmamap_load_ccb() at bus_dmamap_load_ccb+0x92/frame 0xfffffe03dda968d0 smartpqi_cam_action() at smartpqi_cam_action+0xdb9/frame 0xfffffe03dda96940 xpt_run_devq() at xpt_run_devq+0x2f9/frame 0xfffffe03dda969a0 xpt_action_default() at xpt_action_default+0x471/frame 0xfffffe03dda969f0 dastart() at dastart+0x336/frame 0xfffffe03dda96a40 xpt_run_allocq() at xpt_run_allocq+0xb3/frame 0xfffffe03dda96a90 dastrategy() at dastrategy+0x6f/frame 0xfffffe03dda96ac0 g_disk_start() at g_disk_start+0x31c/frame 0xfffffe03dda96b30 g_io_request() at g_io_request+0x2d7/frame 0xfffffe03dda96b60 g_part_start() at g_part_start+0x289/frame 0xfffffe03dda96be0 g_io_request() at g_io_request+0x2d7/frame 0xfffffe03dda96c10 g_dev_strategy() at g_dev_strategy+0x155/frame 0xfffffe03dda96c40 physio() at physio+0x49b/frame 0xfffffe03dda96ce0 devfs_read_f() at devfs_read_f+0xe5/frame 0xfffffe03dda96d40 dofileread() at dofileread+0x81/frame 0xfffffe03dda96d90 sys_read() at sys_read+0xc0/frame 0xfffffe03dda96e00 amd64_syscall() at amd64_syscall+0x12e/frame 0xfffffe03dda96f30 fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe03dda96f30 --- syscall (3, FreeBSD ELF64, sys_read), rip =3D 0x8011c4cca, rsp =3D 0x7fffffffdac8, rbp =3D 0x7fffffffdb00 --- db> ---- I git-bisected and found the offending commits to be 9fac68fc3853b696c8479bb3a8181d62cb9f59c9 in main, and 1569aab1cb38a38fb619f343ed1e47d4b4070ffe in stable/13. The following change= s in the commits look suspicious in my eye: ---- @@ -313,27 +347,31 @@ smartpqi_attach(device_t dev) ... - - /* - * Create DMA tag for mapping buffers into controller-addressable space. - */ - if (bus_dma_tag_create(softs->os_specific.pqi_parent_dmat,/* paren= t */ - 1, 0, /* algnmnt, boundar= y */ + /* + * Create DMA tag for mapping buffers into controller-addressable spac= e. + */ + if (bus_dma_tag_create(softs->os_specific.pqi_parent_dmat,/* parent */ + PAGE_SIZE, 0, /* algnmnt, boundar= y */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterar= g */ -=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20 softs->pqi_cap.max_sg_elem*PAGE_SIZE,/*maxsize*/ +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20 (bus_size_t)softs->pqi_cap.max_sg_elem*PAGE_SIZE,/* maxsize */ softs->pqi_cap.max_sg_elem, /* nsegment= s */ BUS_SPACE_MAXSIZE_32BIT, /* maxsegsi= ze */ BUS_DMA_ALLOCNOW, /* flags */ ---- Reverting the change on algnmnt param worked around the issue. --=20 You are receiving this mail because: You are the assignee for the bug.=