From nobody Fri Mar 25 11:54:53 2022 X-Original-To: freebsd-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 116871A3501B; Fri, 25 Mar 2022 11:55:31 +0000 (UTC) (envelope-from marietto2008@gmail.com) Received: from mail-yw1-x112c.google.com (mail-yw1-x112c.google.com [IPv6:2607:f8b0:4864:20::112c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KQ0sG3zHsz4hxY; Fri, 25 Mar 2022 11:55:30 +0000 (UTC) (envelope-from marietto2008@gmail.com) Received: by mail-yw1-x112c.google.com with SMTP id 00721157ae682-2e6650cde1bso79891597b3.12; Fri, 25 Mar 2022 04:55:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=iShWTSIeDsy4Hnopo6XPpfxjyxISP22sXUHsBvVNk18=; b=LwCyFCtAvLkRStQRD/IP6ekXpco0kq3esoU4Y2vs3KnCiVERCbXPPhUf++chnk6WUg +4FrrQOEBjvWMhWxscMkNx0ElLplDzkqeS7bLCrTAOB0myB+EU+rYFa1AYvxDluc6LDD npVkmx+C2vBLAc7ZyzImEHqh6pmpos4856W8VuxybLbaKUGBRPZnXi6tbXBc7nRCLFdC YvWYrf+bEylc6lPHwbBqVwTGyV4TkrRiRZB/1qGdKCf9FJiFdjXPi89GmmNrRTsKqioe fOG8oJdMHAsXQzv+nSIelN7ebMPz9m/ZufZ6V+Kg3BNpuPk1bv8mJWvkVQjZNPVhONg2 gsTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=iShWTSIeDsy4Hnopo6XPpfxjyxISP22sXUHsBvVNk18=; b=AjX2uhR3Ang352LQkXXbI2wOsbYAxjIekLkIMKz9b3IsCf0nd/PY3uU8x6dcllHIyK Sf0fXS+yV+M0IgUecD5k42evW/pU6Zu/oDHBDNNtPtHCGLm3XA+C/MsrzrPjf1ax96aM DVmJP8c30p6gKZXTfqt8uR1FHgC12q3i1z/KxN6sUCF3PXJNPmgxcPd1sUnNOtZk5kHC zrRek7vvNUudVZozRyRUeEuR09bg10OEyFka1afC1pSiB6ihgDhIHGp1GJUiv25x2FPV sdw4QQHmhykG+Pvhh4ZEC3jBmYaGxqAAEc4EoTRtbkXZz4pWxziFIHBuWyOuS0MnMn8q Xl1g== X-Gm-Message-State: AOAM531b7w3C/A1aqRBMUV9PTXuvXK1xtrri9GH9Xy6ZPk8vBibwDpWi +yUBT80tdtrcJpdztQkeerXh0Zj9HAJf/S8neptJpRILmdkY3kMy X-Google-Smtp-Source: ABdhPJzMJgmU51bqiO0GAZI/mv3CVarJgM+xVKkxuM7RVAQ1ybmJm6gX19zwCcacC/f/5GAuIKRZev/X/33W5zkmEmo= X-Received: by 2002:a81:2f4d:0:b0:2e5:f342:a5a7 with SMTP id v74-20020a812f4d000000b002e5f342a5a7mr9855565ywv.287.1648209329568; Fri, 25 Mar 2022 04:55:29 -0700 (PDT) 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 From: Mario Marietto Date: Fri, 25 Mar 2022 12:54:53 +0100 Message-ID: Subject: Virtio-win driver (virtio-blk and virtio-scsi) don't work when they are used on bhyve with Windows 11 as guest os To: FreeBSD virtualization , hackers@freebsd.org Content-Type: multipart/alternative; boundary="0000000000009ac17405db09a3ae" X-Rspamd-Queue-Id: 4KQ0sG3zHsz4hxY X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=LwCyFCtA; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of marietto2008@gmail.com designates 2607:f8b0:4864:20::112c as permitted sender) smtp.mailfrom=marietto2008@gmail.com X-Spamd-Result: default: False [-1.85 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.96)[-0.960]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_SPAM_SHORT(0.11)[0.110]; MID_RHS_MATCH_FROMTLD(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; HTTP_TO_IP(1.00)[]; MLMMJ_DEST(0.00)[freebsd-virtualization,hackers]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::112c:from]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-ThisMailContainsUnwantedMimeParts: N --0000000000009ac17405db09a3ae Content-Type: text/plain; charset="UTF-8" Hello. What I want to achieve is to pass thru two of my NTFS "formatted" disks to a Windows 11 VM,but without passing them thru using the USB controller in FreeBSD with a bhyve virtual machine (in the example below I tried to boot Windows 11 from the nvme disk nvd0. I'm using this FreeBSD version : FreeBSD marietto 13.0-RELEASE FreeBSD 13.0-RELEASE #8 n244809-dff3dead3734: Wed Feb 23 13:16:32 CET 2022 marietto@marietto:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64 I've configured the bhyve VM like this : bhyve -S -c sockets=1,cores=2,threads=2 -m 4G -w -H -A \ -s 0,hostbridge \ -s 1,ahci-hd,/dev/nvd0 \ -s 2,virtio-blk,/dev/da4p2 \ -s 3,virtio-blk,/dev/da2p1 \ -s 8,virtio-net,tap4 \ -s 10,hda,play=/dev/dsp,rec=/dev/dsp \ -s 29,fbuf,tcp=[0.0.0.0:5904](http://0.0.0.0:5904/),w=1440,h=900 \ -s 30,xhci,tablet \ -s 31,lpc \ -l bootrom,/usr/local/share/uefi-firmware/BHYVE_BHF_CODE.fd \ vm4 < /dev/null & sleep 2 && vncviewer 0:4 These are the NTFS disks that I would like to see inside the Windows 11 guest os : -s 2,virtio-blk,/dev/da4p2 \ -s 3,virtio-blk,/dev/da2p1 \ => 34 19532873661 da4 GPT (9.1T) 34 32734 1 ms-reserved (16M) 32768 19532838912 2 ms-basic-data (9.1T) 19532871680 2015 - free - (1.0M) => 34 23437705149 da2 GPT (11T) 34 2014 - free - (1.0M) 2048 23437701120 1 ms-basic-data (11T) 23437703168 2015 - free - (1.0M) As you can see I've used the virtio-blk driver,so inside the Windows 11 VM I've installed the latest version of the virtio drivers. The disks attached are 0 byte large,so they aren't recognized by Windows 11. Is this a bug or what ? They are USB 3.0 disks. You can give a look at the images below if u want to have a better understanding : https://forums.freebsd.org/attachments/1-jpg.13311/ https://forums.freebsd.org/attachments/2-jpg.13312/ I've tried also like this : bhyve -S -c sockets=1,cores=2,threads=2 -m 4G -w -H -A \ -s 0,hostbridge \ -s 1,ahci-hd,/dev/nvd0 \ -s 2,virtio-blk,/dev/da4 \ -s 3,virtio-blk,/dev/da2 \ -s 8,virtio-net,tap4 \ -s 10,hda,play=/dev/dsp,rec=/dev/dsp \ -s 29,fbuf,tcp=[0.0.0.0:5904](http://0.0.0.0:5904/),w=1440,h=900 \ -s 30,xhci,tablet \ -s 31,lpc \ -l bootrom,/usr/local/share/uefi-firmware/BHYVE_BHF_CODE.fd \ vm4 < /dev/null & sleep 2 && vncviewer 0:4 and I get this error : *Assertion failed: (n >= 2 && n <= BLOCKIF_IOV_MAX + 2), function pci_vtblk_proc, file /usr/src/usr.sbin/bhyve/pci_virtio_block.c, line 324.* I have tried also with : -s 2,virtio-scsi,/dev/da4p2 \ -s 3,virtio-scsi,/dev/da2p1 \ and I have also installed the virtio-scsi driver on Windows 11,that has been accepted by windows,but the disks aren't recognized : https://forums.freebsd.org/attachments/screenshot_2022-03-13_11-23-54-jpg.13321/ https://forums.freebsd.org/attachments/screenshot_2022-03-13_11-10-16-jpg.13320/ Finally I tried by virtualizing ubuntu with bhyve using the virtio-scsi driver on ubuntu as guest os and it worked,so there is a bug only on the drivers for windows. You can see what happens with ubuntu going on the freebsd forum at this address : https://forums.FreeBSD.org/threads/usb-3-0-disks-not-recognized-by-windows-if-passed-through-as-slots.84402/post-559924 I have also opened a bug request below,but no one replied until now. https://github.com/virtio-win/kvm-guest-drivers-windows/issues/747 -- Mario. --0000000000009ac17405db09a3ae Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello.

<= table>

What I want to ach= ieve is to pass thru two of my NTFS=20 "formatted" disks to a Windows 11 VM,but without passing them thr= u using the USB controller in FreeBSD with a bhyve virtual machine (in the=20 example below I tried to boot Windows 11 from the nvme disk nvd0.


I'm using this FreeBSD version = :


FreeBSD marietto 13.0-RELEASE FreeBSD 13.0-RELEASE #8 n= 244809-dff3dead3734: Wed Feb 23 13:16:32 CET 2022 marietto@marietto:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64


I've configured the bhyve VM li= ke this :


bhyve -S -c sockets=3D1,cores=3D2,threads=3D2 -m 4G -w -H -A \
-s 0,hostbridge \
-s 1,ahci-hd,/dev/nvd0 \
-s 2,virtio-blk,/dev/da4p2 \
-s 3,virtio-blk,/dev/da2p1 \
-s 8,virtio-net,tap4 \
-s 10,hda,play=3D/dev/dsp,rec=3D/dev/dsp \
-s 29,fbuf,tcp=3D[0.0.0.0:5904](http://0.0.0.0:5904/),w=3D1440,h=3D900 \
-s 30,xhci,tablet \
-s 31,lpc \                          =20
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_BHF_CODE.fd \
vm4 < /dev/null & sleep 2 && vncviewer 0:4


These are the NTFS disks that I wou= ld like to see inside the Windows 11 guest os :


-s 2,virtio-blk,/dev/da4p2 \ -s 3,virtio-blk,/dev/da2p1 \ =3D> 34 19532873661 da4 GPT (9.1T) 34 32734 1 ms-reserved (16M) 32768 19532838912 2 ms-basic-data (9.1T) 19532871680 2015 - free - (1.0M) =3D> 34 23437705149 da2 GPT (11T) 34 2014 - free - (1.0M) 2048 23437701120 1 ms-basic-data (11T) 23437703168 2015 - free - (1.0M)


As you can see I've used the vi= rtio-blk driver,so inside=20 the Windows 11 VM I've installed the latest version of the virtio=20 drivers. The disks attached are 0 byte large,so they aren't recognized= =20 by Windows 11. Is this a bug or what ? They are USB 3.0 disks. You can=20 give a look at the images below if u want to have a better understanding :


https://for= ums.freebsd.org/attachments/1-jpg.13311/
https://forums.freebsd.org/attachments/2-jpg.13312/=


I've tried also like this :


bhyve -S -c sockets=3D1,cores=3D2,threads=3D2 -m 4G -w = -H -A \ -s 0,hostbridge \ -s 1,ahci-hd,/dev/nvd0 \ -s 2,virtio-blk,/dev/da4 \ -s 3,virtio-blk,/dev/da2 \ -s 8,virtio-net,tap4 \ -s 10,hda,play=3D/dev/dsp,rec=3D/dev/dsp \ -s 29,fbuf,tcp=3D[0.0.0.0:5904](http://0.0.0.0:5904/),w=3D1440,h=3D900 \ -s 30,xhci,tablet \ -s 31,lpc \ =20 -l bootrom,/usr/local/share/uefi-firmware/BHYVE_BHF_CODE.fd \ vm4 < /dev/null & sleep 2 && vncviewer 0:4


and I get this error :


Assertion = failed: (n >=3D 2 && n <=3D=20 BLOCKIF_IOV_MAX + 2), function pci_vtblk_proc, file=20 /usr/src/usr.sbin/bhyve/pci_virtio_block.c, line 324.


I have tried also with :


-s 2,virtio-scsi,/dev/da4p2 \ -s 3,virtio-scsi,/dev/da2p1 \


and I have also installed the virti= o-scsi driver on=20 Windows 11,that has been accepted by windows,but the disks aren't=20 recognized :


https://forums.freebsd.org/attachments/screenshot_2022-03= -13_11-23-54-jpg.13321/
https://forums.freebsd= .org/attachments/screenshot_2022-03-13_11-10-16-jpg.13320/


Finally I tried by virtualizing ubu= ntu with bhyve using=20 the virtio-scsi driver on ubuntu as guest os and it worked,so there is a bug only on the drivers for windows. You can see what happens with=20 ubuntu going on the freebsd forum at this address :


=

https://forums.FreeBSD.org/threads/usb-3-0= -disks-not-recognized-by-windows-if-passed-through-as-slots.84402/post-5599= 24


I have also opened a bug = request below,but no one replied until now.



--
Mario.
--0000000000009ac17405db09a3ae--