Page MenuHomeFreeBSD

D35414.diff
No OneTemporary

D35414.diff

diff --git a/sys/dev/iommu/iommu_gas.c b/sys/dev/iommu/iommu_gas.c
--- a/sys/dev/iommu/iommu_gas.c
+++ b/sys/dev/iommu/iommu_gas.c
@@ -384,7 +384,12 @@
iommu_gas_match_insert(a);
return (0);
}
- if (entry->free_down < a->size + a->offset + IOMMU_PAGE_SIZE)
+
+ /*
+ * If the subtree doesn't have free space for the requested allocation
+ * plus two guard pages, give up.
+ */
+ if (entry->free_down < a->size + a->offset + 2 * IOMMU_PAGE_SIZE)
return (ENOMEM);
if (entry->first >= a->common->lowaddr)
return (ENOMEM);
@@ -408,7 +413,11 @@
{
struct iommu_map_entry *child;
- if (entry->free_down < a->size + a->offset + IOMMU_PAGE_SIZE)
+ /*
+ * If the subtree doesn't have free space for the requested allocation
+ * plus two guard pages, give up.
+ */
+ if (entry->free_down < a->size + a->offset + 2 * IOMMU_PAGE_SIZE)
return (ENOMEM);
if (entry->last < a->common->highaddr)
return (ENOMEM);

File Metadata

Mime Type
text/plain
Expires
Sat, May 3, 1:42 AM (13 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17916599
Default Alt Text
D35414.diff (930 B)

Event Timeline