@@ -22,6 +22,7 @@ const DEFAULT_AARCH64_KERNEL_CONFIG: sel4::Config = sel4::Config {
2222 max_num_bootinfo_untypeds : 230 ,
2323 fan_out_limit : 256 ,
2424 hypervisor : true ,
25+ iommu : true ,
2526 benchmark : false ,
2627 num_cores : 1 ,
2728 fpu : true ,
@@ -46,6 +47,7 @@ const DEFAULT_X86_64_KERNEL_CONFIG: sel4::Config = sel4::Config {
4647 max_num_bootinfo_untypeds : 230 ,
4748 fan_out_limit : 256 ,
4849 hypervisor : true ,
50+ iommu : true ,
4951 benchmark : false ,
5052 num_cores : 1 ,
5153 fpu : true ,
@@ -707,6 +709,68 @@ mod protection_domain {
707709mod iommu {
708710 use super :: * ;
709711
712+ #[ test]
713+ fn test_iommu_missing_from_config ( ) {
714+ check_error (
715+ & sel4:: Config {
716+ iommu : false ,
717+ ..DEFAULT_X86_64_KERNEL_CONFIG
718+ } ,
719+ "iommu_missing_from_config.system" ,
720+ "Error: io address space requires seL4 to be built with IOMMU support: " ,
721+ ) ;
722+ }
723+
724+ #[ test]
725+ fn test_iommu_missing_from_aarch64_config ( ) {
726+ check_error (
727+ & sel4:: Config {
728+ iommu : false ,
729+ ..DEFAULT_AARCH64_KERNEL_CONFIG
730+ } ,
731+ "iommu_missing_from_config.system" ,
732+ "Error: io address space requires seL4 to be built with IOMMU support: " ,
733+ ) ;
734+ }
735+
736+ #[ test]
737+ fn test_iommu_missing_from_riscv64_config ( ) {
738+ check_error (
739+ & sel4:: Config {
740+ arch : sel4:: Arch :: Riscv64 ,
741+ iommu : false ,
742+ ..DEFAULT_AARCH64_KERNEL_CONFIG
743+ } ,
744+ "iommu_missing_from_config.system" ,
745+ "Error: io address space requires seL4 to be built with IOMMU support: " ,
746+ ) ;
747+ }
748+
749+ #[ test]
750+ fn test_iommu_unsupported_on_aarch64 ( ) {
751+ check_error (
752+ & sel4:: Config {
753+ iommu : true ,
754+ ..DEFAULT_AARCH64_KERNEL_CONFIG
755+ } ,
756+ "iommu_missing_from_config.system" ,
757+ "Error: failed to parse device peripheral_id '0:3.0': IOMMU device identifiers are not supported on AArch64 on element 'io_address_space':" ,
758+ ) ;
759+ }
760+
761+ #[ test]
762+ fn test_iommu_unsupported_on_riscv64 ( ) {
763+ check_error (
764+ & sel4:: Config {
765+ arch : sel4:: Arch :: Riscv64 ,
766+ iommu : true ,
767+ ..DEFAULT_AARCH64_KERNEL_CONFIG
768+ } ,
769+ "iommu_missing_from_config.system" ,
770+ "Error: failed to parse device peripheral_id '0:3.0': IOMMU device identifiers are not supported on RISC-V (64-bit) on element 'io_address_space':" ,
771+ ) ;
772+ }
773+
710774 #[ test]
711775 fn test_out_of_bound ( ) {
712776 check_error (
0 commit comments