Aarch32: Secure PMU counter leak tests

This patch adds Aarch32 support to the PMU counter leak tests.

These tests attempt to profile the Secure world by configuring
EL0 system registers such that the PMU is told to increment
counters at Secure EL1, Secure EL2 and EL3. The tests fail if
useful information was leaked.

The Secure world defends against this type of attack with a
combination of configuring EL3 system registers and saving/restoring
EL0 PMU registers. Exactly which defense is employed depends on the
architecture version.

Signed-off-by: Petre-Ionut Tudor <petre-ionut.tudor@arm.com>
Change-Id: I2dcc9e786a18d9859ac089f8008b060d277bee3a
diff --git a/include/common/test_helpers.h b/include/common/test_helpers.h
index 77cf7fd..205d203 100644
--- a/include/common/test_helpers.h
+++ b/include/common/test_helpers.h
@@ -166,13 +166,12 @@
 
 #define SKIP_TEST_IF_ARCH_DEBUG_VERSION_LESS_THAN(version)			\
 	do {									\
-		uint32_t debug_ver = read_id_aa64dfr0_el1() &			\
-			(ID_AA64DFR0_DEBUG_MASK << ID_AA64DFR0_DEBUG_SHIFT);	\
+		uint32_t debug_ver = arch_get_debug_version();			\
 										\
-		if ((debug_ver >> ID_AA64DFR0_DEBUG_SHIFT) < version) {		\
+		if (debug_ver < version) {					\
 			tftf_testcase_printf("Debug version returned %d\n"	\
 					     "The required version is %d\n",	\
-					     debug_ver >> ID_AA64DFR0_DEBUG_SHIFT,\
+					     debug_ver,				\
 					     version);				\
 			return TEST_RESULT_SKIPPED;				\
 		}								\