aboutsummaryrefslogtreecommitdiff
path: root/tftf/tests/extensions/trf/test_trf.c
blob: eeb967db86d2342e2844a7a477b3cb341b390133 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
 * Copyright (c) 2021, Arm Limited. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <string.h>

#include <test_helpers.h>
#include <tftf_lib.h>
#include <tftf.h>

/*
 * EL3 is expected to allow access to trace filter control registers from EL2.
 * Reading these register will trap to EL3 and crash when EL3 has not
 * allowed access.
 */
test_result_t test_trf_enabled(void)
{
	SKIP_TEST_IF_TRF_NOT_SUPPORTED();

#ifdef __aarch64__
	read_trfcr_el1();
	read_trfcr_el2();
#else
	read_htrfcr();
	read_trfcr();
#endif /* __aarch64__ */

	return TEST_RESULT_SUCCESS;
}