@@ -275,13 +275,11 @@ static void optee_enable_shm_cache(struct optee *optee)
275
275
}
276
276
277
277
/**
278
- * __optee_disable_shm_cache () - Disables caching of some shared memory
279
- * allocation in OP-TEE
278
+ * optee_disable_shm_cache () - Disables caching of some shared memory allocation
279
+ * in OP-TEE
280
280
* @optee: main service struct
281
- * @is_mapped: true if the cached shared memory addresses were mapped by this
282
- * kernel, are safe to dereference, and should be freed
283
281
*/
284
- static void __optee_disable_shm_cache (struct optee * optee , bool is_mapped )
282
+ void optee_disable_shm_cache (struct optee * optee )
285
283
{
286
284
struct optee_call_waiter w ;
287
285
@@ -300,13 +298,6 @@ static void __optee_disable_shm_cache(struct optee *optee, bool is_mapped)
300
298
if (res .result .status == OPTEE_SMC_RETURN_OK ) {
301
299
struct tee_shm * shm ;
302
300
303
- /*
304
- * Shared memory references that were not mapped by
305
- * this kernel must be ignored to prevent a crash.
306
- */
307
- if (!is_mapped )
308
- continue ;
309
-
310
301
shm = reg_pair_to_ptr (res .result .shm_upper32 ,
311
302
res .result .shm_lower32 );
312
303
tee_shm_free (shm );
@@ -317,27 +308,6 @@ static void __optee_disable_shm_cache(struct optee *optee, bool is_mapped)
317
308
optee_cq_wait_final (& optee -> call_queue , & w );
318
309
}
319
310
320
- /**
321
- * optee_disable_shm_cache() - Disables caching of mapped shared memory
322
- * allocations in OP-TEE
323
- * @optee: main service struct
324
- */
325
- static void optee_disable_shm_cache (struct optee * optee )
326
- {
327
- return __optee_disable_shm_cache (optee , true);
328
- }
329
-
330
- /**
331
- * optee_disable_unmapped_shm_cache() - Disables caching of shared memory
332
- * allocations in OP-TEE which are not
333
- * currently mapped
334
- * @optee: main service struct
335
- */
336
- static void optee_disable_unmapped_shm_cache (struct optee * optee )
337
- {
338
- return __optee_disable_shm_cache (optee , false);
339
- }
340
-
341
311
#define PAGELIST_ENTRIES_PER_PAGE \
342
312
((OPTEE_MSG_NONCONTIG_PAGE_SIZE / sizeof(u64)) - 1)
343
313
@@ -1295,15 +1265,6 @@ static int optee_probe(struct platform_device *pdev)
1295
1265
optee -> smc .memremaped_shm = memremaped_shm ;
1296
1266
optee -> pool = pool ;
1297
1267
1298
- /*
1299
- * Ensure that there are no pre-existing shm objects before enabling
1300
- * the shm cache so that there's no chance of receiving an invalid
1301
- * address during shutdown. This could occur, for example, if we're
1302
- * kexec booting from an older kernel that did not properly cleanup the
1303
- * shm cache.
1304
- */
1305
- optee_disable_unmapped_shm_cache (optee );
1306
-
1307
1268
optee_enable_shm_cache (optee );
1308
1269
1309
1270
if (optee -> smc .sec_caps & OPTEE_SMC_SEC_CAP_DYNAMIC_SHM )
0 commit comments