Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3022278rwb; Mon, 15 Aug 2022 16:19:45 -0700 (PDT) X-Google-Smtp-Source: AA6agR4Ai6uwt+j00zsxDIM1oMjCS6fvPI/DBa855002Runjwlxrb2zyt8Tq8bUIsLvYAmHe2N00 X-Received: by 2002:a63:6848:0:b0:421:9052:1ac9 with SMTP id d69-20020a636848000000b0042190521ac9mr15265011pgc.183.1660605585441; Mon, 15 Aug 2022 16:19:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605585; cv=none; d=google.com; s=arc-20160816; b=vo1m2Xe3OXe9+hvnUrwgtQB2O1oB6nD7OrPeFSADS/N/HiA4XU4+xcYCgmUB6v+N6E 9BlyRSEWIw4Muf7FHXSG6Y0s6fNdLeMqTNOOQVFA2ub/K03X63qhsUMDbLlLmv8iGsAD 67bQM2knIhjMd9Wbxt6T5TcQmpJoUa6C9+UyOpXByKNEd0qC+5pB2Z2jVodQJ24XYqYR cgLWeXcMGVRtxUZOtXuhEQHK5ruqLrvNKmcbISRk2WSz5Lt0vLLxcFtDMLIfTJpwmWD9 hRU7CfupciLQS/a4G8DCegFs6HSXpfT/4wjkk+ZIU51ys35xuvo68wfVnGW3QMg4rhxu JXzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4rZT2Vijbx/uLtNQ1hMVHJbZuJgcw71S+Va2XYUL6X0=; b=xGPrLvxDC0PpZWFKoMwa7mWjW8D/q8vx9TKMCVufM8Zvh9rU5yHb+gen0Yn6n4H1tR VKd8iuG75qCfSKGyMvoAeQY41p5N/Vdraof1bm4aRXsUfAtsG0o8qCDGdBXvX2f79vaj cYT993dTLSXlNzuNe0jaQdePNQoGrJ5M+kFOPi5GNY/Zs+KUi702PjeWVFTZwM5cZnYp NgxWRVUA0xwVKFrn/HG1NYMXMy6kinFmJMMWwxGv8baVwhghctSyDJS6htbQyZbzvHYB KgX4by6D6OfyFD/PuR/IE+5cpTWL8J4PBGAIOF/hJepmMTJxJHf2OyQ0jp3m4KwWkNap 47qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="N/QxrU/3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j21-20020aa78015000000b00528a44b7df7si10576765pfi.189.2022.08.15.16.19.34; Mon, 15 Aug 2022 16:19:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="N/QxrU/3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350231AbiHOVwa (ORCPT + 99 others); Mon, 15 Aug 2022 17:52:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350278AbiHOVrf (ORCPT ); Mon, 15 Aug 2022 17:47:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D088A2B628; Mon, 15 Aug 2022 12:31:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 85B05B8107A; Mon, 15 Aug 2022 19:31:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CCE49C433D6; Mon, 15 Aug 2022 19:31:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660591895; bh=KKc5u0c4svxwVAcIxxjFmvahLmLCXSorZlxcM4OLRUU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N/QxrU/3+kiRTnCKgzYWAua8DRuARNRFpt//PVWjvvGMOLRPLOaxPiyvX1yNkRSHR ZiXUCytbLjt+bGj9SHPmhmj2r44yMYSuZk7JuibTpmgJFnRjK/b8flHWm0c8V0MXsh wCXevx48iz/k9f7U2o0SJp56alLwrtIZy9CFgxyw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sean Christopherson , Paolo Bonzini Subject: [PATCH 5.19 0027/1157] KVM: Drop unused @gpa param from gfn=>pfn caches __release_gpc() helper Date: Mon, 15 Aug 2022 19:49:43 +0200 Message-Id: <20220815180440.512740346@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Christopherson commit 345b0fd6fe5f66dfe841bad0b39dd11a5672df68 upstream. Drop the @pga param from __release_gpc() and rename the helper to make it more obvious that the cache itself is not being released. The helper will be reused by a future commit to release a pfn+khva combination that is _never_ associated with the cache, at which point the current name would go from slightly misleading to blatantly wrong. No functional change intended. Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Message-Id: <20220429210025.3293691-4-seanjc@google.com> Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- virt/kvm/pfncache.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) --- a/virt/kvm/pfncache.c +++ b/virt/kvm/pfncache.c @@ -95,7 +95,7 @@ bool kvm_gfn_to_pfn_cache_check(struct k } EXPORT_SYMBOL_GPL(kvm_gfn_to_pfn_cache_check); -static void __release_gpc(struct kvm *kvm, kvm_pfn_t pfn, void *khva, gpa_t gpa) +static void gpc_release_pfn_and_khva(struct kvm *kvm, kvm_pfn_t pfn, void *khva) { /* Unmap the old page if it was mapped before, and release it */ if (!is_error_noslot_pfn(pfn)) { @@ -146,7 +146,6 @@ int kvm_gfn_to_pfn_cache_refresh(struct unsigned long page_offset = gpa & ~PAGE_MASK; kvm_pfn_t old_pfn, new_pfn; unsigned long old_uhva; - gpa_t old_gpa; void *old_khva; bool old_valid; int ret = 0; @@ -160,7 +159,6 @@ int kvm_gfn_to_pfn_cache_refresh(struct write_lock_irq(&gpc->lock); - old_gpa = gpc->gpa; old_pfn = gpc->pfn; old_khva = gpc->khva - offset_in_page(gpc->khva); old_uhva = gpc->uhva; @@ -244,7 +242,7 @@ int kvm_gfn_to_pfn_cache_refresh(struct out: write_unlock_irq(&gpc->lock); - __release_gpc(kvm, old_pfn, old_khva, old_gpa); + gpc_release_pfn_and_khva(kvm, old_pfn, old_khva); return ret; } @@ -254,14 +252,12 @@ void kvm_gfn_to_pfn_cache_unmap(struct k { void *old_khva; kvm_pfn_t old_pfn; - gpa_t old_gpa; write_lock_irq(&gpc->lock); gpc->valid = false; old_khva = gpc->khva - offset_in_page(gpc->khva); - old_gpa = gpc->gpa; old_pfn = gpc->pfn; /* @@ -273,7 +269,7 @@ void kvm_gfn_to_pfn_cache_unmap(struct k write_unlock_irq(&gpc->lock); - __release_gpc(kvm, old_pfn, old_khva, old_gpa); + gpc_release_pfn_and_khva(kvm, old_pfn, old_khva); } EXPORT_SYMBOL_GPL(kvm_gfn_to_pfn_cache_unmap);