@@ -275,13 +275,11 @@ static void optee_enable_shm_cache(struct optee *optee)
275275}
276276
277277/**
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
280280 * @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
283281 */
284- static void __optee_disable_shm_cache (struct optee * optee , bool is_mapped )
282+ void optee_disable_shm_cache (struct optee * optee )
285283{
286284 struct optee_call_waiter w ;
287285
@@ -300,13 +298,6 @@ static void __optee_disable_shm_cache(struct optee *optee, bool is_mapped)
300298 if (res .result .status == OPTEE_SMC_RETURN_OK ) {
301299 struct tee_shm * shm ;
302300
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-
310301 shm = reg_pair_to_ptr (res .result .shm_upper32 ,
311302 res .result .shm_lower32 );
312303 tee_shm_free (shm );
@@ -317,27 +308,6 @@ static void __optee_disable_shm_cache(struct optee *optee, bool is_mapped)
317308 optee_cq_wait_final (& optee -> call_queue , & w );
318309}
319310
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-
341311#define PAGELIST_ENTRIES_PER_PAGE \
342312 ((OPTEE_MSG_NONCONTIG_PAGE_SIZE / sizeof(u64)) - 1)
343313
@@ -1295,15 +1265,6 @@ static int optee_probe(struct platform_device *pdev)
12951265 optee -> smc .memremaped_shm = memremaped_shm ;
12961266 optee -> pool = pool ;
12971267
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-
13071268 optee_enable_shm_cache (optee );
13081269
13091270 if (optee -> smc .sec_caps & OPTEE_SMC_SEC_CAP_DYNAMIC_SHM )
0 commit comments