From patchwork Wed Aug 7 01:33:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: john.hubbard@gmail.com X-Patchwork-Id: 11079957 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E2DCA13AC for ; Wed, 7 Aug 2019 01:35:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF93726E73 for ; Wed, 7 Aug 2019 01:35:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C1EE928893; Wed, 7 Aug 2019 01:35:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 363222891F for ; Wed, 7 Aug 2019 01:35:17 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hvApw-0000P5-Mx; Wed, 07 Aug 2019 01:33:56 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hvApv-0000Oq-G7 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2019 01:33:55 +0000 X-Inumbo-ID: 6af38daf-b8b3-11e9-8980-bc764e045a96 Received: from mail-pl1-x644.google.com (unknown [2607:f8b0:4864:20::644]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 6af38daf-b8b3-11e9-8980-bc764e045a96; Wed, 07 Aug 2019 01:33:54 +0000 (UTC) Received: by mail-pl1-x644.google.com with SMTP id az7so38557979plb.5 for ; Tue, 06 Aug 2019 18:33:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=o0zfkIFt+6JH2qCeaVwPptBUW8DYTI9b55PprZaXkM8=; b=JTummjFBnv/C+O19cpD5WnNljDRNFTGhD+ZhdI4mJ0KthoLkEPnz/XxGJof7+/5P4n NHHwYbiLQNiC7TcqgsQ/ovMZm7D6aJYiNSrmCXoGWlQrghDLY3t836yj0IsY0+4YC7xI eQkZg6NO1m+ejC4ev3+3CL0uIAy7xorACp1mEOdDq8740Rm+KlATM1Sc7ZQ3MeqeRt4O 7cYGE39/ttj6uSJue/JhAE5of4ahDgxaps2hbC4CGOdXTBLt0I5b2m9zlW7Y/wUMcwRM CKumpnCTxX+R2m3tIGG+Kc4MncXcm2KfRB66iumh4vvbbc51XwcZQfEKOAaVsSQiCWNy JHKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=o0zfkIFt+6JH2qCeaVwPptBUW8DYTI9b55PprZaXkM8=; b=HunrvlZ5xnqgBgjH0OPE+aqcwmrPeKsIxPM7dFLfAmznrXzB/rwQwnHRh77KpipNUS b15Z86vGa6csKCF5nAInQf3rOZmE9Bqx/IVlEBNyERjc9hojF4I7HkZigTq374RVfJsI b+y2aRVozIQcGGcF4t7W6f02iAtpX5JLjcGHLil6AAgKTj9QZcTgewDamF1VmLmMvOo3 F/r9ILuoOZIevDd91Bf9o1oVrulBJ0dEw6qjgxU6IAsZLUfpEenGLwoQgNStlrLAkkbB LhbUpdNB96EYa3RfoTwdMeN1+knJJFTxtQheKwyGTKx/ifIlCUEKiRef4lekDAlFekDq jsRg== X-Gm-Message-State: APjAAAXaaAlYo1Os859vLMkveT7w+9HVYJL6WI3oPeTWSYBnjJzPWKOU FbtpTU96CEMg2loirTWxhtY= X-Google-Smtp-Source: APXvYqyrNSY9uu6qIRB6tCHKaxkbamRoI3EYz9mMxQODHddaqnRle1Efzwc3BX/1sry+PskKxKx5MA== X-Received: by 2002:a17:902:4401:: with SMTP id k1mr5853733pld.193.1565141634169; Tue, 06 Aug 2019 18:33:54 -0700 (PDT) Received: from blueforge.nvidia.com (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id u69sm111740800pgu.77.2019.08.06.18.33.52 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 06 Aug 2019 18:33:53 -0700 (PDT) From: john.hubbard@gmail.com X-Google-Original-From: jhubbard@nvidia.com To: Andrew Morton Date: Tue, 6 Aug 2019 18:33:05 -0700 Message-Id: <20190807013340.9706-7-jhubbard@nvidia.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190807013340.9706-1-jhubbard@nvidia.com> References: <20190807013340.9706-1-jhubbard@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public Subject: [Xen-devel] [PATCH v3 06/41] x86/kvm: convert put_page() to put_user_page*() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, Jan Kara , kvm@vger.kernel.org, =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= , Dave Hansen , Dave Chinner , dri-devel@lists.freedesktop.org, linux-mm@kvack.org, "H . Peter Anvin" , sparclinux@vger.kernel.org, Ira Weiny , ceph-devel@vger.kernel.org, devel@driverdev.osuosl.org, rds-devel@oss.oracle.com, linux-rdma@vger.kernel.org, Joerg Roedel , x86@kernel.org, amd-gfx@lists.freedesktop.org, Christoph Hellwig , Jason Gunthorpe , Ingo Molnar , xen-devel@lists.xenproject.org, devel@lists.orangefs.org, linux-media@vger.kernel.org, John Hubbard , intel-gfx@lists.freedesktop.org, linux-block@vger.kernel.org, =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= , linux-rpi-kernel@lists.infradead.org, Dan Williams , linux-arm-kernel@lists.infradead.org, linux-nfs@vger.kernel.org, netdev@vger.kernel.org, LKML , linux-xfs@vger.kernel.org, Thomas Gleixner , linux-crypto@vger.kernel.org, linux-fsdevel@vger.kernel.org, Paolo Bonzini Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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(). This is part a tree-wide conversion, as described in commit fc1d8e7cca2d ("mm: introduce put_user_page*(), placeholder versions"). Cc: Joerg Roedel Cc: Paolo Bonzini Cc: Radim Krčmář Cc: Thomas Gleixner Cc: Ingo Molnar Cc: H. Peter Anvin Cc: x86@kernel.org Cc: kvm@vger.kernel.org Signed-off-by: John Hubbard --- arch/x86/kvm/svm.c | 4 ++-- virt/kvm/kvm_main.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 7eafc6907861..ff93c923ed36 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -1827,7 +1827,7 @@ static struct page **sev_pin_memory(struct kvm *kvm, unsigned long uaddr, err: if (npinned > 0) - release_pages(pages, npinned); + put_user_pages(pages, npinned); kvfree(pages); return NULL; @@ -1838,7 +1838,7 @@ static void sev_unpin_memory(struct kvm *kvm, struct page **pages, { struct kvm_sev_info *sev = &to_kvm_svm(kvm)->sev_info; - release_pages(pages, npages); + put_user_pages(pages, npages); kvfree(pages); sev->pages_locked -= npages; } diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 887f3b0c2b60..4b6a596ea8e9 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -1499,7 +1499,7 @@ static int hva_to_pfn_slow(unsigned long addr, bool *async, bool write_fault, if (__get_user_pages_fast(addr, 1, 1, &wpage) == 1) { *writable = true; - put_page(page); + put_user_page(page); page = wpage; } } @@ -1831,7 +1831,7 @@ EXPORT_SYMBOL_GPL(kvm_release_page_clean); void kvm_release_pfn_clean(kvm_pfn_t pfn) { if (!is_error_noslot_pfn(pfn) && !kvm_is_reserved_pfn(pfn)) - put_page(pfn_to_page(pfn)); + put_user_page(pfn_to_page(pfn)); } EXPORT_SYMBOL_GPL(kvm_release_pfn_clean);