Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107661324
D37891.id114595.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
D37891.id114595.diff
View Options
diff --git a/sys/dev/virtio/block/virtio_blk.c b/sys/dev/virtio/block/virtio_blk.c
--- a/sys/dev/virtio/block/virtio_blk.c
+++ b/sys/dev/virtio/block/virtio_blk.c
@@ -397,6 +397,15 @@
goto fail;
}
+#ifdef __powerpc__
+ /*
+ * Virtio uses physical addresses rather than bus addresses, so we
+ * need to ask busdma to skip the iommu physical->bus mapping. At
+ * present, this is only a thing on the powerpc architectures.
+ */
+ bus_dma_tag_set_iommu(sc->vtblk_dmat, NULL, NULL);
+#endif
+
error = vtblk_alloc_virtqueue(sc);
if (error) {
device_printf(dev, "cannot allocate virtqueue\n");
@@ -1070,9 +1079,8 @@
if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) {
/*
- * We cast bus_addr_t to vm_paddr_t here; this isn't valid on
- * all platforms, but we believe it works on all platforms
- * which are supported by virtio.
+ * We cast bus_addr_t to vm_paddr_t here; since we skip the
+ * iommu mapping (see vtblk_attach) this should be safe.
*/
for (i = 0; i < nseg; i++) {
error = sglist_append_phys(sg,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 18, 8:19 AM (15 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15852402
Default Alt Text
D37891.id114595.diff (1 KB)
Attached To
Mode
D37891: vtblk: Bypass iommu on powerpc
Attached
Detach File
Event Timeline
Log In to Comment