-
Notifications
You must be signed in to change notification settings - Fork 565
Description
Describe the bug
AddressManager::move_bar() acquires the device_tree mutex. The function is called from PciConfigIo::config_space_write()/PciConfigMmio::config_space_write() while the pci_bus mutex is acquired.
The functions DeviceManager::pci_resources()/eject_device() acquire these mutexes in reverse order, which leads to a deadlock.
To Reproduce
Create a new VM and do a snapshot of it. Create a new VM from snapshot and add a disk. pci_resources() is called when adding the disk. move_bar() is called from config_space_write() at the same time. Cloud-hypervisor hangs while processing "/vm.add-disk" command because of the deadlock between these two functions. I reproduced this issue with kata-containers, it issues multiple add commands and cloud-hypervisor freezes on one of them.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status