blob: f2c244a3266c9b11731aa930578168e50c8bbfe8 [file] [log] [blame]
johpow018c3da8b2022-01-31 18:14:41 -06001/*
2 * Copyright (c) 2022, 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 branch record buffer control registers
15 * from NS world. Accessing these registers will trap to EL3 and crash when EL3
16 * has not properly enabled it.
17 */
18test_result_t test_brbe_enabled(void)
19{
20 SKIP_TEST_IF_AARCH32();
21
22#ifdef __aarch64__
23 SKIP_TEST_IF_BRBE_NOT_SUPPORTED();
24
25 read_brbcr_el1();
26 read_brbcr_el2();
27 read_brbfcr_el1();
28 read_brbts_el1();
29 read_brbinfinj_el1();
30 read_brbsrcinj_el1();
31 read_brbtgtinj_el1();
32 read_brbidr0_el1();
33
34 return TEST_RESULT_SUCCESS;
35#endif /* __aarch64__ */
36}