Javier Almansa Sobrino | 82cd82e | 2025-01-17 17:37:42 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2025, Arm Limited. All rights reserved. |
| 3 | * SPDX-License-Identifier: BSD-3-Clause |
| 4 | */ |
| 5 | |
| 6 | #include <arch.h> |
| 7 | #include <arch_helpers.h> |
| 8 | #include <sync.h> |
| 9 | #include <realm_helpers.h> |
| 10 | |
| 11 | /* Check if Realm gets undefined abort when it access MPAM registers */ |
| 12 | bool test_realm_mpam_undef_abort(void) |
| 13 | { |
| 14 | realm_reset_undef_abort_count(); |
| 15 | |
| 16 | /* Install exception handler to catch undefined abort */ |
| 17 | register_custom_sync_exception_handler(realm_sync_exception_handler); |
| 18 | write_mpam0_el1(0UL); |
| 19 | unregister_custom_sync_exception_handler(); |
| 20 | |
| 21 | return (realm_get_undef_abort_count() != 0UL); |
| 22 | } |