Commit 848cd72
committed
vmm: fix dma map when add-device after removing all vfio devices
Now cloud hypervisor do vfio dma map only when first vfio container
created, this can be problematic in some cases. When remove-device
VfioDevice::drop() will be called, which will call VFIO_GROUP_UNSET_CONTAINER
ioctl. The vfio kernel driver detach vfio group and will unpin and
unmap all guest memory when group_list is empty which means the last
vfio device is removed. At this time if a new vfio device is added
cloud hypervisor will not do dma map again and dma access will fail.
Signed-off-by: Yi Wang <foxywang@tencent.com>1 parent 10fb713 commit 848cd72
3 files changed
Lines changed: 7 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
119 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3742 | 3742 | | |
3743 | 3743 | | |
3744 | 3744 | | |
3745 | | - | |
| 3745 | + | |
3746 | 3746 | | |
3747 | 3747 | | |
3748 | 3748 | | |
| |||
0 commit comments