Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F133010034
D35424.id106750.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D35424.id106750.diff
View Options
Index: sys/dev/iommu/busdma_iommu.c
===================================================================
--- sys/dev/iommu/busdma_iommu.c
+++ sys/dev/iommu/busdma_iommu.c
@@ -594,8 +594,7 @@
if (seg + 1 < tag->common.nsegments)
gas_flags |= IOMMU_MF_CANSPLIT;
- error = iommu_map(domain, &tag->common,
- round_page(offset + buflen1),
+ error = iommu_map(domain, &tag->common, buflen1,
offset, e_flags, gas_flags, ma + idx, &entry);
if (error != 0)
break;
Index: sys/dev/iommu/iommu_gas.c
===================================================================
--- sys/dev/iommu/iommu_gas.c
+++ sys/dev/iommu/iommu_gas.c
@@ -364,7 +364,8 @@
* The page sized gap is created between consequent
* allocations to ensure that out-of-bounds accesses fault.
*/
- a->entry->end = a->entry->start + a->size;
+ a->entry->end = a->entry->start +
+ roundup2(size + a->offset, IOMMU_PAGE_SIZE);
found = iommu_gas_rb_insert(a->domain, a->entry);
KASSERT(found, ("found dup %p start %jx size %jx",
@@ -389,7 +390,8 @@
* 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)
+ if (entry->free_down < 2 * IOMMU_PAGE_SIZE +
+ roundup2(a->size + a->offset, IOMMU_PAGE_SIZE))
return (ENOMEM);
if (entry->first >= a->common->lowaddr)
return (ENOMEM);
@@ -417,7 +419,8 @@
* 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)
+ if (entry->free_down < 2 * IOMMU_PAGE_SIZE +
+ roundup2(a->size + a->offset, IOMMU_PAGE_SIZE))
return (ENOMEM);
if (entry->last < a->common->highaddr)
return (ENOMEM);
@@ -452,7 +455,6 @@
IOMMU_DOMAIN_ASSERT_LOCKED(domain);
KASSERT(entry->flags == 0, ("dirty entry %p %p", domain, entry));
- KASSERT((size & IOMMU_PAGE_MASK) == 0, ("size %jx", (uintmax_t)size));
a.domain = domain;
a.size = size;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Oct 23, 1:05 AM (6 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24076553
Default Alt Text
D35424.id106750.diff (1 KB)
Attached To
Mode
D35424: iommu_gas: pass size without page alignment
Attached
Detach File
Event Timeline
Log In to Comment