aboutsummaryrefslogtreecommitdiff
path: root/tftf
diff options
context:
space:
mode:
authorMark Dykes <mark.dykes@arm.com>2020-06-03 15:46:55 -0500
committerManish Pandey <manish.pandey2@arm.com>2020-10-19 11:22:34 +0000
commite7810b57c8e671f3b10f7dc901ac3712109564e9 (patch)
tree971eaeeae533ac6d4605bb26948c1d641e8a7a06 /tftf
parent12c20464817a98348b06069c75a3cfe4dbc6f85d (diff)
downloadtf-a-tests-e7810b57c8e671f3b10f7dc901ac3712109564e9.tar.gz
SMC fuzzing module integration.
This includes one test with one seed as the initial implementation. A future upgrade will include an enhanced seeding strategy. The patch includes an example device tree file with the actual test (sdei.dts) leveraging the SDEI functions that can be called without reference to system state. Platform CI will have a single TFTF config to be used in all future testing. Once both branches of TFA tests and platform CI are checked in a user can invoke the testing with: workspace=<workspace location> test_groups=fvp-aarch64-sdei,fvp-smcfuzzing:fvp-tftf-fip.tftf-aemv8a test_run=1 bin_mode=debug retain_paths=1 ./platform-ci/script/run_local_ci.sh Signed-off-by: Mark Dykes <mark.dykes@arm.com> Change-Id: Ic290e7255bcfd845c0d22037e0b670a6691541df
Diffstat (limited to 'tftf')
-rw-r--r--tftf/framework/framework.mk6
-rw-r--r--tftf/framework/tftf.ld.S10
-rw-r--r--tftf/tests/tests-smcfuzzing.mk12
-rw-r--r--tftf/tests/tests-smcfuzzing.xml15
4 files changed, 40 insertions, 3 deletions
diff --git a/tftf/framework/framework.mk b/tftf/framework/framework.mk
index 34601c2d..4ca1d425 100644
--- a/tftf/framework/framework.mk
+++ b/tftf/framework/framework.mk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2018-2019, Arm Limited. All rights reserved.
+# Copyright (c) 2018-2020, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -8,6 +8,7 @@ AUTOGEN_DIR := $(BUILD_PLAT)/autogen
include lib/xlat_tables_v2/xlat_tables.mk
include lib/compiler-rt/compiler-rt.mk
+include lib/libfdt/libfdt.mk
TFTF_INCLUDES := \
-I${AUTOGEN_DIR} \
@@ -26,7 +27,8 @@ TFTF_INCLUDES := \
-Iinclude/runtime_services/secure_el1_payloads \
-Ispm/cactus \
-Ispm/ivy \
- -Ispm/quark
+ -Ispm/quark \
+ -Ismc_fuzz/include
FRAMEWORK_SOURCES := ${AUTOGEN_DIR}/tests_list.c
diff --git a/tftf/framework/tftf.ld.S b/tftf/framework/tftf.ld.S
index 364753fe..9374206f 100644
--- a/tftf/framework/tftf.ld.S
+++ b/tftf/framework/tftf.ld.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Arm Limited. All rights reserved.
+ * Copyright (c) 2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -75,6 +75,14 @@ SECTIONS
} >RAM
/*
+ * The SMC fuzzing module requires alignment due to malloc
+ * constraints. Also size must be at least around 64K
+ */
+ smcfuzz (NOLOAD) : {
+ *(smcfuzz)
+ } >RAM
+
+ /*
* The base address of the coherent memory section must be page-aligned (4K)
* to guarantee that the coherent data are stored on their own pages and
* are not mixed with normal data. This is required to set up the correct
diff --git a/tftf/tests/tests-smcfuzzing.mk b/tftf/tests/tests-smcfuzzing.mk
new file mode 100644
index 00000000..82b6a7c8
--- /dev/null
+++ b/tftf/tests/tests-smcfuzzing.mk
@@ -0,0 +1,12 @@
+#
+# Copyright (c) 2020, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+TESTS_SOURCES += \
+ $(addprefix smc_fuzz/src/, \
+ randsmcmod.c \
+ smcmalloc.c \
+ fifo3d.c \
+ )
diff --git a/tftf/tests/tests-smcfuzzing.xml b/tftf/tests/tests-smcfuzzing.xml
new file mode 100644
index 00000000..c549e478
--- /dev/null
+++ b/tftf/tests/tests-smcfuzzing.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright (c) 2020, Arm Limited. All rights reserved.
+
+ SPDX-License-Identifier: BSD-3-Clause
+-->
+
+<testsuites>
+
+ <testsuite name="smcfuzzing" description="smcfuzzing test framework">
+ <testcase name="SMC fuzzing top level function" function="smc_fuzzing_top" />
+ </testsuite>
+
+</testsuites>