Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 1 | /* |
| 2 | * SPDX-License-Identifier: BSD-3-Clause |
| 3 | * SPDX-FileCopyrightText: Copyright TF-RMM Contributors. |
| 4 | */ |
| 5 | |
| 6 | #ifndef RUN_H |
| 7 | #define RUN_H |
| 8 | |
AlexeiFedorov | f72ab30 | 2023-04-27 16:45:04 +0100 | [diff] [blame] | 9 | struct granule; |
AlexeiFedorov | ec35c54 | 2023-04-27 17:52:02 +0100 | [diff] [blame^] | 10 | struct rec; |
AlexeiFedorov | f72ab30 | 2023-04-27 16:45:04 +0100 | [diff] [blame] | 11 | struct rec_aux_data; |
| 12 | |
| 13 | void init_rec_aux_data(struct rec_aux_data *aux_data, void *rec_aux, |
| 14 | unsigned long num_aux); |
| 15 | void *map_rec_aux(struct granule *rec_aux_pages[], unsigned long num_aux); |
| 16 | void unmap_rec_aux(void *rec_aux, unsigned long num_aux); |
Arunachalam Ganapathy | f649121 | 2023-02-23 16:04:34 +0000 | [diff] [blame] | 17 | |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 18 | /* |
| 19 | * Function to enter Realm with `regs` pointing to GP Regs to be |
| 20 | * restored/saved when entering/exiting the Realm. This function |
| 21 | * returns with the Realm exception code which is populated by |
| 22 | * Realm_exit() on aarch64. |
| 23 | */ |
| 24 | int run_realm(unsigned long *regs); |
| 25 | |
Arunachalam Ganapathy | f649121 | 2023-02-23 16:04:34 +0000 | [diff] [blame] | 26 | /* |
| 27 | * Configure CPTR_EL2 register to not trap FPU or SVE access for Realm and |
| 28 | * restore the saved SIMD state from memory to registers. |
| 29 | */ |
| 30 | void rec_simd_enable_restore(struct rec *rec); |
| 31 | |
Arunachalam Ganapathy | 5111993 | 2023-03-23 12:32:49 +0000 | [diff] [blame] | 32 | /* |
| 33 | * Save the current SIMD state from registers to memory and configure CPTR_EL2 |
| 34 | * register to trap FPU or SVE access for Realm. |
| 35 | */ |
| 36 | void rec_simd_save_disable(struct rec *rec); |
| 37 | |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 38 | #endif /* RUN_H */ |