Score:1

Passing a raid controller to a KVM vm using PCI passthrough, CPU soft lockup

cn flag

I have a Debian 10 host server, and an Ubuntu 20.04 guest with KVM. The Ubuntu server is created with virt-install and works as intended after install. I'm trying to use PCI passthrough to pass a raid controller (Adaptec 81605Z) to the guest. With virsh edit my_vm I've added

<hostdev mode='subsystem' type='pci' managed='yes'>
  <driver name='vfio'/>
  <source>
    <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
  </source>
</hostdev>

to the configuration. Then I've used virsh nodedev-dettach pci_0000_01_00_0 to detach the raid controller from the host, after which lspci -nnv shows

01:00.0 RAID bus controller [0104]: Adaptec Series 8 12G SAS/PCIe 3 [9005:028d] (rev 01)
    Subsystem: Adaptec Series 8 12G SAS/PCIe 3 [9005:0557]
    Flags: fast devsel, IRQ 16
    Memory at a2100000 (64-bit, non-prefetchable) [size=1M]
    Memory at a2280000 (64-bit, non-prefetchable) [size=1K]
    I/O ports at 4000 [size=256]
    Expansion ROM at a2200000 [disabled] [size=512K]
    Capabilities: [80] Power Management version 3
    Capabilities: [90] MSI: Enable- Count=1/32 Maskable+ 64bit+
    Capabilities: [b0] MSI-X: Enable- Count=64 Masked-
    Capabilities: [c0] Express Endpoint, MSI 00
    Capabilities: [100] Advanced Error Reporting
    Capabilities: [300] #19
    Kernel driver in use: vfio-pci
    Kernel modules: aacraid

However, when I start my vm with virsh start my_vm --console, the console just gets stuck, nothing is printed, so something seems to be wrong as the vm doesn't boot. After a moment I start getting

kernel:[  747.764965] watchdog: BUG: soft lockup - CPU#1 stuck for 22s! [qemu-system-x86:1305]

errors and my host machine considerably slows down. I have disabled kvm from the vm as that might cause problems. My vm has 4GB of ram and 4 VCPUs allocated for it.

Is there something wrong with my configuration?

Michael Hampton avatar
cz flag
Check `dmesg` on the host.
jaine avatar
cn flag
I get the following messages concerning the vfio-pci: `[ 564.743353] vfio-pci 0000:01:00.0: vfio_ecap_init: hiding ecap 0x19@0x300`, after which I get a few of `[ 566.554256] vfio-pci 0000:01:00.0: not ready 1023ms after FLR; waiting` and then `[ 634.041210] vfio-pci 0000:01:00.0: not ready 65535ms after FLR; giving up`
Zac67 avatar
ru flag
Likely, the hardware driver doesn't support passthrough. You should consider mounting the RAID arrays on the host and just provide access to the guest.
jaine avatar
cn flag
From other forums I've seen at least some people passing Adaptec controllers with PCI passthrough. For example [here](https://forums.servethehome.com/index.php?threads/epyc-rome-unable-to-pass-through-sata-ports-to-vm-flr-bug.28592/). How do I know if it's possible or not?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.