@@ -421,13 +421,11 @@ void optee_enable_shm_cache(struct optee *optee)
421
421
}
422
422
423
423
/**
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
426
426
* @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
429
427
*/
430
- static void __optee_disable_shm_cache (struct optee * optee , bool is_mapped )
428
+ void optee_disable_shm_cache (struct optee * optee )
431
429
{
432
430
struct optee_call_waiter w ;
433
431
@@ -446,13 +444,6 @@ static void __optee_disable_shm_cache(struct optee *optee, bool is_mapped)
446
444
if (res .result .status == OPTEE_SMC_RETURN_OK ) {
447
445
struct tee_shm * shm ;
448
446
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
-
456
447
shm = reg_pair_to_ptr (res .result .shm_upper32 ,
457
448
res .result .shm_lower32 );
458
449
tee_shm_free (shm );
@@ -463,27 +454,6 @@ static void __optee_disable_shm_cache(struct optee *optee, bool is_mapped)
463
454
optee_cq_wait_final (& optee -> call_queue , & w );
464
455
}
465
456
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
-
487
457
#define PAGELIST_ENTRIES_PER_PAGE \
488
458
((OPTEE_MSG_NONCONTIG_PAGE_SIZE / sizeof(u64)) - 1)
489
459
0 commit comments