Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Mar 2022 11:35:33 -0700
From:      Chuck Tuffli <chuck@tuffli.net>
To:        Mario Marietto <marietto2008@gmail.com>
Cc:        jason@tubnor.net,  FreeBSD virtualization <freebsd-virtualization@freebsd.org>
Subject:   Re: bhyve NVMe 1.4 support
Message-ID:  <CAM0tzX03Sw23acPW8ZRcwXO2Rze12OuvBoO6QSUfePpfBdrbWA@mail.gmail.com>
In-Reply-To: <CA%2B1FSijNU7Nn9UZujU%2BCLgJkaYFrbfdu37RT7s_r%2Be08AMG0Pw@mail.gmail.com>
References:  <CAM0tzX1W1Do=uqA3PONyksY4dmob%2BZMi-ib7aECVx6AH3XW6Pw@mail.gmail.com> <00bf01d80104$e6ba5de0$b42f19a0$@tubnor.net> <CAM0tzX1EdQfTDUMU1dNtQHxG9SB3VzNP5UGmHuiHCY5HsxL2QA@mail.gmail.com> <CAM0tzX1qJOuqJWv_04oMvTqQrmLNQf8O%2B8PJ6cjLyh9bLqRmNQ@mail.gmail.com> <082b01d80697$64e95030$2ebbf090$@tubnor.net> <CA%2B1FSiijy0YjX0Nju9kRAY8hsYc42Y70V3tu-RfqCnaRhzLa8A@mail.gmail.com> <CAM0tzX3SCOS2nOKaODVF2TCTOY_5F5sdqELA666uFRZ=ZreXpg@mail.gmail.com> <CA%2B1FSijNU7Nn9UZujU%2BCLgJkaYFrbfdu37RT7s_r%2Be08AMG0Pw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Mar 20, 2022 at 8:13 AM Mario Marietto <marietto2008@gmail.com> wrote:
>
> ----> Help me understand what "not recognized" means. The device nvme0n1 :
>
> I don't see the partitions that are stored inside the disk nvme. And I'm not able to mount the NTFS partition that's mapped as nvd0p2 under FreeBSD.

Thank you, I understand the question now. As an experiment, I created
a zvol, copied a FreeBSD disk image to it, and verified that fdisk
showed what I expected on the guest. I.e. :

#  zfs create -V 20G zroot/vmvol/gptdisk
#  dd if=/vms/.img/FreeBSD-14.0-CURRENT-amd64.raw
of=/dev/zvol/zroot/vmvol/gptdisk bs=1m
#  gpart recover zvol/zroot/vmvol/gptdisk
< add /dev/zvol/zroot/vmvol/gptdisk to test-vm configuration >
# vm start test-vm
# ssh root@test-vm lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 21.04
Release:        21.04
Codename:       hirsute
No LSB modules are available.
#  ssh root@test-vm fdisk -l /dev/nvme1n1
Disk /dev/nvme1n1: 20 GiB, 21474836480 bytes, 41943040 sectors
Disk model: bhyve-NVMe
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 1B73327C-EAE2-11EB-90A0-002590EC5BF2

Device           Start      End Sectors  Size Type
/dev/nvme1n1p1       3      129     127 63.5K FreeBSD boot
/dev/nvme1n1p2     130    66713   66584 32.5M EFI System
/dev/nvme1n1p3   66714  2163865 2097152    1G FreeBSD swap
/dev/nvme1n1p4 2163866 10552473 8388608    4G FreeBSD UFS

The bhyve invocation is:
bhyve -c 2 -m 2G -Hw \
    -s 0,hostbridge \
    -s 4:0,virtio-blk,/dev/zvol/zroot/vms/test-vm/disk0 \
    -s 5:0,nvme,/dev/zvol/zroot/vmvol/disk0 \
    -s 6:0,nvme,/dev/zvol/zroot/vmvol/gptdisk \
    -s 7:0,virtio-net,tap0,mac=58:9c:fc:0b:ed:d6
    -s 31,lpc \
    -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
    -l com1,/dev/nmdm-test-vm.1A \
    test-vm

Note that my experiment is different from what you are doing. But I
would expect a Zvol and raw block device to behave the same as a
backing-store for an emulated NVMe drive in bhyve. My experiment ran
on -current, but the behavior in this area should be identical to the
13.0-p8 version you are using.

Does the output on the host of
 # hd -n 256 /dev/nvd0
match the output on the guest of
 # hd -n 256 /dev/nvme0n1
?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAM0tzX03Sw23acPW8ZRcwXO2Rze12OuvBoO6QSUfePpfBdrbWA>