@@ -293,26 +293,6 @@ in <<fig:device-isolation>> the OS may configure the IOMMU with a page table to
293
293
translate the IOVA and thereby limit the addresses that may be accessed to those
294
294
allowed by the page table.
295
295
296
- Legacy 32-bit devices cannot access the memory above 4 GiB. The IOMMU, through
297
- its address remapping capability, offers a simple mechanism for the device to
298
- directly access any address in the system (with appropriate access permission).
299
- Without an IOMMU, the OS must resort to copying data through buffers (also
300
- known as bounce buffers) allocated in memory below 4 GiB. In this scenario the
301
- IOMMU improves the system performance.
302
-
303
- The IOMMU can be useful to perform scatter/gather DMA as it permits to allocate
304
- large regions of memory for I/O without the need for all of the memory to be
305
- contiguous. A contiguous virtual address range can map to such fragmented
306
- physical addresses and the device programmed with the virtual address range.
307
-
308
- The IOMMU can be used to support shared virtual addressing which is the ability
309
- to share a process address space with devices. The virtual addresses used for
310
- DMA are then translated by the IOMMU to an SPA.
311
-
312
- When the IOMMU is used by a non-virtualized OS, the first-stage suffices to
313
- provide the required address translation and protection function and the
314
- second-stage may be set to Bare.
315
-
316
296
[[fig:device-isolation]]
317
297
.Device isolation in non-virtualized OS
318
298
image::non-virt-OS.svg[width=300,height=300, align="center"]
@@ -340,6 +320,26 @@ image::non-virt-OS.svg[width=300,height=300, align="center"]
340
320
// +--------+
341
321
//....
342
322
323
+ Legacy 32-bit devices cannot access the memory above 4 GiB. The IOMMU, through
324
+ its address remapping capability, offers a simple mechanism for the device to
325
+ directly access any address in the system (with appropriate access permission).
326
+ Without an IOMMU, the OS must resort to copying data through buffers (also
327
+ known as bounce buffers) allocated in memory below 4 GiB. In this scenario the
328
+ IOMMU improves the system performance.
329
+
330
+ The IOMMU can be useful to perform scatter/gather DMA as it permits to allocate
331
+ large regions of memory for I/O without the need for all of the memory to be
332
+ contiguous. A contiguous virtual address range can map to such fragmented
333
+ physical addresses and the device programmed with the virtual address range.
334
+
335
+ The IOMMU can be used to support shared virtual addressing which is the ability
336
+ to share a process address space with devices. The virtual addresses used for
337
+ DMA are then translated by the IOMMU to an SPA.
338
+
339
+ When the IOMMU is used by a non-virtualized OS, the first-stage suffices to
340
+ provide the required address translation and protection function and the
341
+ second-stage may be set to Bare.
342
+
343
343
==== Hypervisor
344
344
345
345
IOMMU makes it possible for a guest operating system, running in a virtual
@@ -440,18 +440,6 @@ hypervisor.
440
440
441
441
<<fig:iommu-for-guest-os>> illustrates the concept.
442
442
443
- The IOMMU is configured to perform address translation using a first-stage
444
- and second-stage page table for device D1. The second-stage is typically used by
445
- the hypervisor to translate GPA to SPA and limit the device D1 to memory
446
- associated with VM-1. The first-stage is typically configured by the Guest OS to
447
- translate a VA to a GPA and contain device D1 access to a subset of VM-1 memory.
448
-
449
- For device D2 only the second-stage is active and the first-stage is set to Bare.
450
-
451
- The host OS or hypervisor may also retain a device, such as D3, for its own use.
452
- The first-stage suffices to provide the required address translation and
453
- protection function for device D3 and the second-stage is set to Bare.
454
-
455
443
[[fig:iommu-for-guest-os]]
456
444
.Address translation in IOMMU for Guest OS
457
445
image::guest-OS.svg[width=500,height=400, align="center"]
@@ -484,6 +472,18 @@ image::guest-OS.svg[width=500,height=400, align="center"]
484
472
// +-----------+ +-----------+ +-----------+
485
473
//....
486
474
475
+ The IOMMU is configured to perform address translation using a first-stage
476
+ and second-stage page table for device D1. The second-stage is typically used by
477
+ the hypervisor to translate GPA to SPA and limit the device D1 to memory
478
+ associated with VM-1. The first-stage is typically configured by the Guest OS to
479
+ translate a VA to a GPA and contain device D1 access to a subset of VM-1 memory.
480
+
481
+ For device D2 only the second-stage is active and the first-stage is set to Bare.
482
+
483
+ The host OS or hypervisor may also retain a device, such as D3, for its own use.
484
+ The first-stage suffices to provide the required address translation and
485
+ protection function for device D3 and the second-stage is set to Bare.
486
+
487
487
=== Placement and data flow
488
488
489
489
<<fig:example-soc-with-iommu>> shows an example of a typical system on a chip
@@ -643,6 +643,8 @@ Other implementation-specific methods in the IO bridge may be provided to
643
643
perform such authentication.
644
644
====
645
645
646
+ <<<
647
+
646
648
=== IOMMU features
647
649
Version 1.0 of the RISC-V IOMMU specification supports the following
648
650
features:
0 commit comments