Re: Bhyve exit code 4 with PCI passthru

From: Xavier Humbert <xavier_at_xavierhumbert.net>
Date: Sun, 12 Feb 2023 17:49:52 UTC
Le 2/12/23 16:21, Xavier Humbert a écrit :
> Hi,
>
> Cannot boot VM with PCI passthru enabled.
>
> My /boot/loader.conf (relevant part):
>
>> vmm_load="YES"
>> nmdm_load="YES"
>> if_bridge_load="YES"
>> if_tap_load="YES"
>> pptdevs="10/0/0"
>> hw.vmm.amdvi.enable=1
> My vm-bhyve config
>
>> loader="grub"
>> grub_run_partition="2"
>> cpu=2
>> memory=4096M
>> network0_type="virtio-net"
>> network0_switch="public"
>> disk0_type="virtio-blk"
>> disk0_name="disk0.img"
>> uuid="f878c150-de67-11ec-8816-d05099c11279"
>> network0_mac="58:9c:fc:0d:84:62"
>> disk1_name="disk1.img"
>> disk1_type="virtio-blk"
>> disk1_dev="file"
>> disk2_name="disk2.img"
>> disk2_type="virtio-blk"
>> disk1_dev="file"
>> passthru0="10/0/0"
>> bhyve_options="-w"
>
> And the log :
>
>> Feb 12 16:04:40: initialising
>> Feb 12 16:04:40:  [loader: grub]
>> Feb 12 16:04:40:  [cpu: 2]
>> Feb 12 16:04:40:  [memory: 4096M]
>> Feb 12 16:04:40:  [hostbridge: standard]
>> Feb 12 16:04:40:  [com ports: com1]
>> Feb 12 16:04:40:  [uuid: f878c150-de67-11ec-8816-d05099c11279]
>> Feb 12 16:04:40:  [debug mode: no]
>> Feb 12 16:04:40:  [primary disk: disk0.img]
>> Feb 12 16:04:40:  [primary disk dev: file]
>> Feb 12 16:04:40: initialising network device tap0
>> Feb 12 16:04:40: adding tap0 -> vm-public (public addm)
>> Feb 12 16:04:40: bring up tap0 -> vm-public (public addm)
>> Feb 12 16:04:40: booting
>> Feb 12 16:04:40: create file /vms/valinor/device.map
>> Feb 12 16:04:40:  -> (hd0) /vms/valinor/disk0.img
>> Feb 12 16:04:40:  -> (hd1) /vms/valinor/disk1.img
>> Feb 12 16:04:40:  -> (hd2) /vms/valinor/disk2.img
>> Feb 12 16:04:40: /usr/local/sbin/grub-bhyve -c /dev/nmdm-valinor.1A 
>> -S -m /vms/valinor/device.map -M 4096M -r hd0,2 valinor
>> Feb 12 16:05:17:  [bhyve options: -c 2 -m 4096M -AHP -w -U 
>> f878c150-de67-11ec-8816-d05099c11279 -u -S]
>> Feb 12 16:05:17:  [bhyve devices: -s 0,hostbridge -s 31,lpc -s 
>> 4:0,virtio-blk,/vms/valinor/disk0.img -s 
>> 4:1,virtio-blk,/vms/valinor/disk1.img -s 
>> 4:2,virtio-blk,/vms/valinor/disk2.img -s 
>> 5:0,virtio-net,tap0,mac=58:9c:fc:0d:84:62 -s 6:0,passthru,10/0/0]
>> Feb 12 16:05:17:  [bhyve console: -l com1,/dev/nmdm-valinor.1A]
>> Feb 12 16:05:17: starting bhyve (run 1)
>> Feb 12 16:05:17: bhyve exited with status 4
>> Feb 12 16:05:17: destroying network device tap0
>> Feb 12 16:05:18: stopped
> Any help ?
>
> Thanks
>
> Chjeers
>
> Xavier
>
FWIW, the host is 13.2 STABLE, and the guest Ubuntu server Kinetics

Xavier

-- 
Xavier HUMBERT <xavier@xavierhumbert.net>
https://www.amdh.fr