[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHUa44G++iiwU62jj7QH=V3sr4z26sf007xrwWLPw6AAeMLAEw@mail.gmail.com>
Date: Fri, 2 Aug 2019 08:29:07 +0200
From: Jens Wiklander <jens.wiklander@...aro.org>
To: john.hubbard@...il.com
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Christoph Hellwig <hch@...radead.org>,
Dan Williams <dan.j.williams@...el.com>,
Dave Chinner <david@...morbit.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Ira Weiny <ira.weiny@...el.com>, Jan Kara <jack@...e.cz>,
Jason Gunthorpe <jgg@...pe.ca>,
Jérôme Glisse <jglisse@...hat.com>,
LKML <linux-kernel@...r.kernel.org>,
amd-gfx@...ts.freedesktop.org, ceph-devel@...r.kernel.org,
devel@...verdev.osuosl.org, devel@...ts.orangefs.org,
dri-devel@...ts.freedesktop.org, intel-gfx@...ts.freedesktop.org,
kvm@...r.kernel.org,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
linux-block@...r.kernel.org,
"open list:HARDWARE RANDOM NUMBER GENERATOR CORE"
<linux-crypto@...r.kernel.org>, linux-fbdev@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-media@...r.kernel.org,
linux-mm@...ck.org, linux-nfs@...r.kernel.org,
linux-rdma@...r.kernel.org, linux-rpi-kernel@...ts.infradead.org,
linux-xfs@...r.kernel.org, netdev@...r.kernel.org,
rds-devel@....oracle.com, sparclinux@...r.kernel.org,
x86@...nel.org, xen-devel@...ts.xenproject.org,
John Hubbard <jhubbard@...dia.com>
Subject: Re: [PATCH 16/34] drivers/tee: convert put_page() to put_user_page*()
On Fri, Aug 2, 2019 at 4:20 AM <john.hubbard@...il.com> wrote:
>
> From: John Hubbard <jhubbard@...dia.com>
>
> For pages that were retained via get_user_pages*(), release those pages
> via the new put_user_page*() routines, instead of via put_page() or
> release_pages().
>
> This is part a tree-wide conversion, as described in commit fc1d8e7cca2d
> ("mm: introduce put_user_page*(), placeholder versions").
>
> Cc: Jens Wiklander <jens.wiklander@...aro.org>
> Signed-off-by: John Hubbard <jhubbard@...dia.com>
> ---
> drivers/tee/tee_shm.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
Acked-by: Jens Wiklander <jens.wiklander@...aro.org>
I suppose you're taking this via your own tree or such.
Thanks,
Jens
>
> diff --git a/drivers/tee/tee_shm.c b/drivers/tee/tee_shm.c
> index 2da026fd12c9..c967d0420b67 100644
> --- a/drivers/tee/tee_shm.c
> +++ b/drivers/tee/tee_shm.c
> @@ -31,16 +31,13 @@ static void tee_shm_release(struct tee_shm *shm)
>
> poolm->ops->free(poolm, shm);
> } else if (shm->flags & TEE_SHM_REGISTER) {
> - size_t n;
> int rc = teedev->desc->ops->shm_unregister(shm->ctx, shm);
>
> if (rc)
> dev_err(teedev->dev.parent,
> "unregister shm %p failed: %d", shm, rc);
>
> - for (n = 0; n < shm->num_pages; n++)
> - put_page(shm->pages[n]);
> -
> + put_user_pages(shm->pages, shm->num_pages);
> kfree(shm->pages);
> }
>
> @@ -313,16 +310,13 @@ struct tee_shm *tee_shm_register(struct tee_context *ctx, unsigned long addr,
> return shm;
> err:
> if (shm) {
> - size_t n;
> -
> if (shm->id >= 0) {
> mutex_lock(&teedev->mutex);
> idr_remove(&teedev->idr, shm->id);
> mutex_unlock(&teedev->mutex);
> }
> if (shm->pages) {
> - for (n = 0; n < shm->num_pages; n++)
> - put_page(shm->pages[n]);
> + put_user_pages(shm->pages, shm->num_pages);
> kfree(shm->pages);
> }
> }
> --
> 2.22.0
>
Powered by blists - more mailing lists