Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp663895ybi; Fri, 2 Aug 2019 02:13:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqzulVvz986MXPUX6nGePSV3GfQ7ca+zGaEV3Y5X2s/DpOvyxH0jbIgxWpFFcO7a/L0HiVW+ X-Received: by 2002:a65:4841:: with SMTP id i1mr123031990pgs.316.1564737189493; Fri, 02 Aug 2019 02:13:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564737189; cv=none; d=google.com; s=arc-20160816; b=ZtRlUpzZYvX/hhdCz4jw4syrNqa3UjbBVdHqxs4a8mXfIlDj2pWLKP3yORELWQ4Pry z59Ta9HNyhnvsOl/ceKtbGhlz5oqx3By8wCARqucCmjP7PD9t5ih+hNiHPBxz7pqIrrg oxEN0rNDByzOfdl1n8OXvZnMMa+CDBtU+XJk4nV5yO3687vYexdXGtTqULlzvwDXT3eC HnzyYaEVUaPZCMatBaw5eHkh3HJkIP1h1/gPI0AmlI8EuKIo+JLlFmBVTfyWuB2SW9OF Qw2W14+aOD6DU12FPb4BYARZMm5MXZQgFe0viS2STE0NNDoqJ1FawkrG9bEXmcYI0DfX x2AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=8J0CG6n/mGE9VY7Tzl2V8r1MEJfljCPCP1w3kMFb7gU=; b=C+B1bL7BUhX/Yx/YMMEBIpq3dt8DVNZr2zRbOF7Q+FlfaCIaV5vD0ovDzPJWHltnSE K6zncOOs7ylGzFM8rfqgP6bTQFF96eLUgwUAkXIy8afjM2JGIa1kjF6Awbernysuv1jb 9tzWmHYpTjmoBVYQS+9w/F5IyThhIK6N+ES4obIHvoMA0LZpAAIlflI9XiWl88FFtkcY eyPn0T8QceYdoGzie2mMj9+WvgiyHjnatO0VDILNeV1C2Lll4JjGVWpF9+qqZl9klZvb piVUtWKL8ivVENpsJ3fdKgY74su89t7kYORJLA8nw1Dc6km+FPh+IaQkviccAS890UNN vcVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RjyjBD2o; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k13si39352348pfa.17.2019.08.02.02.12.54; Fri, 02 Aug 2019 02:13:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RjyjBD2o; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387681AbfHBG3T (ORCPT + 99 others); Fri, 2 Aug 2019 02:29:19 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:45150 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387827AbfHBG3T (ORCPT ); Fri, 2 Aug 2019 02:29:19 -0400 Received: by mail-io1-f66.google.com with SMTP id g20so149851942ioc.12 for ; Thu, 01 Aug 2019 23:29:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8J0CG6n/mGE9VY7Tzl2V8r1MEJfljCPCP1w3kMFb7gU=; b=RjyjBD2oGv8Yelvkiciev/lZ+Q3xXx8QFqdYzdY4aCHOlugQGM86oI6FqZDvirisZ5 VJ+QLkBMLnRka6ltoYGD5wyPSjpGXQPHFctjuGwd1+UFurx0yvKt9ushEUj8EZV9ix2W 01tKC6Gaz3MS8M+0E+YLTPk1gYgnaZnSfnfDmi+UFK25mv5gEzSDgABsBJUiG+nhSsUl RKT5eQ9kRkeBcJ7gT+NzJThlFQ8TbWheTrXZG+kEcBrFAA6KQockx50ATbHKRl86DAya RCLedopliZ67rTczSP3iIMKDggIEdiJgpUtX8J4w3apFv4UIzEajhXW7aw51MfImXOri CFCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8J0CG6n/mGE9VY7Tzl2V8r1MEJfljCPCP1w3kMFb7gU=; b=CJSXg9yfLaQMQ+uqzR+8jczWpOV2trVO91GNp86Du2f49uKP6hjgW4mWxkJSJmH9mb UTA7BNqghKs6+AHaBizkiNot9FcWtFwgrV6qZTs88QEivpcyNhCGjs9f5tcXX7QQ/rLW YFKGb9rcFNThFGbpBCTFdCi+D1NzLcaBec4upzxRJuEabYzbnxzMqetyS0pwpC8p1gia 3vku8XTPnR1yP77HFtn0PlR6uAGR9mYx0d5uIC8b4FBuKN5j7IQYT3mCxOnosiXTxjD7 KNMTmvAK7iCV7UQeWdikkSZ66+FHzpFpA95BUx6LusJH2xsnDT3yb4i4RYs0mAvSCpMw UvRg== X-Gm-Message-State: APjAAAVvMO0N4m8JVU8KkTtCKQ970G2HhX8AoRPh6bfNGJoUjYkQpccB ztKDWMAXAn893AuEXWJM1vrvzf5b1F5Yo4jcc8msfA== X-Received: by 2002:a6b:3b89:: with SMTP id i131mr71226796ioa.33.1564727358352; Thu, 01 Aug 2019 23:29:18 -0700 (PDT) MIME-Version: 1.0 References: <20190802022005.5117-1-jhubbard@nvidia.com> <20190802022005.5117-17-jhubbard@nvidia.com> In-Reply-To: <20190802022005.5117-17-jhubbard@nvidia.com> From: Jens Wiklander Date: Fri, 2 Aug 2019 08:29:07 +0200 Message-ID: Subject: Re: [PATCH 16/34] drivers/tee: convert put_page() to put_user_page*() To: john.hubbard@gmail.com Cc: Andrew Morton , Christoph Hellwig , Dan Williams , Dave Chinner , Dave Hansen , Ira Weiny , Jan Kara , Jason Gunthorpe , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , LKML , amd-gfx@lists.freedesktop.org, ceph-devel@vger.kernel.org, devel@driverdev.osuosl.org, devel@lists.orangefs.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kvm@vger.kernel.org, Linux ARM , linux-block@vger.kernel.org, "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , linux-fbdev@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-media@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, linux-rdma@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-xfs@vger.kernel.org, netdev@vger.kernel.org, rds-devel@oss.oracle.com, sparclinux@vger.kernel.org, x86@kernel.org, xen-devel@lists.xenproject.org, John Hubbard Content-Type: text/plain; charset="UTF-8" Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Fri, Aug 2, 2019 at 4:20 AM wrote: > > From: John Hubbard > > 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 > Signed-off-by: John Hubbard > --- > drivers/tee/tee_shm.c | 10 ++-------- > 1 file changed, 2 insertions(+), 8 deletions(-) Acked-by: Jens Wiklander 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 >