Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144475386
D46245.id141960.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
947 B
Referenced Files
None
Subscribers
None
D46245.id141960.diff
View Options
diff --git a/sys/amd64/vmm/io/ppt.c b/sys/amd64/vmm/io/ppt.c
--- a/sys/amd64/vmm/io/ppt.c
+++ b/sys/amd64/vmm/io/ppt.c
@@ -376,6 +376,18 @@
pci_power_reset(dev);
}
+static bool
+ppt_has_mem_bar(struct pptdev *ppt)
+{
+ struct pci_map *pm;
+
+ for (pm = pci_first_bar(ppt->dev); pm != NULL; pm = pci_next_bar(pm)) {
+ if (PCI_BAR_MEM(pm->pm_value))
+ return (true);
+ }
+ return (false);
+}
+
int
ppt_assign_device(struct vm *vm, int bus, int slot, int func)
{
@@ -392,6 +404,9 @@
pci_restore_state(ppt->dev);
ppt->vm = vm;
iommu_add_device(vm_iommu_domain(vm), pci_get_rid(ppt->dev));
+ pci_enable_busmaster(ppt->dev);
+ if (ppt_has_mem_bar(ppt))
+ pci_enable_io(ppt->dev, SYS_RES_MEMORY);
return (0);
}
@@ -405,6 +420,8 @@
if (error)
return (error);
+ pci_disable_io(ppt->dev, SYS_RES_MEMORY);
+ pci_disable_busmaster(ppt->dev);
pci_save_state(ppt->dev);
ppt_pci_reset(ppt->dev);
pci_restore_state(ppt->dev);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 9, 3:33 PM (13 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28594671
Default Alt Text
D46245.id141960.diff (947 B)
Attached To
Mode
D46245: vmm ppt: Enable busmastering and BAR decoding while a device is assigned
Attached
Detach File
Event Timeline
Log In to Comment