Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp796296pxp; Fri, 11 Mar 2022 15:22:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJwet+gnKywI/IffIRQJQFineaVtBb6yCsuWIqKZms1WCV3jgUwpGvhnujZsledRHOry9JIp X-Received: by 2002:a17:90a:e2cc:b0:1bf:711f:11e7 with SMTP id fr12-20020a17090ae2cc00b001bf711f11e7mr24145342pjb.40.1647040956860; Fri, 11 Mar 2022 15:22:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647040956; cv=none; d=google.com; s=arc-20160816; b=t1UU9CA4XZ56Yqu0gVNzCZDe8nbQbGtCyHthMDrKHZsuMLrQDt2XmKZX4IcVGfR5nc KyxU/l2MQFUs944QvEqLNlKRrdNSi5zts2z6EGOq+Xmv9kgTL4Uiaeguc+CmjNw+6es4 b5SimKpKRnDkMzUxDnnWnQqd+Mba9B5btzI/M8x35YbtIpNw2Xp8hOfxVuU0Vn+viiR/ mDTCoLsetV7CWgS6sKJhKSKN5s8wwKH9CfT4vo0Md/TUyjvw/BkX/UIq0TJoUyXeRFka tQwRS03QbVVUbaAAsZSEn55urE38tLBVO+din7gMG1Ump4X1z+lJz8jvEScccVHPc8bY cVjQ== 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=MhzuAYVq1lJdM6POo352eQRCsWmnzV0xETxF/qwMBEk=; b=HWdpxXmlAZw69PcNDugBpsbGIzd+XZgtAgNS8XV9kT2c306O52xycDJ/vHythPCEWs NkQEwdjlgieyjxCoFi0DNKuWe/pJjJM7IbpqDUbU13ECjT4yiHOAEZxOxfFL2iS5b5tK KJh52ZxL1ZP2XVD+cdwWkX4fZcc4ATsbtdHm/y5ZAZ/RuTr8FDA5BP3p3xls6GU+TdZt heqjdSOQOleL6ABwq68hmRiWfqWU07d4cmcfxVFHc6jEt+f5jC8p3FooezmQOrxcmgKW j2v10bSrwjX8E2ohZkg85yWyAj7Mv1WzxHg9Fg0UDAcgNvz1SbsRqodTErjA0dyqRUxY nRiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cXETyiTn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d17-20020a056a00199100b004f715a58325si9465943pfl.160.2022.03.11.15.22.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 15:22:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cXETyiTn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 355262DBB84; Fri, 11 Mar 2022 14:09:02 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243127AbiCJOQg (ORCPT + 99 others); Thu, 10 Mar 2022 09:16:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243168AbiCJOP7 (ORCPT ); Thu, 10 Mar 2022 09:15:59 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F9B7A8898; Thu, 10 Mar 2022 06:12:39 -0800 (PST) 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 B8721B81E9E; Thu, 10 Mar 2022 14:12:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E09BCC340E8; Thu, 10 Mar 2022 14:12:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646921556; bh=2CUaj5w/1CaJn4msAUuMvnxGexmODIXiB6gbyycpz2o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cXETyiTnQNaW562etbxXdsd6b1RKc7tfT1AWyQ+oEdL8lXJyEvoNetYr7l9XxA08u wRlW7w26H0kS+ddTf+cSrpdvZmSb82+hvwIkF4lsagsT2zYRRiuxADAl9Fp+hyY57w RQxDZPOFrYEr8smOe7HZ3iYXsb8/qx/ylVZ0HO2o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Juergen Gross , Jan Beulich Subject: [PATCH 5.16 48/53] xen: remove gnttab_query_foreign_access() Date: Thu, 10 Mar 2022 15:09:53 +0100 Message-Id: <20220310140813.215631684@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220310140811.832630727@linuxfoundation.org> References: <20220310140811.832630727@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: Juergen Gross Commit 1dbd11ca75fe664d3e54607547771d021f531f59 upstream. Remove gnttab_query_foreign_access(), as it is unused and unsafe to use. All previous use cases assumed a grant would not be in use after gnttab_query_foreign_access() returned 0. This information is useless in best case, as it only refers to a situation in the past, which could have changed already. Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich Signed-off-by: Greg Kroah-Hartman --- drivers/xen/grant-table.c | 25 ------------------------- include/xen/grant_table.h | 2 -- 2 files changed, 27 deletions(-) --- a/drivers/xen/grant-table.c +++ b/drivers/xen/grant-table.c @@ -133,13 +133,6 @@ struct gnttab_ops { * return the frame. */ unsigned long (*end_foreign_transfer_ref)(grant_ref_t ref); - /* - * Query the status of a grant entry. Ref parameter is reference of - * queried grant entry, return value is the status of queried entry. - * Detailed status(writing/reading) can be gotten from the return value - * by bit operations. - */ - int (*query_foreign_access)(grant_ref_t ref); }; struct unmap_refs_callback_data { @@ -284,22 +277,6 @@ int gnttab_grant_foreign_access(domid_t } EXPORT_SYMBOL_GPL(gnttab_grant_foreign_access); -static int gnttab_query_foreign_access_v1(grant_ref_t ref) -{ - return gnttab_shared.v1[ref].flags & (GTF_reading|GTF_writing); -} - -static int gnttab_query_foreign_access_v2(grant_ref_t ref) -{ - return grstatus[ref] & (GTF_reading|GTF_writing); -} - -int gnttab_query_foreign_access(grant_ref_t ref) -{ - return gnttab_interface->query_foreign_access(ref); -} -EXPORT_SYMBOL_GPL(gnttab_query_foreign_access); - static int gnttab_end_foreign_access_ref_v1(grant_ref_t ref, int readonly) { u16 flags, nflags; @@ -1427,7 +1404,6 @@ static const struct gnttab_ops gnttab_v1 .update_entry = gnttab_update_entry_v1, .end_foreign_access_ref = gnttab_end_foreign_access_ref_v1, .end_foreign_transfer_ref = gnttab_end_foreign_transfer_ref_v1, - .query_foreign_access = gnttab_query_foreign_access_v1, }; static const struct gnttab_ops gnttab_v2_ops = { @@ -1439,7 +1415,6 @@ static const struct gnttab_ops gnttab_v2 .update_entry = gnttab_update_entry_v2, .end_foreign_access_ref = gnttab_end_foreign_access_ref_v2, .end_foreign_transfer_ref = gnttab_end_foreign_transfer_ref_v2, - .query_foreign_access = gnttab_query_foreign_access_v2, }; static bool gnttab_need_v2(void) --- a/include/xen/grant_table.h +++ b/include/xen/grant_table.h @@ -125,8 +125,6 @@ int gnttab_grant_foreign_transfer(domid_ unsigned long gnttab_end_foreign_transfer_ref(grant_ref_t ref); unsigned long gnttab_end_foreign_transfer(grant_ref_t ref); -int gnttab_query_foreign_access(grant_ref_t ref); - /* * operations on reserved batches of grant references */