Skip to content

Commit 728c0d2

Browse files
committed
Merge tag 'tee-cleanup-for-v5.19' of https://git.linaro.org/people/jens.wiklander/linux-tee into arm/drivers
TEE cleanup Removes the old and unused TEE_IOCTL_SHM_* flags Removes unused the unused tee_shm_va2pa() and tee_shm_pa2va() functions * tag 'tee-cleanup-for-v5.19' of https://git.linaro.org/people/jens.wiklander/linux-tee: tee: remove flags TEE_IOCTL_SHM_MAPPED and TEE_IOCTL_SHM_DMA_BUF tee: remove tee_shm_va2pa() and tee_shm_pa2va() Link: https://lore.kernel.org/r/20220506070328.GA1344495@jade Signed-off-by: Arnd Bergmann <[email protected]>
2 parents 7ad7ab9 + d8fc1c7 commit 728c0d2

File tree

4 files changed

+0
-74
lines changed

4 files changed

+0
-74
lines changed

drivers/tee/tee_core.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ static int tee_ioctl_shm_alloc(struct tee_context *ctx,
302302
return PTR_ERR(shm);
303303

304304
data.id = shm->id;
305-
data.flags = shm->flags;
306305
data.size = shm->size;
307306

308307
if (copy_to_user(udata, &data, sizeof(data)))
@@ -339,7 +338,6 @@ tee_ioctl_shm_register(struct tee_context *ctx,
339338
return PTR_ERR(shm);
340339

341340
data.id = shm->id;
342-
data.flags = shm->flags;
343341
data.length = shm->size;
344342

345343
if (copy_to_user(udata, &data, sizeof(data)))

drivers/tee/tee_shm.c

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -429,56 +429,6 @@ void tee_shm_free(struct tee_shm *shm)
429429
}
430430
EXPORT_SYMBOL_GPL(tee_shm_free);
431431

432-
/**
433-
* tee_shm_va2pa() - Get physical address of a virtual address
434-
* @shm: Shared memory handle
435-
* @va: Virtual address to tranlsate
436-
* @pa: Returned physical address
437-
* @returns 0 on success and < 0 on failure
438-
*/
439-
int tee_shm_va2pa(struct tee_shm *shm, void *va, phys_addr_t *pa)
440-
{
441-
if (!shm->kaddr)
442-
return -EINVAL;
443-
/* Check that we're in the range of the shm */
444-
if ((char *)va < (char *)shm->kaddr)
445-
return -EINVAL;
446-
if ((char *)va >= ((char *)shm->kaddr + shm->size))
447-
return -EINVAL;
448-
449-
return tee_shm_get_pa(
450-
shm, (unsigned long)va - (unsigned long)shm->kaddr, pa);
451-
}
452-
EXPORT_SYMBOL_GPL(tee_shm_va2pa);
453-
454-
/**
455-
* tee_shm_pa2va() - Get virtual address of a physical address
456-
* @shm: Shared memory handle
457-
* @pa: Physical address to tranlsate
458-
* @va: Returned virtual address
459-
* @returns 0 on success and < 0 on failure
460-
*/
461-
int tee_shm_pa2va(struct tee_shm *shm, phys_addr_t pa, void **va)
462-
{
463-
if (!shm->kaddr)
464-
return -EINVAL;
465-
/* Check that we're in the range of the shm */
466-
if (pa < shm->paddr)
467-
return -EINVAL;
468-
if (pa >= (shm->paddr + shm->size))
469-
return -EINVAL;
470-
471-
if (va) {
472-
void *v = tee_shm_get_va(shm, pa - shm->paddr);
473-
474-
if (IS_ERR(v))
475-
return PTR_ERR(v);
476-
*va = v;
477-
}
478-
return 0;
479-
}
480-
EXPORT_SYMBOL_GPL(tee_shm_pa2va);
481-
482432
/**
483433
* tee_shm_get_va() - Get virtual address of a shared memory plus an offset
484434
* @shm: Shared memory handle

include/linux/tee_drv.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -298,24 +298,6 @@ void tee_shm_free(struct tee_shm *shm);
298298
*/
299299
void tee_shm_put(struct tee_shm *shm);
300300

301-
/**
302-
* tee_shm_va2pa() - Get physical address of a virtual address
303-
* @shm: Shared memory handle
304-
* @va: Virtual address to tranlsate
305-
* @pa: Returned physical address
306-
* @returns 0 on success and < 0 on failure
307-
*/
308-
int tee_shm_va2pa(struct tee_shm *shm, void *va, phys_addr_t *pa);
309-
310-
/**
311-
* tee_shm_pa2va() - Get virtual address of a physical address
312-
* @shm: Shared memory handle
313-
* @pa: Physical address to tranlsate
314-
* @va: Returned virtual address
315-
* @returns 0 on success and < 0 on failure
316-
*/
317-
int tee_shm_pa2va(struct tee_shm *shm, phys_addr_t pa, void **va);
318-
319301
/**
320302
* tee_shm_get_va() - Get virtual address of a shared memory plus an offset
321303
* @shm: Shared memory handle

include/uapi/linux/tee.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@
4242
#define TEE_IOC_MAGIC 0xa4
4343
#define TEE_IOC_BASE 0
4444

45-
/* Flags relating to shared memory */
46-
#define TEE_IOCTL_SHM_MAPPED 0x1 /* memory mapped in normal world */
47-
#define TEE_IOCTL_SHM_DMA_BUF 0x2 /* dma-buf handle on shared memory */
48-
4945
#define TEE_MAX_ARG_SIZE 1024
5046

5147
#define TEE_GEN_CAP_GP (1 << 0)/* GlobalPlatform compliant TEE */

0 commit comments

Comments
 (0)