[iommu][arm_smmu] Port shared stage-1 modules Port the shared stage-1 VMSAv8-64 modules in //zircon/kernel/dev/iommu/arm_smmu/common/ to Rust so they can be shared across both SMMUv2 and SMMUv3 and compiled in both the unified Zircon kernel crate (cfg(is_kernel)) and host unit tests (cfg(not(is_kernel))): - common/env.rs: zero-cost SmmuEnv seam abstracting PMM page allocation/reclamation, physmap conversions, CPU data-cache cleaning, and PinnedVmObject physical range lookups. It also has the single observation point for stores into memory the SMMU hardware reads, SmmuEnv::observe_hw_visible_write, which reports a store to the host test hardware model and is a no-op in the kernel. - common/constants.rs: shared IOMMU permission flags, page geometry constants, and operating mode enumerations. - common/smmu_mode.rs: kernel.arm-smmu-mode parser and validator. It reads each <base_addr> token as the C++ parser's strtoul(.., 0) did, including that function's quirks, so that an existing command line selects the same mode. - common/vmsav8_64.rs: VMSAv8-64 stage-1 page table descriptor helpers, permission lookup table, and the two functions through which every translation table store goes, write_pte and zero_table_page. - common/page_cache.rs: intrusive LIFO translation table page cache. Trimmed pages are returned to the PMM in one batch, as in C++. - common/translation_table.rs: 4-level translation table walk, allocation, cache-cleaning, and empty-table reclamation cursor. - common/device_aspace.rs: stage-1 device address space managing the translation table hierarchy and RegionAllocator IOVA space. Places where the Rust deliberately differs from the C++ are marked with a "Temporary porting note:" comment. Bug: 565848139 Test: fx build --host //zircon/kernel/dev/iommu/arm_smmu/tests:arm_smmu_tests Test: arm_smmu_tests_binary Change-Id: I9da77963238c6f8498c8204758c8dca8516badec Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1912407 Reviewed-by: Abdulla Kamar <abdulla@google.com> Fuchsia-Auto-Submit: Dustin Green <dustingreen@google.com> Reviewed-by: Adrian Danis <adanis@google.com> Commit-Queue: Dustin Green <dustingreen@google.com>
Fuchsia is an open source, general purpose operating system supporting modern 64-bit Intel and ARM processors.
We expect everyone interacting with our project to respect our code of conduct.
Read more about Fuchsia's principles.
See Getting Started.
See fuchsia.dev.