From nobody Wed Aug 10 15:29:57 2022 X-Original-To: virtualization@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 4M2v521SLCz4Xx8L for ; Wed, 10 Aug 2022 15:29:58 +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 4M2v520F1Cz44Fr for ; Wed, 10 Aug 2022 15:29:58 +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 4M2v5165txzGZL for ; Wed, 10 Aug 2022 15:29:57 +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 27AFTvUp095417 for ; Wed, 10 Aug 2022 15:29:57 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 27AFTvXc095416 for virtualization@FreeBSD.org; Wed, 10 Aug 2022 15:29:57 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: virtualization@FreeBSD.org Subject: [Bug 265749] bhyve NVMe emulation after LLVM 14 import to CURRENT Date: Wed, 10 Aug 2022 15:29:57 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bhyve X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: markj@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: virtualization@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cc Message-ID: In-Reply-To: References: 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: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660145398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qLHBQyqUPexohXZEWmdzmlrcqhOhqvN1Yt5MzQsAnlM=; b=Oi0SrEa4OdMs5TSPCR+WYFf8tgA+EUQoa4WtkKY0geqzgsePv3yfic0XbXziO5gcVCh6sF pgwlLRr+52hlMMqus1JRjdhpOOFeJIT2G7iPFCKF5vkV5Oc9W/D9t8Au0xvb8sSwfvk5vt G6oGAKnIKF/Gar41O9l7Cbx5hKXCorCtEvOEV3l+Tp2bEkjgMKr1lNF2vkVRTvxhk4F3sd JjRJGDqfVUDqQRpSGobVpXwW7zCL/kKi7xcaRWzZLAC/Jy1XoDo4N/uGZbR5SDYrZLl+cp vw++YOjyPiM2U8xc5HCQWh5opNlEIuBjmonreoZetjNaVMQXQr3qAEX3QjgcOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660145398; a=rsa-sha256; cv=none; b=Cs0IfaxDsUgR6rpaUApcY23DGA1Juq5+RaKPieKQuQimeG2vhO2D1cfha6jXyYG1QgJKBy 0OmStZdB9d9+9vzsKXYeoE47q0dAtAJOTP2WVfub0nfdYC0lnGXHGTHmSIBsh/RwpMP025 1gB54UO3bmu0iaH7kvkMR3/LFiBJSeKdBncL9b97JDsU+u6uBmf+qHRY3+c5YoJLLoaLvG f72XvT6YwbrjrkG+OpufSbkA661dN/azoA8ByQc6qoNeIwcJOwOu/EtoEgZaxP/aNvvgUA TDaKY7JAwb7mwIIRDEP0cVrzSs/IXQ0pcGGX2gj0Wp9IpPsQV7FEMWr6MOWHgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D265749 Mark Johnston changed: What |Removed |Added ---------------------------------------------------------------------------- Status|New |Open CC| |markj@FreeBSD.org --- Comment #1 from Mark Johnston --- On my system, bhyve segfaults after printing nvme_opc_write_read command would exceed LBA range(slba=3D0x2ffff0 nblocks= =3D0x1) If I disassemble nvme_opc_write_read(), the end of the function (inlined in= to pci_nvme_write()) is: 0x000000000106bfb3 <+7763>: jmp 0x106bfbc 0x000000000106bfb5 <+7765>: lea -0x3b292(%rip),%rsi # 0x1030d= 2a 0x000000000106bfbc <+7772>: lea -0x4008a(%rip),%rdx # 0x102bf= 39 0x000000000106bfc3 <+7779>: mov %r9,%rcx 0x000000000106bfc6 <+7782>: xor %eax,%eax 0x000000000106bfc8 <+7784>: call 0x1086010 End of assembler dump. and that fprintf() call is the warning. If I disassemble past that, I get (gdb) x/16i 0x000000000106bfc8 0x106bfc8 : call 0x1086010 =3D> 0x106bfcd: nopl (%rax) 0x106bfd0 : push %rbp 0x106bfd1 : mov %rsp,%rbp 0x106bfd4 : push %r15 0x106bfd6 : push %r14 0x106bfd8 : push %r13 so we're just running off the end of the function and going into pci_nvme_read(). That's pretty weird! I thought the compiler would insert breakpoints between functions. Maybe there is some UB happening here, but compiling bhyve with UBSAN makes= the problem go away. We compile bhyve with many warnings disabled; enabling th= em for pci_nvme.c uncovers some actual bugs, but fixing them doesn't fix the problem. And it's really bizarre that the compiler is apparently assuming = that fprintf() won't return. --=20 You are receiving this mail because: You are the assignee for the bug.=