Skip to content

Conversation

@alex-matei
Copy link
Contributor

@alex-matei alex-matei commented Oct 2, 2024

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.

Fixes: #6775

@alex-matei alex-matei requested a review from a team as a code owner October 2, 2024 10:26
@alex-matei alex-matei force-pushed the fix/move_bar_pci_resources_deadlock branch 3 times, most recently from 9db8938 to b10aef7 Compare October 2, 2024 11:47
Copy link
Member

@rbradford rbradford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@rbradford
Copy link
Member

@alex-matei Please can you rebase your branch to capture the latest CI changes.

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.

Fixes: cloud-hypervisor#6775

Signed-off-by: Alexandru Matei <[email protected]>
@alex-matei alex-matei force-pushed the fix/move_bar_pci_resources_deadlock branch from b10aef7 to 5b1997b Compare October 3, 2024 07:56
@alex-matei
Copy link
Contributor Author

@rbradford I rebased the branch.

@rbradford rbradford added this pull request to the merge queue Oct 3, 2024
Merged via the queue into cloud-hypervisor:main with commit c891dcb Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

deadlock between pci_resources and move_bar

2 participants