@@ -269,13 +269,11 @@ static void optee_enable_shm_cache(struct optee *optee)
269
269
}
270
270
271
271
/**
272
- * __optee_disable_shm_cache () - Disables caching of some shared memory
273
- * allocation in OP-TEE
272
+ * optee_disable_shm_cache () - Disables caching of some shared memory allocation
273
+ * in OP-TEE
274
274
* @optee: main service struct
275
- * @is_mapped: true if the cached shared memory addresses were mapped by this
276
- * kernel, are safe to dereference, and should be freed
277
275
*/
278
- static void __optee_disable_shm_cache (struct optee * optee , bool is_mapped )
276
+ void optee_disable_shm_cache (struct optee * optee )
279
277
{
280
278
struct optee_call_waiter w ;
281
279
@@ -294,13 +292,6 @@ static void __optee_disable_shm_cache(struct optee *optee, bool is_mapped)
294
292
if (res .result .status == OPTEE_SMC_RETURN_OK ) {
295
293
struct tee_shm * shm ;
296
294
297
- /*
298
- * Shared memory references that were not mapped by
299
- * this kernel must be ignored to prevent a crash.
300
- */
301
- if (!is_mapped )
302
- continue ;
303
-
304
295
shm = reg_pair_to_ptr (res .result .shm_upper32 ,
305
296
res .result .shm_lower32 );
306
297
tee_shm_free (shm );
@@ -311,27 +302,6 @@ static void __optee_disable_shm_cache(struct optee *optee, bool is_mapped)
311
302
optee_cq_wait_final (& optee -> call_queue , & w );
312
303
}
313
304
314
- /**
315
- * optee_disable_shm_cache() - Disables caching of mapped shared memory
316
- * allocations in OP-TEE
317
- * @optee: main service struct
318
- */
319
- static void optee_disable_shm_cache (struct optee * optee )
320
- {
321
- return __optee_disable_shm_cache (optee , true);
322
- }
323
-
324
- /**
325
- * optee_disable_unmapped_shm_cache() - Disables caching of shared memory
326
- * allocations in OP-TEE which are not
327
- * currently mapped
328
- * @optee: main service struct
329
- */
330
- static void optee_disable_unmapped_shm_cache (struct optee * optee )
331
- {
332
- return __optee_disable_shm_cache (optee , false);
333
- }
334
-
335
305
#define PAGELIST_ENTRIES_PER_PAGE \
336
306
((OPTEE_MSG_NONCONTIG_PAGE_SIZE / sizeof(u64)) - 1)
337
307
@@ -1445,15 +1415,6 @@ static int optee_probe(struct platform_device *pdev)
1445
1415
pr_info ("Asynchronous notifications enabled\n" );
1446
1416
}
1447
1417
1448
- /*
1449
- * Ensure that there are no pre-existing shm objects before enabling
1450
- * the shm cache so that there's no chance of receiving an invalid
1451
- * address during shutdown. This could occur, for example, if we're
1452
- * kexec booting from an older kernel that did not properly cleanup the
1453
- * shm cache.
1454
- */
1455
- optee_disable_unmapped_shm_cache (optee );
1456
-
1457
1418
optee_enable_shm_cache (optee );
1458
1419
1459
1420
if (optee -> smc .sec_caps & OPTEE_SMC_SEC_CAP_DYNAMIC_SHM )
0 commit comments