Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F110687041
D35424.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D35424.diff
View Options
diff --git a/sys/arm64/arm64/gicv3_its.c b/sys/arm64/arm64/gicv3_its.c
--- a/sys/arm64/arm64/gicv3_its.c
+++ b/sys/arm64/arm64/gicv3_its.c
@@ -1483,7 +1483,8 @@
ctx = iommu_get_dev_ctx(child);
if (ctx == NULL)
return (ENXIO);
- error = iommu_map_msi(ctx, PAGE_SIZE, GITS_TRANSLATER,
+ /* Map the page containing the GITS_TRANSLATER register. */
+ error = iommu_map_msi(ctx, PAGE_SIZE, 0,
IOMMU_MAP_ENTRY_WRITE, IOMMU_MF_CANWAIT, &sc->ma);
*domain = iommu_get_ctx_domain(ctx);
diff --git a/sys/dev/iommu/busdma_iommu.c b/sys/dev/iommu/busdma_iommu.c
--- a/sys/dev/iommu/busdma_iommu.c
+++ b/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;
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
@@ -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(a->size + a->offset, IOMMU_PAGE_SIZE);
found = iommu_gas_rb_insert(a->domain, a->entry);
KASSERT(found, ("found dup %p start %jx size %jx",
@@ -381,7 +382,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);
@@ -415,7 +417,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);
@@ -450,7 +453,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
Sat, Feb 22, 9:58 PM (5 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16781134
Default Alt Text
D35424.diff (2 KB)
Attached To
Mode
D35424: iommu_gas: pass size without page alignment
Attached
Detach File
Event Timeline
Log In to Comment