Manish V Badarkhe | 87c03d1 | 2021-07-06 22:57:11 +0100 | [diff] [blame^] | 1 | /* |
| 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 control registers from EL2. |
| 15 | * Reading these register will trap to EL3 and crash when EL3 has not |
| 16 | * allowed access. |
| 17 | */ |
| 18 | test_result_t test_trbe_enabled(void) |
| 19 | { |
| 20 | SKIP_TEST_IF_AARCH32(); |
| 21 | |
| 22 | #ifdef __aarch64__ |
| 23 | SKIP_TEST_IF_TRBE_NOT_SUPPORTED(); |
| 24 | read_trblimitr_el1(); |
| 25 | read_trbptr_el1(); |
| 26 | read_trbbaser_el1(); |
| 27 | read_trbsr_el1(); |
| 28 | read_trbmar_el1(); |
| 29 | read_trbtrg_el1(); |
| 30 | read_trbidr_el1(); |
| 31 | return TEST_RESULT_SUCCESS; |
| 32 | #endif /* __aarch64__ */ |
| 33 | } |