Page MenuHomeFreeBSD

D38072.diff
No OneTemporary

D38072.diff

diff --git a/sys/amd64/vmm/intel/vtd.c b/sys/amd64/vmm/intel/vtd.c
--- a/sys/amd64/vmm/intel/vtd.c
+++ b/sys/amd64/vmm/intel/vtd.c
@@ -446,6 +446,8 @@
struct vtdmap *vtdmap;
uint8_t bus;
+ KASSERT(dom != NULL, ("domain is NULL"));
+
bus = PCI_RID2BUS(rid);
ctxp = ctx_tables[bus];
pt_paddr = vtophys(dom->ptp);
diff --git a/sys/amd64/vmm/io/iommu.c b/sys/amd64/vmm/io/iommu.c
--- a/sys/amd64/vmm/io/iommu.c
+++ b/sys/amd64/vmm/io/iommu.c
@@ -258,6 +258,7 @@
}
IOMMU_DISABLE();
IOMMU_DESTROY_DOMAIN(host_domain);
+ host_domain = NULL;
IOMMU_CLEANUP();
}
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
@@ -182,7 +182,9 @@
num_pptdevs--;
TAILQ_REMOVE(&pptdev_list, ppt, next);
pci_disable_busmaster(dev);
- iommu_add_device(iommu_host_domain(), pci_get_rid(dev));
+
+ if (iommu_host_domain() != NULL)
+ iommu_add_device(iommu_host_domain(), pci_get_rid(dev));
return (0);
}

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 18, 1:49 PM (21 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14698761
Default Alt Text
D38072.diff (979 B)

Event Timeline