2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-06 20:53:54 +08:00

TEE cleanup

Removes the old and unused TEE_IOCTL_SHM_* flags
 Removes unused the unused tee_shm_va2pa() and tee_shm_pa2va() functions
 -----BEGIN PGP SIGNATURE-----
 
 iQJOBAABCgA4FiEEFV+gSSXZJY9ZyuB5LinzTIcAHJcFAmJ0xD4aHGplbnMud2lr
 bGFuZGVyQGxpbmFyby5vcmcACgkQLinzTIcAHJfWjA/+PG699Ct5WRnorEtCliYU
 NY2YCt5HhKgIMqLbglNLXvWZ5DW/xE8JTfUsBJt7WRG9arha+AZVhJ8wwuoK+MaW
 mEj0NxQLjPCFsxaCtu1fSX8ZJUQKRyqZzNtU91S1/qTz9YBOcmS5shFXT/+EOEwG
 i6B5Y4bXzAsB8h7Lznt9/IyP5VSLHtdgl1auCTdv57m5bwNjsMQBqKJZsR/rgoAo
 4pBAEd1YhDGOuFN2bSONfJx2618753jCA1oxpj5/FLKG93R5Iypu36yRvzu+ujO5
 O1cY4kYNsGCZLHeVgqDkJwDQglfU5GcwSBnGHo+SeJxi8Zj8VRPbm5QECaRASTk9
 y1QSlgBLITxKYJBMjO7HuZ3RrA1wjcCgUrJvXg5KKbkQwttmciFuSewh7/ubRp3V
 tGvEnIH6bjiYMkb4Aiolc9CBhQfg3yCtiJk9VUpK0KiV3Cs1C8cBjATvYQoDCXQX
 OjxcgIXcFnkVzEHb6px7/kAuZghUPSr1A+qJDKIFeaEk9csrYhP+Gmi0XFDMV6Ws
 wuSMUJ9bWg0xw1xo+TVyYy8AQcwWBeSIUC/yq0djW54hPJmTQY9PNdSdYUK/dIN4
 ERN9ncf+BQXd9rr9q0+af2oNOG9Ee3D6jqVNBxMfn1p9ntI5W7jjIKhVDJxOM4R6
 x++gc+FREDet86HKOvOjhhY=
 =7v+l
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmJ1fsQACgkQmmx57+YA
 GNlmThAAvxZ+sXy1ZzpGnn3R04DlD/rCt7whxYfvcuHMRhV4uPc0cPdrFaVFnoh7
 3uGpG+A9TCK9/g77p+pZ4yKpDPUO8HXWci5ptV8TMeUaZDXf+UaXM6y2qpsxBYuF
 wB5aAa0vUZ8ljqbn6KskaiLVvRmYaSSNaEAh8M1cO1dbQHY6D8vtKjkBtmh2zDMZ
 dblGYhaiPEUAyCMOUdVuR0RTQWTQ+AbtGI+n88DnhgnREnuYo1qQMRwrIerTDetn
 f+hMqU6u8dfoo/GeK732YA0DU3Y2PXfE3hRgWlBTYYKClA50O35rHYlYtoOYTmCC
 i1BdgAWeR+oiMJYxaWasIr4gxfFbWfdNSBchVqr/byiLOwhnL0++Jp4YO8ESbery
 T0cDyvG784CagRABw+Yxe0mSMsz6BznQqYGBh+L5vkNXHsEj0KSoj4l/zzL9e0bj
 anqYYxf8glwT13yeWsvHQufOl7XWoLhZVrwB7nUJFt2gJH6CHITyFiFRKw8/PkWb
 lf6KJ7z8gzGeNM7euDEcGUV3emADV/yN1OHohWMI4CjfeKxLfAAkIweKJAHg9/2S
 SZEoa/68LW1+Dp76QMC+ZZBxqIgWzjZcYfZMEuwP6iYwU2EtFSn0OZZ3XUOb7ngm
 fY2MV9ZE03NDXRdP1u4jgLtHKMIOW/c4RXC938WCPHzCQfXgyvo=
 =khay
 -----END PGP SIGNATURE-----

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 <arnd@arndb.de>
This commit is contained in:
Arnd Bergmann 2022-05-06 22:02:10 +02:00
commit 728c0d2941
4 changed files with 0 additions and 74 deletions

