BCM2712 IOMMU: Allocate tables on demand; make IOVA base address and size configurable#6997
BCM2712 IOMMU: Allocate tables on demand; make IOVA base address and size configurable#6997njhollinghurst wants to merge 1 commit intoraspberrypi:rpi-6.12.yfrom
Conversation
4db0efd to
2111273
Compare
2111273 to
7de8409
Compare
|
Briefly tested with In this scenario, IOMMU allocated (16K) pages reached 93, so the change seems to be saving about 4.5 MBytes. More soak testing would be advisable. |
d638a92 to
5e8b30d
Compare
5e474ac to
35f25eb
Compare
|
After speaking to @jc-kynesim I've reverted the freeing of unused tables (seen in some of the intermediate pushes but no longer present in the commit); tables pages are retained for re-use. This reduces the risk that In practice the IOVA allocator seems to prefer to re-use the highest available addresses rather than walking through the entire space, so it seems benign. |
35f25eb to
961bf54
Compare
Allocate space for level-2 IOMMU translation tables on demand. This should save memory in most cases but means that map_pages() can now fail with -ENOMEM. Unused pages are retained for re-use. Add OF properties to override the default aperture size (2GB) and base address (40GB); this doesn't include any dma-iova-offset. Various tidy-ups. The internal representation of aperture limits *does* include dma_iova_offset, as that is more commonly useful. Clarify the distinction between Linux pages and IOMMU table pages. Fix wrong definition of MMMU_CTRL_PT_INVALID_EN flag. Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
2d70a54 to
bb59636
Compare
|
This has become a mess. I'm going to start again |
The first change is a draft of something we might actually want to do for Raspberry Pi 5.The second change is just for testing, to see if increasing IOVA can help resolve an issue with two 64Mpix cameras.
This has now been rebased and includes allocate-on-demand.