blob: eeb967db86d2342e2844a7a477b3cb341b390133 [file] [log] [blame]
Manish V Badarkhe2c518e52021-07-08 16:36:57 +01001/*
2 * Copyright (c) 2021, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <string.h>
8
9#include <test_helpers.h>
10#include <tftf_lib.h>
11#include <tftf.h>
12
13/*
14 * EL3 is expected to allow access to trace filter control registers from EL2.
15 * Reading these register will trap to EL3 and crash when EL3 has not
16 * allowed access.
17 */
18test_result_t test_trf_enabled(void)
19{
20 SKIP_TEST_IF_TRF_NOT_SUPPORTED();
21
22#ifdef __aarch64__
23 read_trfcr_el1();
24 read_trfcr_el2();
25#else
26 read_htrfcr();
27 read_trfcr();
28#endif /* __aarch64__ */
29
30 return TEST_RESULT_SUCCESS;
31}