View File

@ -302,7 +302,6 @@ static int tee_ioctl_shm_alloc(struct tee_context *ctx,
return PTR_ERR(shm);
data.id = shm->id;
data.flags = shm->flags;
data.size = shm->size;
if (copy_to_user(udata, &data, sizeof(data)))
@ -339,7 +338,6 @@ tee_ioctl_shm_register(struct tee_context *ctx,
return PTR_ERR(shm);
data.id = shm->id;
data.flags = shm->flags;
data.length = shm->size;
if (copy_to_user(udata, &data, sizeof(data)))

View File

@ -429,56 +429,6 @@ void tee_shm_free(struct tee_shm *shm)
}
EXPORT_SYMBOL_GPL(tee_shm_free);
/**
* tee_shm_va2pa() - Get physical address of a virtual address
* @shm: Shared memory handle
* @va: Virtual address to tranlsate
* @pa: Returned physical address
* @returns 0 on success and < 0 on failure
*/
int tee_shm_va2pa(struct tee_shm *shm, void *va, phys_addr_t *pa)
{
if (!shm->kaddr)
return -EINVAL;
/* Check that we're in the range of the shm */
if ((char *)va < (char *)shm->kaddr)
return -EINVAL;
if ((char *)va >= ((char *)shm->kaddr + shm->size))
return -EINVAL;
return tee_shm_get_pa(
shm, (unsigned long)va - (unsigned long)shm->kaddr, pa);
}
EXPORT_SYMBOL_GPL(tee_shm_va2pa);
/**
* tee_shm_pa2va() - Get virtual address of a physical address
* @shm: Shared memory handle
* @pa: Physical address to tranlsate
* @va: Returned virtual address
* @returns 0 on success and < 0 on failure
*/
int tee_shm_pa2va(struct tee_shm *shm, phys_addr_t pa, void **va)
{
if (!shm->kaddr)
return -EINVAL;
/* Check that we're in the range of the shm */
if (pa < shm->paddr)
return -EINVAL;
if (pa >= (shm->paddr + shm->size))
return -EINVAL;
if (va) {
void *v = tee_shm_get_va(shm, pa - shm->paddr);
if (IS_ERR(v))
return PTR_ERR(v);
*va = v;
}
return 0;
}
EXPORT_SYMBOL_GPL(tee_shm_pa2va);
/**
* tee_shm_get_va() - Get virtual address of a shared memory plus an offset
* @shm: Shared memory handle

View File

@ -298,24 +298,6 @@ void tee_shm_free(struct tee_shm *shm);
*/
void tee_shm_put(struct tee_shm *shm);
/**
* tee_shm_va2pa() - Get physical address of a virtual address
* @shm: Shared memory handle
* @va: Virtual address to tranlsate
* @pa: Returned physical address
* @returns 0 on success and < 0 on failure
*/
int tee_shm_va2pa(struct tee_shm *shm, void *va, phys_addr_t *pa);
/**
* tee_shm_pa2va() - Get virtual address of a physical address
* @shm: Shared memory handle
* @pa: Physical address to tranlsate
* @va: Returned virtual address
* @returns 0 on success and < 0 on failure
*/
int tee_shm_pa2va(struct tee_shm *shm, phys_addr_t pa, void **va);
/**
* tee_shm_get_va() - Get virtual address of a shared memory plus an offset
* @shm: Shared memory handle

View File

@ -42,10 +42,6 @@
#define TEE_IOC_MAGIC 0xa4
#define TEE_IOC_BASE 0
/* Flags relating to shared memory */
#define TEE_IOCTL_SHM_MAPPED 0x1 /* memory mapped in normal world */
#define TEE_IOCTL_SHM_DMA_BUF 0x2 /* dma-buf handle on shared memory */
#define TEE_MAX_ARG_SIZE 1024
#define TEE_GEN_CAP_GP (1 << 0)/* GlobalPlatform compliant TEE */