@@ -421,13 +421,11 @@ void optee_enable_shm_cache(struct optee *optee)
421421}
422422
423423/**
424- * __optee_disable_shm_cache () - Disables caching of some shared memory
425- * allocation in OP-TEE
424+ * optee_disable_shm_cache () - Disables caching of some shared memory allocation
425+ * in OP-TEE
426426 * @optee: main service struct
427- * @is_mapped: true if the cached shared memory addresses were mapped by this
428- * kernel, are safe to dereference, and should be freed
429427 */
430- static void __optee_disable_shm_cache (struct optee * optee , bool is_mapped )
428+ void optee_disable_shm_cache (struct optee * optee )
431429{
432430 struct optee_call_waiter w ;
433431
@@ -446,13 +444,6 @@ static void __optee_disable_shm_cache(struct optee *optee, bool is_mapped)
446444 if (res .result .status == OPTEE_SMC_RETURN_OK ) {
447445 struct tee_shm * shm ;
448446
449- /*
450- * Shared memory references that were not mapped by
451- * this kernel must be ignored to prevent a crash.
452- */
453- if (!is_mapped )
454- continue ;
455-
456447 shm = reg_pair_to_ptr (res .result .shm_upper32 ,
457448 res .result .shm_lower32 );
458449 tee_shm_free (shm );
@@ -463,27 +454,6 @@ static void __optee_disable_shm_cache(struct optee *optee, bool is_mapped)
463454 optee_cq_wait_final (& optee -> call_queue , & w );
464455}
465456
466- /**
467- * optee_disable_shm_cache() - Disables caching of mapped shared memory
468- * allocations in OP-TEE
469- * @optee: main service struct
470- */
471- void optee_disable_shm_cache (struct optee * optee )
472- {
473- return __optee_disable_shm_cache (optee , true);
474- }
475-
476- /**
477- * optee_disable_unmapped_shm_cache() - Disables caching of shared memory
478- * allocations in OP-TEE which are not
479- * currently mapped
480- * @optee: main service struct
481- */
482- void optee_disable_unmapped_shm_cache (struct optee * optee )
483- {
484- return __optee_disable_shm_cache (optee , false);
485- }
486-
487457#define PAGELIST_ENTRIES_PER_PAGE \
488458 ((OPTEE_MSG_NONCONTIG_PAGE_SIZE / sizeof(u64)) - 1)
489459
0 commit comments