Arvind Ram Prakash | 13887ac | 2024-01-04 15:22:52 -0600 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2024, Arm Limited. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <test_helpers.h> |
| 8 | #include <tftf_lib.h> |
| 9 | #include <tftf.h> |
| 10 | |
| 11 | /* EL3 is expected to allow access to MPAM system registers from EL2. |
| 12 | * Reading these registers will trap to EL3 and crash when EL3 has not |
| 13 | * allowed access. |
| 14 | */ |
| 15 | |
| 16 | test_result_t test_mpam_reg_access(void) |
| 17 | { |
| 18 | SKIP_TEST_IF_AARCH32(); |
| 19 | |
| 20 | #ifdef __aarch64__ |
| 21 | SKIP_TEST_IF_MPAM_NOT_SUPPORTED(); |
| 22 | |
| 23 | read_mpamidr_el1(); |
| 24 | read_mpam2_el2(); |
| 25 | |
| 26 | return TEST_RESULT_SUCCESS; |
| 27 | #endif |
| 28 | } |