blob: bc6002748b2edd0a91ca93fcba68c72a4f319583 [file] [log] [blame]
# Copyright 2018 The Hafnium Authors.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/BSD-3-Clause.
import("//build/image/image.gni")
import("//test/hftest/args.gni")
config("config") {
include_dirs = [ "inc" ]
}
source_set("primary_with_secondaries") {
testonly = true
public_configs = [
":config",
"//src/arch/aarch64:config",
]
sources = [ "primary_with_secondaries.c" ]
deps = [ "//test/vmapi/common:ffa" ]
}
# Tests with secondary VMs.
vm_kernel("primary_with_secondaries_no_fdt_vm") {
testonly = true
public_configs = [
":config",
"//src/arch/aarch64:config",
]
sources = [ "no_fdt.c" ]
deps = [
"//src/arch/aarch64/hftest:registers",
"//test/hftest:hftest_primary_vm",
"//test/vmapi/common:ffa",
"//test/vmapi/common/arch/aarch64:exception_handler",
"//vmlib",
]
}
vm_kernel("secondary_vm_no_fdt") {
testonly = true
sources = [ "no_fdt_secondary.c" ]
deps = [ "//test/hftest:hftest_secondary_vm_no_fdt" ]
}
manifest("primary_with_secondaries_no_fdt_manifest") {
source = "manifest_no_fdt.dts"
output = "manifest_no_fdt.dtb"
overlay = hftest_manifest_overlay
}
initrd("primary_with_secondaries_no_fdt") {
testonly = true
files = [
[
"manifest.dtb",
":primary_with_secondaries_no_fdt_manifest",
"manifest_no_fdt.dtb",
],
[
"primary_with_secondaries_no_fdt",
":primary_with_secondaries_no_fdt_vm",
"primary_with_secondaries_no_fdt_vm.bin",
],
[
"secondary_vm_no_fdt",
":secondary_vm_no_fdt",
"secondary_vm_no_fdt.bin",
],
]
}
vm_kernel("primary_with_secondaries_test_vm") {
testonly = true
public_configs = [
":config",
"//src/arch/aarch64:config",
]
sources = [
"boot.c",
"debug_el1.c",
"dir_msg.c",
"ffa.c",
"floating_point.c",
"indirect_messaging.c",
"interrupts.c",
"memory_sharing.c",
"no_services.c",
"perfmon.c",
"run_race.c",
"smp.c",
"sysregs.c",
"unmapped.c",
]
deps = [
":primary_with_secondaries",
"//src/arch/aarch64/hftest:registers",
"//test/hftest:hftest_primary_vm",
"//test/vmapi/common:ffa",
"//test/vmapi/common/arch/aarch64:exception_handler",
"//vmlib",
]
}
manifest("primary_with_secondaries_test_manifest") {
source = "manifest.dts"
output = "manifest.dtb"
overlay = hftest_manifest_overlay
}
device_tree("service1_dtb") {
source = "service1.dts"
output = "$target_out_dir/service1.dtb"
}
device_tree("service2_dtb") {
source = "service2.dts"
output = "$target_out_dir/service2.dtb"
}
device_tree("service3_dtb") {
source = "service3.dts"
output = "$target_out_dir/service3.dtb"
}
initrd("primary_with_secondaries_test") {
testonly = true
files = [
[
"manifest.dtb",
":primary_with_secondaries_test_manifest",
"manifest.dtb",
],
[
"primary_with_secondaries_test",
":primary_with_secondaries_test_vm",
"primary_with_secondaries_test_vm.bin",
],
[
"services1",
"services:service_vm1",
"service_vm1.bin",
],
[
"services2",
"services:service_vm2",
"service_vm2.bin",
],
[
"services3",
"services:service_vm3",
"service_vm3.bin",
],
[
"service1.dtb",
":service1_dtb",
"service1.dtb",
],
[
"service2.dtb",
":service2_dtb",
"service2.dtb",
],
[
"service3.dtb",
":service3_dtb",
"service3.dtb",
],
]
}
vm_kernel("primary_with_secondaries_el0_test_vm") {
testonly = true
public_configs = [
":config",
"//src/arch/${plat_arch}:config",
]
sources = [
"boot.c",
"el0_interrupts.c",
"ffa.c",
"memory_sharing.c",
]
deps = [
":primary_with_secondaries",
"//src/arch/aarch64/hftest:registers",
"//test/hftest:hftest_primary_vm",
"//test/vmapi/common:ffa",
"//test/vmapi/common/arch/aarch64:exception_handler",
"//vmlib",
]
}
manifest("primary_with_secondaries_el0_test_manifest") {
source = "manifest_el0_vms.dts"
output = "manifest_el0_vms.dtb"
overlay = hftest_manifest_overlay
}
device_tree("service1_el0_dtb") {
source = "services/arch/aarch64/el0/service1.dts"
output = "$target_out_dir/service1_el0.dtb"
}
device_tree("service2_el0_dtb") {
source = "services/arch/aarch64/el0/service2.dts"
output = "$target_out_dir/service2_el0.dtb"
}
device_tree("service3_el0_dtb") {
source = "services/arch/aarch64/el0/service3.dts"
output = "$target_out_dir/service3_el0.dtb"
}
initrd("primary_with_secondaries_el0_test") {
testonly = true
files = [
[
"manifest.dtb",
":primary_with_secondaries_el0_test_manifest",
"manifest_el0_vms.dtb",
],
[
"primary_with_secondaries_el0",
":primary_with_secondaries_el0_test_vm",
"primary_with_secondaries_el0_test_vm.bin",
],
[
"services1_el0",
"services/arch/aarch64/el0:service_el0_vm1",
"service_el0_vm1.bin",
],
[
"services2_el0",
"services/arch/aarch64/el0:service_el0_vm2",
"service_el0_vm2.bin",
],
[
"services3_el0",
"services/arch/aarch64/el0:service_el0_vm3",
"service_el0_vm3.bin",
],
[
"service1_el0.dtb",
":service1_el0_dtb",
"service1_el0.dtb",
],
[
"service2_el0.dtb",
":service2_el0_dtb",
"service2_el0.dtb",
],
[
"service3_el0.dtb",
":service3_el0_dtb",
"service3_el0.dtb",
],
]
}
vm_kernel("primary_with_sp_test_vm") {
testonly = true
public_configs = [
":config",
"//src/arch/aarch64:config",
]
sources = [
"boot.c",
"dir_msg.c",
"indirect_messaging.c",
"memory_sharing.c",
"secure_interrupts.c",
"smccc.c",
]
deps = [
":primary_with_secondaries",
"//src/arch/${plat_arch}/hftest:registers",
"//test/hftest:hftest_primary_vm",
"//test/vmapi/common:ffa",
"//test/vmapi/common/arch/aarch64:exception_handler",
"//vmlib",
]
}
manifest("primary_with_sp_manifest") {
source = "partition_manifest_nwd_primary.dts"
output = "partition_manifest_nwd_primary.dtb"
}
partition_package("primary_with_sp_test_package") {
testonly = true
pm_offset = "0x1000"
img_offset = "0x2000"
files = [ [
"partition_manifest_nwd_primary.dtb",
"primary_with_sp_test_vm.bin",
":primary_with_sp_manifest",
":primary_with_sp_test_vm",
] ]
output = "primary_with_sp_test_package.img"
}
partitions_json("primary_with_sp") {
testonly = true
sps = [
[
"service_sp1_partition_package.img",
"services/arch/aarch64/secure/manifest_secure_service1.dts",
"services/arch/aarch64/secure:service_sp1_partition_package",
"services/arch/aarch64/secure:partition_manifest_service_sp1",
],
[
"service_sp2_partition_package.img",
"services/arch/aarch64/secure/manifest_secure_service2.dts",
"services/arch/aarch64/secure:service_sp2_partition_package",
"services/arch/aarch64/secure:partition_manifest_service_sp2",
],
[
"service_sp3_partition_package.img",
"services/arch/aarch64/secure/manifest_secure_service3.dts",
"services/arch/aarch64/secure:service_sp3_partition_package",
"services/arch/aarch64/secure:partition_manifest_service_sp3",
],
[
"service_sp4_partition_package.img",
"services/arch/aarch64/secure/manifest_secure_service4.dts",
"services/arch/aarch64/secure:service_sp4_partition_package",
"services/arch/aarch64/secure:partition_manifest_service_sp4",
],
]
vms = [ [
"primary_with_sp_test_package.img",
"manifest_vm_sp.dts",
":primary_with_sp_test_package",
":primary_with_sp_manifest",
] ]
json_file = "primary_with_sp.json"
}
# The primary VM target links together all test suites.
# Defining a new primary VM for the VHE enabled setup below,
# because the level of support of certain features might differ for S-EL0 and
# S-EL1 partitions.
# A test suite is expected to be fully functional with S-EL0 partitions when
# adding the respective source file to the 'sources' field of the target below.
vm_kernel("primary_with_sp_vhe_test_vm") {
testonly = true
public_configs = [
":config",
"//src/arch/aarch64:config",
]
sources = [
"dir_msg.c",
"free_sp_resources.c",
"indirect_messaging.c",
"memory_permissions.c",
"memory_sharing.c",
"secure_interrupts.c",
]
deps = [
":primary_with_secondaries",
"//src/arch/${plat_arch}/hftest:registers",
"//test/hftest:hftest_primary_vm",
"//test/vmapi/common:ffa",
"//test/vmapi/common/arch/aarch64:exception_handler",
"//vmlib",
]
}
partition_package("primary_with_sp_vhe_test_package") {
testonly = true
pm_offset = "0x1000"
img_offset = "0x2000"
files = [ [
"partition_manifest_nwd_primary.dtb",
"primary_with_sp_vhe_test_vm.bin",
":primary_with_sp_manifest",
":primary_with_sp_vhe_test_vm",
] ]
output = "primary_with_sp_vhe_test_package.img"
}
partitions_json("primary_with_sp_vhe") {
testonly = true
sps = [
[
"service_sp1_partition_package.img",
"services/arch/aarch64/secure/el0/manifest_secure_service1.dts",
"services/arch/aarch64/secure/el0:service_sp1_partition_package",
"services/arch/aarch64/secure/el0:partition_manifest_service_sp1",
],
[
"service_sp2_partition_package.img",
"services/arch/aarch64/secure/el0/manifest_secure_service2.dts",
"services/arch/aarch64/secure/el0:service_sp2_partition_package",
"services/arch/aarch64/secure/el0:partition_manifest_service_sp2",
],
[
"service_sp3_partition_package.img",
"services/arch/aarch64/secure/manifest_secure_service3.dts",
"services/arch/aarch64/secure:service_sp3_partition_package",
"services/arch/aarch64/secure:partition_manifest_service_sp3",
],
[
"service_sp4_partition_package.img",
"services/arch/aarch64/secure/manifest_secure_service4.dts",
"services/arch/aarch64/secure:service_sp4_partition_package",
"services/arch/aarch64/secure:partition_manifest_service_sp4",
],
]
vms = [ [
"primary_with_sp_vhe_test_package.img",
"manifest_vm_sp.dts",
":primary_with_sp_vhe_test_package",
":primary_with_sp_manifest",
] ]
json_file = "primary_with_sp_vhe.json"
}