Page MenuHomeFreeBSD

bhyve: [snapshot] virtio-net features could be not negotiated
ClosedPublic

Authored by gusev.vitaliy_gmail.com on Aug 17 2022, 4:14 PM.
Tags
Referenced Files
Unknown Object (File)
Tue, May 6, 12:45 PM
Unknown Object (File)
Thu, May 1, 9:32 AM
Unknown Object (File)
Sat, Apr 19, 4:35 AM
Unknown Object (File)
Mar 26 2025, 9:05 PM
Unknown Object (File)
Mar 21 2025, 7:08 AM
Unknown Object (File)
Mar 18 2025, 4:19 AM
Unknown Object (File)
Mar 3 2025, 10:59 PM
Unknown Object (File)
Feb 17 2025, 4:39 PM

Details

Summary

Quite simple fix.

bhyve: [snapshot] virtio-net features could be not negotiated

In case of device reset or not configured - features_negotiated is not set,
calling calling pci_vtnet_neg_features is wrong and resume gets "Segmentation fault":

    
(lldb) bt
 * thread #1, name = 'mevent', stop reason = signal SIGSEGV
 * frame #0: 0x00000000010b9198 bhyve`vq_getchain + 104
   frame #1: 0x000000000109fc13 bhyve`pci_vtnet_rx + 275
   frame #2: 0x000000000109f003 bhyve`pci_vtnet_rx_callback + 51
   frame #3: 0x000000000106b3b8 bhyve`mevent_handle + 88
   frame #4: 0x000000000106afcd bhyve`mevent_dispatch + 525
   frame #5: 0x000000000105797b bhyve`main + 3243
   frame #6: 0x000000000105072d bhyve`_start + 269

Sponsored by vStack.

Test Plan

Guest OS: Linux RHEL8.x

There are two options to get fault:

  1. Send suspend request at early time when Guest OS not finished booting.
  2. Remove virtio_net.ko module in guest OS (recreate initramfs, reboot).

Verify fault: Run VM an after guest boots, send suspend request. Resume. Get fault.

Apply patch and re-run, suspend/resume, verify no fault.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable