From nobody Tue Aug 16 03:02:49 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 4M6GD92Pcbz4Z6jR for ; Tue, 16 Aug 2022 03:02:49 +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 4M6GD90lmmz3Fs3 for ; Tue, 16 Aug 2022 03:02:49 +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 4M6GD86xj0ztX4 for ; Tue, 16 Aug 2022 03:02:48 +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 27G32mSo001449 for ; Tue, 16 Aug 2022 03:02:48 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 27G32mIj001448 for virtualization@FreeBSD.org; Tue, 16 Aug 2022 03:02: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: virtualization@FreeBSD.org Subject: [Bug 265869] mmio_rb_lookup finds wrong entry, triggering assertion Date: Tue, 16 Aug 2022 03:02:49 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new 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 Only Me X-Bugzilla-Who: harris.snyder@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: virtualization@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: 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=1660618969; 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; bh=nLrEZqXJGZcwiJw6j0QmyM0qNQzcCHe3mStecZMmRtE=; b=xP6yJIrWz6XQNVP85245vEWiZ4mMCSokbocZ+tm37txmxnMdcdoTtbgym1GEaGVADBK9oI ylpq9oHDYjbee1bfhzx0zDyU9aoiAQRVSdfnfmWntqp6s8jXW2T9XSEOdRnz/RllE+EsFe wEtsJywhHvcjRPLzs8896FtWfAHIjAFIBGUTzbrFwzGvz8SoFUY2QDSvmGsCYIXA2VqTTU CrEsXemhs2FlOfoYvbHZOsiO1TV8xqDGLf8Y4UPKqru4AxTGs4kl/1vLiq3+y8d+J8+YnZ 4K/oE3PhvtpoP+nSOfoWR2v9iL1cYHTjyBxDk38eYRKog3p+/XeuYMOD6ZrqQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660618969; a=rsa-sha256; cv=none; b=ElHTrdZ46pyQNONZPHuVbzzDKFenEkWBKcFU+yi6R7Shb0ATtJQAlonoCjJ4yWyn8lhm6/ tistoYVouOjhs88IdSjF/aWZQz0bXvFbjvIqBd9WOTN2jQYyGnQROfagP6RWV3PtDnVQ9M qc9VNLq4WCpzIcIweCvlRuUHyxew4m4MUsFckhK5lYyeZ+stwruwE04rCnRjI9FbatNMob EtPpOEM7JT6CwMd9XYgjdB2cVZfqf65aEAWud/bVhDWzP88Ce21wszGNdmU55N4jdquv4y yhwj0i26uSPhnWeek/TxNMeewK3t3/oh6msioV8aVKhYB1hNMrgwQKi943KkcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D265869 Bug ID: 265869 Summary: mmio_rb_lookup finds wrong entry, triggering assertion Product: Base System Version: CURRENT Hardware: amd64 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: bhyve Assignee: virtualization@FreeBSD.org Reporter: harris.snyder@gmail.com Hi all. While trying to pass a USB controller through to a VM via PCI passthrough, I hit an assertion in unregister_mem (usr.sbin/bhyve/mem.c): assert(mr->name =3D=3D memp->name); I hooked the process up to a debugger and printed out the two names, and discovered that indeed:=20 mr->name =3D "passthru-pci-22" memp->name =3D "virtio-net-pci-2" so clearly mmio_rb_lookup is returning the wrong memory range. I'm not very knowledgeable about the internals of bhyve, and I don't yet ha= ve any further insight into why this might be occurring, but even if this was caused by user error, it is triggering an assertion and thus I feel is worth treating as a bug.=20 Here's my bhyve command: bhyve -AHP -S -w -c sockets=3D1,cores=3D8 -m 16G \ -s 0,amd_hostbridge \ -s 31,lpc \ -s 2,virtio-net,tap1,mac=3D00:A0:98:41:AC:CB \ -s 3,virtio-net,tap12,mac=3D00:A0:98:88:6F:09,mtu=3D9000 \ -s 13,ahci-hd,/dev/zvol/fast/vols/winvm1 \ -s 7,virtio-rnd \ -s 9,xhci,tablet \ -s 22,passthru,35/0/3 \ -l bootrom,/root/BHYVE_BHF_CODE.fd \ windowsvm And here's the pciconf entry for the device I'm trying to pass through: ppt0@pci0:35:0:3: class=3D0x0c0330 rev=3D0x00 hdr=3D0x00 vendor=3D0x1= 022 device=3D0x148c subvendor=3D0x15d9 subdevice=3D0x145c vendor =3D 'Advanced Micro Devices, Inc. [AMD]' device =3D 'Starship USB 3.0 Host Controller' class =3D serial bus subclass =3D USB --=20 You are receiving this mail because: You are the assignee for the bug.=