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, Aug 6, 9:34 PM
Unknown Object (File)
Mon, Jul 29, 3:49 AM
Unknown Object (File)
Jul 8 2024, 4:31 AM
Unknown Object (File)
Apr 26 2024, 4:54 PM
Unknown Object (File)
Apr 26 2024, 3:21 PM
Unknown Object (File)
Apr 26 2024, 3:20 PM
Unknown Object (File)
Apr 26 2024, 11:55 AM
Unknown Object (File)
Dec 23 2023, 12:03 AM

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