feat(debugv8p9): test if EL3 has properly enabled FEAT_Debugv8p9

When FEAT_Debugv8p9 is not enabled, access to MDSELR_EL1
traps to EL3. Access to FEAT_DEBUGV8P9 control registers
must be explicitly enabled in EL3,

This testcase uses this behavior to test if
FEAT_Debugv8p9 is enabled or not.

Change-Id: I2f9a0158e9f38eaffac2e27c40d44d3c520d508d
Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
diff --git a/tftf/tests/extensions/debugv8p9/test_debugv8p9.c b/tftf/tests/extensions/debugv8p9/test_debugv8p9.c
new file mode 100644
index 0000000..033aedb
--- /dev/null
+++ b/tftf/tests/extensions/debugv8p9/test_debugv8p9.c
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2024, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <test_helpers.h>
+#include <tftf_lib.h>
+#include <debug.h>
+#include <arch_helpers.h>
+
+test_result_t test_debugv8p9_enabled(void)
+{
+	SKIP_TEST_IF_AARCH32();
+
+#if __aarch64__
+	SKIP_TEST_IF_DEBUGV8P9_NOT_SUPPORTED();
+
+	read_mdselr_el1();
+#endif
+	return TEST_RESULT_SUCCESS;
+}