Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 1 | /* |
Antonio Nino Diaz | 35b37f0 | 2018-01-08 17:33:34 +0000 | [diff] [blame] | 2 | * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <arch_helpers.h> |
| 8 | #include <assert.h> |
| 9 | #include <bl31.h> |
| 10 | #include <context_mgmt.h> |
| 11 | #include <debug.h> |
| 12 | #include <errno.h> |
Antonio Nino Diaz | 35b37f0 | 2018-01-08 17:33:34 +0000 | [diff] [blame] | 13 | #include <mm_svc.h> |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 14 | #include <platform.h> |
| 15 | #include <runtime_svc.h> |
| 16 | #include <secure_partition.h> |
Antonio Nino Diaz | 3c817f4 | 2018-03-21 10:49:27 +0000 | [diff] [blame] | 17 | #include <smccc.h> |
| 18 | #include <smccc_helpers.h> |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 19 | #include <spinlock.h> |
| 20 | #include <spm_svc.h> |
| 21 | #include <utils.h> |
| 22 | #include <xlat_tables_v2.h> |
| 23 | |
| 24 | #include "spm_private.h" |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 25 | |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 26 | /******************************************************************************* |
| 27 | * Secure Partition context information. |
| 28 | ******************************************************************************/ |
Antonio Nino Diaz | 2875931 | 2018-05-22 16:26:48 +0100 | [diff] [blame] | 29 | static sp_context_t sp_ctx; |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 30 | |
| 31 | /******************************************************************************* |
Antonio Nino Diaz | c4f2752 | 2018-05-23 09:09:41 +0100 | [diff] [blame] | 32 | * Set state of a Secure Partition context. |
| 33 | ******************************************************************************/ |
| 34 | void sp_state_set(sp_context_t *sp_ptr, sp_state_t state) |
| 35 | { |
| 36 | spin_lock(&(sp_ptr->state_lock)); |
| 37 | sp_ptr->state = state; |
| 38 | spin_unlock(&(sp_ptr->state_lock)); |
| 39 | } |
| 40 | |
| 41 | /******************************************************************************* |
| 42 | * Wait until the state of a Secure Partition is the specified one and change it |
| 43 | * to the desired state. |
| 44 | ******************************************************************************/ |
| 45 | void sp_state_wait_switch(sp_context_t *sp_ptr, sp_state_t from, sp_state_t to) |
| 46 | { |
| 47 | int success = 0; |
| 48 | |
| 49 | while (success == 0) { |
| 50 | spin_lock(&(sp_ptr->state_lock)); |
| 51 | |
| 52 | if (sp_ptr->state == from) { |
| 53 | sp_ptr->state = to; |
| 54 | |
| 55 | success = 1; |
| 56 | } |
| 57 | |
| 58 | spin_unlock(&(sp_ptr->state_lock)); |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | /******************************************************************************* |
| 63 | * Check if the state of a Secure Partition is the specified one and, if so, |
| 64 | * change it to the desired state. Returns 0 on success, -1 on error. |
| 65 | ******************************************************************************/ |
| 66 | int sp_state_try_switch(sp_context_t *sp_ptr, sp_state_t from, sp_state_t to) |
| 67 | { |
| 68 | int ret = -1; |
| 69 | |
| 70 | spin_lock(&(sp_ptr->state_lock)); |
| 71 | |
| 72 | if (sp_ptr->state == from) { |
| 73 | sp_ptr->state = to; |
| 74 | |
| 75 | ret = 0; |
| 76 | } |
| 77 | |
| 78 | spin_unlock(&(sp_ptr->state_lock)); |
| 79 | |
| 80 | return ret; |
| 81 | } |
| 82 | |
| 83 | /******************************************************************************* |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 84 | * This function takes an SP context pointer and prepares the CPU to enter. |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 85 | ******************************************************************************/ |
Antonio Nino Diaz | 2875931 | 2018-05-22 16:26:48 +0100 | [diff] [blame] | 86 | static void spm_sp_prepare_enter(sp_context_t *sp_ctx) |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 87 | { |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 88 | assert(sp_ctx != NULL); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 89 | |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 90 | /* Assign the context of the SP to this CPU */ |
| 91 | cm_set_context(&(sp_ctx->cpu_ctx), SECURE); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 92 | |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 93 | /* Restore the context assigned above */ |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 94 | cm_el1_sysregs_context_restore(SECURE); |
| 95 | cm_set_next_eret_context(SECURE); |
| 96 | |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 97 | /* Invalidate TLBs at EL1. */ |
| 98 | tlbivmalle1(); |
| 99 | dsbish(); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 100 | } |
| 101 | |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 102 | /******************************************************************************* |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 103 | * Enter SP after preparing it with spm_sp_prepare_enter(). |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 104 | ******************************************************************************/ |
Antonio Nino Diaz | 2875931 | 2018-05-22 16:26:48 +0100 | [diff] [blame] | 105 | static uint64_t spm_sp_enter(sp_context_t *sp_ctx) |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 106 | { |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 107 | /* Enter Secure Partition */ |
| 108 | return spm_secure_partition_enter(&sp_ctx->c_rt_ctx); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 109 | } |
| 110 | |
| 111 | /******************************************************************************* |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 112 | * Jump to each Secure Partition for the first time. |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 113 | ******************************************************************************/ |
Antonio Nino Diaz | e881147 | 2018-04-17 15:10:18 +0100 | [diff] [blame] | 114 | static int32_t spm_init(void) |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 115 | { |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 116 | uint64_t rc = 0; |
Antonio Nino Diaz | 2875931 | 2018-05-22 16:26:48 +0100 | [diff] [blame] | 117 | sp_context_t *ctx; |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 118 | |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 119 | INFO("Secure Partition init...\n"); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 120 | |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 121 | ctx = &sp_ctx; |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 122 | |
Antonio Nino Diaz | c4f2752 | 2018-05-23 09:09:41 +0100 | [diff] [blame] | 123 | ctx->state = SP_STATE_RESET; |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 124 | |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 125 | spm_sp_prepare_enter(ctx); |
| 126 | rc |= spm_sp_enter(ctx); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 127 | assert(rc == 0); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 128 | |
Antonio Nino Diaz | c4f2752 | 2018-05-23 09:09:41 +0100 | [diff] [blame] | 129 | ctx->state = SP_STATE_IDLE; |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 130 | |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 131 | INFO("Secure Partition initialized.\n"); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 132 | |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 133 | return rc; |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 134 | } |
| 135 | |
| 136 | /******************************************************************************* |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 137 | * Initialize contexts of all Secure Partitions. |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 138 | ******************************************************************************/ |
| 139 | int32_t spm_setup(void) |
| 140 | { |
Antonio Nino Diaz | 2875931 | 2018-05-22 16:26:48 +0100 | [diff] [blame] | 141 | sp_context_t *ctx; |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 142 | |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 143 | /* Disable MMU at EL1 (initialized by BL2) */ |
| 144 | disable_mmu_icache_el1(); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 145 | |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 146 | /* Initialize context of the SP */ |
| 147 | INFO("Secure Partition context setup start...\n"); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 148 | |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 149 | ctx = &sp_ctx; |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 150 | |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 151 | /* Assign translation tables context. */ |
| 152 | ctx->xlat_ctx_handle = spm_get_sp_xlat_context(); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 153 | |
Antonio Nino Diaz | 2875931 | 2018-05-22 16:26:48 +0100 | [diff] [blame] | 154 | spm_sp_setup(ctx); |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 155 | |
| 156 | /* Register init function for deferred init. */ |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 157 | bl31_register_bl32_init(&spm_init); |
| 158 | |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 159 | INFO("Secure Partition setup done.\n"); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 160 | |
| 161 | return 0; |
| 162 | } |
| 163 | |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 164 | /******************************************************************************* |
Antonio Nino Diaz | fbd7f50 | 2018-05-23 11:49:16 +0100 | [diff] [blame] | 165 | * MM_COMMUNICATE handler |
| 166 | ******************************************************************************/ |
| 167 | static uint64_t mm_communicate(uint32_t smc_fid, uint64_t mm_cookie, |
| 168 | uint64_t comm_buffer_address, |
| 169 | uint64_t comm_size_address, void *handle) |
| 170 | { |
| 171 | sp_context_t *ctx = &sp_ctx; |
| 172 | |
| 173 | /* Cookie. Reserved for future use. It must be zero. */ |
| 174 | if (mm_cookie != 0U) { |
| 175 | ERROR("MM_COMMUNICATE: cookie is not zero\n"); |
| 176 | SMC_RET1(handle, SPM_INVALID_PARAMETER); |
| 177 | } |
| 178 | |
| 179 | if (comm_buffer_address == 0U) { |
| 180 | ERROR("MM_COMMUNICATE: comm_buffer_address is zero\n"); |
| 181 | SMC_RET1(handle, SPM_INVALID_PARAMETER); |
| 182 | } |
| 183 | |
| 184 | if (comm_size_address != 0U) { |
| 185 | VERBOSE("MM_COMMUNICATE: comm_size_address is not 0 as recommended.\n"); |
| 186 | } |
| 187 | |
| 188 | /* Save the Normal world context */ |
| 189 | cm_el1_sysregs_context_save(NON_SECURE); |
| 190 | |
| 191 | /* Wait until the Secure Partition is IDLE and set it to BUSY. */ |
| 192 | sp_state_wait_switch(ctx, SP_STATE_IDLE, SP_STATE_BUSY); |
| 193 | |
| 194 | /* Jump to the Secure Partition. */ |
| 195 | spm_sp_prepare_enter(ctx); |
| 196 | |
| 197 | SMC_RET4(&(ctx->cpu_ctx), smc_fid, comm_buffer_address, |
| 198 | comm_size_address, plat_my_core_pos()); |
| 199 | } |
| 200 | |
| 201 | /******************************************************************************* |
| 202 | * SP_EVENT_COMPLETE_AARCH64 handler |
| 203 | ******************************************************************************/ |
| 204 | static uint64_t sp_event_complete(uint64_t x1) |
| 205 | { |
| 206 | sp_context_t *ctx = &sp_ctx; |
| 207 | |
| 208 | /* Save secure state */ |
| 209 | cm_el1_sysregs_context_save(SECURE); |
| 210 | |
| 211 | if (ctx->state == SP_STATE_RESET) { |
| 212 | /* |
| 213 | * SPM reports completion. The SPM must have initiated the |
| 214 | * original request through a synchronous entry into the secure |
| 215 | * partition. Jump back to the original C runtime context. |
| 216 | */ |
| 217 | spm_secure_partition_exit(ctx->c_rt_ctx, x1); |
| 218 | |
| 219 | /* spm_secure_partition_exit doesn't return */ |
| 220 | } |
| 221 | |
| 222 | /* |
| 223 | * This is the result from the Secure partition of an earlier request. |
| 224 | * Copy the result into the non-secure context and return to the |
| 225 | * non-secure state. |
| 226 | */ |
| 227 | |
| 228 | /* Mark Secure Partition as idle */ |
| 229 | assert(ctx->state == SP_STATE_BUSY); |
| 230 | |
| 231 | sp_state_set(ctx, SP_STATE_IDLE); |
| 232 | |
| 233 | /* Get a reference to the non-secure context */ |
| 234 | cpu_context_t *ns_cpu_context = cm_get_context(NON_SECURE); |
| 235 | |
| 236 | assert(ns_cpu_context != NULL); |
| 237 | |
| 238 | /* Restore non-secure state */ |
| 239 | cm_el1_sysregs_context_restore(NON_SECURE); |
| 240 | cm_set_next_eret_context(NON_SECURE); |
| 241 | |
| 242 | /* Return to non-secure world */ |
| 243 | SMC_RET1(ns_cpu_context, x1); |
| 244 | } |
| 245 | |
| 246 | /******************************************************************************* |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 247 | * Secure Partition Manager SMC handler. |
| 248 | ******************************************************************************/ |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 249 | uint64_t spm_smc_handler(uint32_t smc_fid, |
| 250 | uint64_t x1, |
| 251 | uint64_t x2, |
| 252 | uint64_t x3, |
| 253 | uint64_t x4, |
| 254 | void *cookie, |
| 255 | void *handle, |
| 256 | uint64_t flags) |
| 257 | { |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 258 | unsigned int ns; |
| 259 | |
| 260 | /* Determine which security state this SMC originated from */ |
| 261 | ns = is_caller_non_secure(flags); |
| 262 | |
| 263 | if (ns == SMC_FROM_SECURE) { |
| 264 | |
| 265 | /* Handle SMCs from Secure world. */ |
| 266 | |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 267 | assert(handle == cm_get_context(SECURE)); |
| 268 | |
| 269 | /* Make next ERET jump to S-EL0 instead of S-EL1. */ |
| 270 | cm_set_elr_spsr_el3(SECURE, read_elr_el1(), read_spsr_el1()); |
| 271 | |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 272 | switch (smc_fid) { |
| 273 | |
Sandrine Bailleux | 843d3f0 | 2017-12-07 09:48:56 +0000 | [diff] [blame] | 274 | case SPM_VERSION_AARCH32: |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 275 | SMC_RET1(handle, SPM_VERSION_COMPILED); |
| 276 | |
| 277 | case SP_EVENT_COMPLETE_AARCH64: |
Antonio Nino Diaz | fbd7f50 | 2018-05-23 11:49:16 +0100 | [diff] [blame] | 278 | return sp_event_complete(x1); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 279 | |
Antonio Nino Diaz | 837173f | 2017-12-01 14:12:43 +0000 | [diff] [blame] | 280 | case SP_MEMORY_ATTRIBUTES_GET_AARCH64: |
| 281 | INFO("Received SP_MEMORY_ATTRIBUTES_GET_AARCH64 SMC\n"); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 282 | |
Antonio Nino Diaz | c4f2752 | 2018-05-23 09:09:41 +0100 | [diff] [blame] | 283 | if (sp_ctx.state != SP_STATE_RESET) { |
Antonio Nino Diaz | 837173f | 2017-12-01 14:12:43 +0000 | [diff] [blame] | 284 | WARN("SP_MEMORY_ATTRIBUTES_GET_AARCH64 is available at boot time only\n"); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 285 | SMC_RET1(handle, SPM_NOT_SUPPORTED); |
| 286 | } |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 287 | SMC_RET1(handle, |
| 288 | spm_memory_attributes_get_smc_handler( |
| 289 | &sp_ctx, x1)); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 290 | |
Antonio Nino Diaz | 837173f | 2017-12-01 14:12:43 +0000 | [diff] [blame] | 291 | case SP_MEMORY_ATTRIBUTES_SET_AARCH64: |
| 292 | INFO("Received SP_MEMORY_ATTRIBUTES_SET_AARCH64 SMC\n"); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 293 | |
Antonio Nino Diaz | c4f2752 | 2018-05-23 09:09:41 +0100 | [diff] [blame] | 294 | if (sp_ctx.state != SP_STATE_RESET) { |
Antonio Nino Diaz | 837173f | 2017-12-01 14:12:43 +0000 | [diff] [blame] | 295 | WARN("SP_MEMORY_ATTRIBUTES_SET_AARCH64 is available at boot time only\n"); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 296 | SMC_RET1(handle, SPM_NOT_SUPPORTED); |
| 297 | } |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 298 | SMC_RET1(handle, |
| 299 | spm_memory_attributes_set_smc_handler( |
| 300 | &sp_ctx, x1, x2, x3)); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 301 | default: |
| 302 | break; |
| 303 | } |
| 304 | } else { |
| 305 | |
| 306 | /* Handle SMCs from Non-secure world. */ |
| 307 | |
| 308 | switch (smc_fid) { |
| 309 | |
Antonio Nino Diaz | 35b37f0 | 2018-01-08 17:33:34 +0000 | [diff] [blame] | 310 | case MM_VERSION_AARCH32: |
| 311 | SMC_RET1(handle, MM_VERSION_COMPILED); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 312 | |
Sandrine Bailleux | b31ee6b | 2017-12-01 09:44:21 +0000 | [diff] [blame] | 313 | case MM_COMMUNICATE_AARCH32: |
| 314 | case MM_COMMUNICATE_AARCH64: |
Antonio Nino Diaz | fbd7f50 | 2018-05-23 11:49:16 +0100 | [diff] [blame] | 315 | return mm_communicate(smc_fid, x1, x2, x3, handle); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 316 | |
Antonio Nino Diaz | 837173f | 2017-12-01 14:12:43 +0000 | [diff] [blame] | 317 | case SP_MEMORY_ATTRIBUTES_GET_AARCH64: |
| 318 | case SP_MEMORY_ATTRIBUTES_SET_AARCH64: |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 319 | /* SMC interfaces reserved for secure callers. */ |
| 320 | SMC_RET1(handle, SPM_NOT_SUPPORTED); |
| 321 | |
| 322 | default: |
| 323 | break; |
| 324 | } |
| 325 | } |
| 326 | |
| 327 | SMC_RET1(handle, SMC_UNK); |
| 328 | } |