From nobody Tue Feb 22 00:31:13 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 E6CA819E3DAB for ; Tue, 22 Feb 2022 00:31:13 +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 4K2g813nhnz3hNC for ; Tue, 22 Feb 2022 00:31:13 +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 604F01A605 for ; Tue, 22 Feb 2022 00:31:13 +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 21M0VDFE018648 for ; Tue, 22 Feb 2022 00:31:13 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 21M0VDCM018647 for virtualization@FreeBSD.org; Tue, 22 Feb 2022 00:31:13 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 262113] bhyve fails every other attempt to run Date: Tue, 22 Feb 2022 00:31:13 +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: 13.0-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: risner@stdio.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=1645489873; 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=hkjx3Vefywh0mRpcLIuwG5XKxpAbgkWb1BFWUhB+f3o=; b=pESflBmc8DQ/o7kuhu3r8MWKqrFAnaP6bEElnP2Q9wW7Pfv5vCtI8COz4cppUivuqhJfqJ gwTX+cC0bBCcvKz0qXGbV3Hub8reszfDtP8cyD9MBUB+f2K8rQe++L48xAgiPnaYTFXnuj U1aVc9VSZfYnFyP6LAXNDMnAbEoLFeRnoSP/bMmHNVBzIGomiyl2hAj/Xa6TviC1gkl/6z jJqOThYCUZNFzjVtjsXISpq3qCp3TaVt/IDed1ANFoRiaIwTVJDtDDBEXIoBXImCPr+E1m xOqKJtsfp+4PHbf+PxT5xW3bCRW4TJFKbqR5qsON5YWmdyJK7MYTF5s7IYDGhQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645489873; a=rsa-sha256; cv=none; b=LzL3tHZ9e4FcJFL5ibHRQZ/3Hsbm15rcq2M76bdH/Sap6T17p3mRlDvGM+guspvHi+YGn4 XfTiKPIwZf09EAZ16Pll6ELIoawhcFNWa6aku0Ies7GuuGBbAsAc3Nv7GOWe/c5KUT8GXg bGccrE2NOgnl0sg/ij8u4C61lnv0TbdESG54jVE0cckms4XVnehEVgg7JGeKVE5yMiLWC6 AJQCpVUawShZgwweQW38nIs2vrkofgNhLucO8euQMhyBqE8PVZfdKpuwMysPtphsWeuFnH xT/dfCLGDxfK0MGADAlsLzOlzmgds1ODEsc6+fNvMiMhqPmiUzsQ9qhkyzGW4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D262113 Bug ID: 262113 Summary: bhyve fails every other attempt to run Product: Base System Version: 13.0-STABLE Hardware: amd64 OS: Any Status: New Severity: Affects Some People Priority: --- Component: bhyve Assignee: virtualization@FreeBSD.org Reporter: risner@stdio.com using an UEFI OS and the commands executed below, you may start bhyve. Regardless of the way you exit (ctrl-c, halt or reboot from inside the vm); when you retry you will get an invalid argument error. Retrying immediately after, it works. The cycle then repeats. bhyvectl --destroy --vm=3Dtest0 bhyve -AHP -c 1 -m 1024M -S -s 0,hostbridge -s 1,lpc -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -s 3,ahci-hd,efiboot.i= mg -s 29,fbuf,tcp=3D203.0.113.46:5900,w=3D800,h=3D600 test0 >From testing modifications to bhyve, the libvmmapi, and the kernel module I found that line 1006 of bhyverun.c calls vm_create and returns with EEXIST despite there being no entry in /dev/vmm and having ran bhyvectl --destroy immediately before bhyve. I could not conclusively prove what exactly is going on inside the kernel module. It fails on FreeBSD-13 p4 and p7. It failed on two different Cisco amd64 systems I had. If you don't have a testing OS with uefi, you can make a temporary one with this: dd if=3D/dev/zero of=3Defiboot.img bs=3D300m count=3D1 mdconfig -a -t vnode -f efiboot.img gpart create -s gpt md0 gpart add -t efi -s 256m md0 newfs_msdos -F 32 -c 1 -m 0xf8 /dev/md0p1 # format efi mount -t msdosfs /dev/md0p1 /mnt mkdir -p /mnt/EFI/BOOT wget -O /mnt/EFI/BOOT/BOOTX64.efi https://sourceforge.net/projects/supergrub2/files/2.04s1/super_grub2_disk_2= .04s1/super_grub2_disk_standalone_x86_64_efi_2.04s1.EFI/download umount /mnt mdconfig -d -u 0 --=20 You are receiving this mail because: You are the assignee for the bug.=