[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHUa44HkQtstCyUt_J962rzysFnOJOP+e3T2gL7nV+6V5hfa9A@mail.gmail.com>
Date: Wed, 9 Feb 2022 15:08:48 +0100
From: Jens Wiklander <jens.wiklander@...aro.org>
To: linux-kernel@...r.kernel.org, op-tee@...ts.trustedfirmware.org,
Jarkko Sakkinen <jarkko@...nel.org>
Cc: Sumit Garg <sumit.garg@...aro.org>,
Herbert Xu <herbert@...dor.apana.org.au>,
Devaraj Rangasamy <Devaraj.Rangasamy@....com>,
Rijo Thomas <Rijo-john.Thomas@....com>,
David Howells <dhowells@...hat.com>,
Tyler Hicks <tyhicks@...ux.microsoft.com>
Subject: Re: [PATCH v4 08/10] KEYS: trusted: tee: use tee_shm_register_kernel_buf()
Hi Jarkko,
On Fri, Feb 4, 2022 at 10:34 AM Jens Wiklander
<jens.wiklander@...aro.org> wrote:
>
> Uses the new simplified tee_shm_register_kernel_buf() function instead
> of the old tee_shm_alloc() function which required specific
> TEE_SHM-flags
>
> Reviewed-by: Sumit Garg <sumit.garg@...aro.org>
> Signed-off-by: Jens Wiklander <jens.wiklander@...aro.org>
> ---
> security/keys/trusted-keys/trusted_tee.c | 23 +++++++++--------------
> 1 file changed, 9 insertions(+), 14 deletions(-)
Since this patch depends on other patches in this patch set and vice
versa is it OK if I take this patch via my tree? I'm aiming for v5.18
with this.
Thanks,
Jens
>
>
> diff --git a/security/keys/trusted-keys/trusted_tee.c b/security/keys/trusted-keys/trusted_tee.c
> index 2ce66c199e1d..c8626686ee1b 100644
> --- a/security/keys/trusted-keys/trusted_tee.c
> +++ b/security/keys/trusted-keys/trusted_tee.c
> @@ -70,17 +70,15 @@ static int trusted_tee_seal(struct trusted_key_payload *p, char *datablob)
> memset(&inv_arg, 0, sizeof(inv_arg));
> memset(¶m, 0, sizeof(param));
>
> - reg_shm_in = tee_shm_register(pvt_data.ctx, (unsigned long)p->key,
> - p->key_len, TEE_SHM_DMA_BUF |
> - TEE_SHM_KERNEL_MAPPED);
> + reg_shm_in = tee_shm_register_kernel_buf(pvt_data.ctx, p->key,
> + p->key_len);
> if (IS_ERR(reg_shm_in)) {
> dev_err(pvt_data.dev, "key shm register failed\n");
> return PTR_ERR(reg_shm_in);
> }
>
> - reg_shm_out = tee_shm_register(pvt_data.ctx, (unsigned long)p->blob,
> - sizeof(p->blob), TEE_SHM_DMA_BUF |
> - TEE_SHM_KERNEL_MAPPED);
> + reg_shm_out = tee_shm_register_kernel_buf(pvt_data.ctx, p->blob,
> + sizeof(p->blob));
> if (IS_ERR(reg_shm_out)) {
> dev_err(pvt_data.dev, "blob shm register failed\n");
> ret = PTR_ERR(reg_shm_out);
> @@ -131,17 +129,15 @@ static int trusted_tee_unseal(struct trusted_key_payload *p, char *datablob)
> memset(&inv_arg, 0, sizeof(inv_arg));
> memset(¶m, 0, sizeof(param));
>
> - reg_shm_in = tee_shm_register(pvt_data.ctx, (unsigned long)p->blob,
> - p->blob_len, TEE_SHM_DMA_BUF |
> - TEE_SHM_KERNEL_MAPPED);
> + reg_shm_in = tee_shm_register_kernel_buf(pvt_data.ctx, p->blob,
> + p->blob_len);
> if (IS_ERR(reg_shm_in)) {
> dev_err(pvt_data.dev, "blob shm register failed\n");
> return PTR_ERR(reg_shm_in);
> }
>
> - reg_shm_out = tee_shm_register(pvt_data.ctx, (unsigned long)p->key,
> - sizeof(p->key), TEE_SHM_DMA_BUF |
> - TEE_SHM_KERNEL_MAPPED);
> + reg_shm_out = tee_shm_register_kernel_buf(pvt_data.ctx, p->key,
> + sizeof(p->key));
> if (IS_ERR(reg_shm_out)) {
> dev_err(pvt_data.dev, "key shm register failed\n");
> ret = PTR_ERR(reg_shm_out);
> @@ -192,8 +188,7 @@ static int trusted_tee_get_random(unsigned char *key, size_t key_len)
> memset(&inv_arg, 0, sizeof(inv_arg));
> memset(¶m, 0, sizeof(param));
>
> - reg_shm = tee_shm_register(pvt_data.ctx, (unsigned long)key, key_len,
> - TEE_SHM_DMA_BUF | TEE_SHM_KERNEL_MAPPED);
> + reg_shm = tee_shm_register_kernel_buf(pvt_data.ctx, key, key_len);
> if (IS_ERR(reg_shm)) {
> dev_err(pvt_data.dev, "key shm register failed\n");
> return PTR_ERR(reg_shm);
> --
> 2.31.1
>
Powered by blists - more mailing lists