From nobody Mon Mar 28 12:32:12 2022 X-Original-To: hackers@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 4A0D51A4DB72; Mon, 28 Mar 2022 12:32:50 +0000 (UTC) (envelope-from marietto2008@gmail.com) Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) (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 4KRsXx4n8vz4bvr; Mon, 28 Mar 2022 12:32:49 +0000 (UTC) (envelope-from marietto2008@gmail.com) Received: by mail-yb1-xb31.google.com with SMTP id o5so25728477ybe.2; Mon, 28 Mar 2022 05:32:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JQiiR+fvZ4/mwRf0qxdA4MOHSv49GID/bS75CqRqUCg=; b=ci53On1mJ6ezHipyiUzmqttahX8IYOGX/TiXOMbZXV+mzYb/3lvubLSTKBbadecIAS xpXP12MLsGXpcUOI/aZ6zXEmGw183ZyPGHPFa6/e3PGaffuEL+1IGT80428v90t6OSnz VXNQtCXDW4ndnZ1nvHLY5acsM4BMkXApu4g35Nl3cc07MKANnuxzwUlYgke9tdy9BpYX pTiYnHZBvjzN54IuQRK6fsWqrpOtmjGCrMGDKV9iVgVEDDQ2i3i3li4cs8PVri+VNRz5 P8F1tEvyxSASco4BD1rLJBBQ2tCg2gpWS/A7E2b3nUVYBKezJsesIUWL3FTulolpEdTJ l4UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JQiiR+fvZ4/mwRf0qxdA4MOHSv49GID/bS75CqRqUCg=; b=Z7OHIhuxpmCuYLDvdLB4XbZDLDq44akQApqFfkf12EimwYvavt0d/WW921v6L8RkI3 t52tJQCwllWezV3+OK88zAtlP6eu/8okMaU1o9TVYVYkJGChxGngZ70WBZ9bKm2lirwm vLPpP74S6hs7pUntsl4qhA85KBTDWonO1+9nTD3uIFUYEPSIsMCM0NQXO5WGOXOO6JRM HUWV+tGepybaFPOcGdYfdjqe3bfPbT1ZplWFJ9MBeiDDSLBvb4xFdrT4iD8qDyOkQxTl rAIQKQg3ykNyu5MIE5D6oSoG10i48WYa0zVWBIh3pbtDlnxO8xHSDOtqC3Rh2Hj2CkWt /Lzg== X-Gm-Message-State: AOAM533kmUt8sau/7gSGvhNfpUi0d/mzuhbRtXdeGV+HXr1IRLT6ewzK hl1wdO92pQCGFSHrTdbURpMiJh5eXfQJwtk+T5RbTcRASc0= X-Google-Smtp-Source: ABdhPJwyrnUfXQhjltXLZmJ62PCHRKJ0ddlCLCZTQrwGRDCF7OPgn/Zz5PqP/7pHRYQp73jB08QMzsjOWDKbycmTUBg= X-Received: by 2002:a25:e08f:0:b0:633:7d68:f21a with SMTP id x137-20020a25e08f000000b006337d68f21amr22326118ybg.650.1648470768684; Mon, 28 Mar 2022 05:32:48 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 References: <02ee01d8421f$cf723f20$6e56bd60$@tubnor.net> In-Reply-To: <02ee01d8421f$cf723f20$6e56bd60$@tubnor.net> From: Mario Marietto Date: Mon, 28 Mar 2022 14:32:12 +0200 Message-ID: Subject: Re: Virtio-win driver (virtio-blk and virtio-scsi) don't work when they are used on bhyve with Windows 11 as guest os To: jason@tubnor.net, =?UTF-8?Q?Corvin_K=C3=B6hne?= Cc: FreeBSD virtualization , hackers@freebsd.org Content-Type: multipart/alternative; boundary="0000000000009711e305db468255" X-Rspamd-Queue-Id: 4KRsXx4n8vz4bvr X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=ci53On1m; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of marietto2008@gmail.com designates 2607:f8b0:4864:20::b31 as permitted sender) smtp.mailfrom=marietto2008@gmail.com X-Spamd-Result: default: False [0.69 / 15.00]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; 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_DN_SOME(0.00)[]; NEURAL_SPAM_MEDIUM(1.00)[0.996]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::b31:from]; HTTP_TO_IP(1.00)[]; NEURAL_SPAM_LONG(0.68)[0.676]; MLMMJ_DEST(0.00)[freebsd-virtualization,hackers]; NEURAL_HAM_SHORT(-0.98)[-0.978]; 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 --0000000000009711e305db468255 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I've just installed the virtio driver version suggested by Corvin (0.185) and it works fine in Windows. So,now I can pass those NTFS disks without using the USB controller. That's so cool. Bhyve becoming even more and more interesting. I'm happy thanks to everyone. It works even in Linux without passing the disks using the USB controller. Maybe I can make a lighter /boot/loader.conf file,excluding the USB controllers..... Il giorno dom 27 mar 2022 alle ore 23:15 ha scritto: > > > > > > > What I want to achieve is to pass thru two of my NTFS "formatted" disks t= o > 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 boo= t > Windows 11 from the nvme disk nvd0. > > I've configured the bhyve VM 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/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 \ > > -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 \ > > > > > > =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) > > 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 \ > > -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 BLOCKIF_IOV_MAX + 2), function > pci_vtblk_proc, file /usr/src/usr.sbin/bhyve/pci_virtio_block.c, line 324= .* > > I have also opened a bug request below,but no one replied until now. > > > > Use nvme or ahci-hd for da4/da2 and see what you get. The whole disk need= s > to go in there so Windows sees the GPT label. The other thing that comes = to > mind is that FreeBSD has hold of the disks and won=E2=80=99t allow them t= o be > inserted, similar to issues when passing zvol into guests when volmode<>d= ev. > > > > Cheers, > > > > Jason. > --=20 Mario. --0000000000009711e305db468255 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I've just installed the virtio driver version suggeste= d by Corvin (0.185) and it works fine in Windows. So,now I can pass those N= TFS disks without using the USB controller. That's so cool. Bhyve becom= ing even more and more interesting. I'm happy thanks to everyone. It wo= rks even in Linux without passing the disks using the USB controller. Maybe= I can make a lighter /boot/loader.conf file,excluding the USB controllers.= ....

Il giorno dom 27 mar 2022 alle ore 23:15 <jason@tubnor.net> ha scritto:

=C2=A0

=C2=A0

=C2=A0

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 fro= m the nvme disk nvd0.

I've configured the bhyve VM = like this :

=C2=A0
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,r=
ec=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,x=
hci,tablet \
-s 31,lpc \=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 
-l bootrom,/usr/local/share/uefi-firmware/=
BHYVE_BHF_CODE.fd \
vm4 < /dev/null=
 & sleep 2 && vncviewer 0:4

= =C2=A0

These are the NTFS disks that I would like to se= e inside the Windows 11 guest os :


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

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 \<=
u>
-s 3,virtio-blk,/dev/da2 \
-s 8,virtio-net,tap4 \
=
-s 10,hda,play=3D/dev/dsp,rec=3D/dev/dsp \<=
/pre>
-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 \ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0
-l b=
ootrom,/usr/local/share/uefi-firmware/BHYVE_BHF_CODE.fd \
vm4 < /dev/null & sleep 2 && vncviewer 0=
:4

=C2=A0

and I get = this error :

=C2=A0

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

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

=C2=A0

Use nvme or ahci-hd for da4/da2 and see what you get. = The whole disk needs to go in there so Windows sees the GPT label. The othe= r thing that comes to mind is that FreeBSD has hold of the disks and won=E2= =80=99t allow them to be inserted, similar to issues when passing zvol into= guests when volmode<>dev.

=C2=A0

Chee= rs,

=C2=A0

Jason.



--
Mario.
--0000000000009711e305db468255--