Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp604374iog; Wed, 15 Jun 2022 08:32:20 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s42HGdejNDEHmE/SddZ9Y/8QIN/5DoqmDGGVSXFlZN1VRJMtayVMiZZy7gJ/wiWrYV6j3r X-Received: by 2002:aa7:da8f:0:b0:42d:d4b0:56e0 with SMTP id q15-20020aa7da8f000000b0042dd4b056e0mr315482eds.359.1655307140013; Wed, 15 Jun 2022 08:32:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655307140; cv=none; d=google.com; s=arc-20160816; b=axWa2F/bz4EjTwxUVvglzDEM0wTNq2/q5eaMKYIjP0+4Wi8PdZ53m+Gs8sradjXQIi 26MNTWiKLcn9xjiCCw96Uf+dyKswmQIyBiCAqu/mRrwhF0aNExYXCfymmMvU9lvZ3z5u ZDf65ODh1IAq5hwu04OeOyMXHBdebUJZ4qkL+EWaMSm2Lnk9gGVsUT9nHku4tGwOR4oE qLYBVb9pTg8mjxkARf7Y1c23rNvAgqLgL9O7g81sKL/ndyk85KSAytEnjy0imzLY0g1W dWeh7/VB3YZ86Yb/gqHWHAXLeLWX2xbWQG16oVdFGuPkkOlBczk7vcnG5v/0QD690UXX DqNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=Ll9Esuok3OnvaKafXMyZVNy8MFihRVd3fE67aAHL3lE=; b=ZukNNOUY/ZDT2xvpB2bxpZW9iS07WcupxK/e6IRo5fhPwYVVQcF7NSeON1iXZxUFxN 1iIFi1ofz0AV4U4iaQCCJGEFUHpPc++gjmgoFLO8fz7/tRNqInOlD/RBDZibA8+Xw78f UG/EqreDjNXI9oRss5wEf9fwwZMu8am+HV2diK1kEz89VugBxBSQnc421L7F/Raq/rB1 jrG2D58yFiC1sPfeAA6JAlZgBCExnplce4pwGoaG9vJ5z5yWPxwFt5WF0izBTikZAHxl 1e3Sf7pcBCHUcPTNxemi/LiIDrgxZXZRCj14uYkdSM4cf7ltCWgKhCIjV+WFn8tKxsFZ 1llQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=g+Z9a8tB; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kt16-20020a170906aad000b006fe4d195c19si13030352ejb.546.2022.06.15.08.31.52; Wed, 15 Jun 2022 08:32:20 -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=fail header.i=@kernel.org header.s=k20201202 header.b=g+Z9a8tB; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345883AbiFOP3q (ORCPT + 99 others); Wed, 15 Jun 2022 11:29:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355365AbiFOP2i (ORCPT ); Wed, 15 Jun 2022 11:28:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6CBC4F456; Wed, 15 Jun 2022 08:27:47 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 3DE6461730; Wed, 15 Jun 2022 15:27:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 075C2C341C4; Wed, 15 Jun 2022 15:27:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655306866; bh=ArrWWi9aGs9TPTpy73ldENPFG9RCYJiCftXoVPyfiXA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g+Z9a8tBUvrdOq9En5CSui7C1egHykyAomklROUSNevyZlUzrxdBtW+8Jg/Sbs3dx B/frSxNCMCV1HpkQb3FUy9yPEHvE/C4Fgcscb6nwZk2wud73DWJQmGG+ZnZeaMqoqj S4tTuphrd2FjPf2ytW5WMFAYIzf4OoLS6qhqVzgqnTBXWADmBbQnxh9XrDdAC5v4o8 DKszVAokucAtHdAzZu2vvm0TGcdwwfuXbJEyhSwPMcZQ73CL7YMWu1oShtibuLPhCx +43Tz0HKhqsADIEkozMT7BH7OSAxi6O3sxqaB4RdVWT2S1xvBhG2DqLK/O3jJNGX25 2jkOkUinAk7vQ== Received: from mchehab by mail.kernel.org with local (Exim 4.95) (envelope-from ) id 1o1Uvm-00A4Jm-FD; Wed, 15 Jun 2022 16:27:42 +0100 From: Mauro Carvalho Chehab Cc: Chris Wilson , "Fei Yang" , "Thomas Hellstrom" , Daniel Vetter , Dave Airlie , David Airlie , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, mauro.chehab@linux.intel.com, Andi Shyti , stable@vger.kernel.org, =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , Mauro Carvalho Chehab Subject: [PATCH 4/6] drm/i915/gt: Only invalidate TLBs exposed to user manipulation Date: Wed, 15 Jun 2022 16:27:38 +0100 Message-Id: <387b9a8d3e719ad2db4fce56c0bfc0f909fd6df6.1655306128.git.mchehab@kernel.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 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 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chris Wilson Don't flush TLBs when the buffer is only used in the GGTT under full control of the kernel, as there's no risk of of concurrent access and stale access from prefetch. We only need to invalidate the TLB if they are accessible by the user. Fixes: 7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store") Signed-off-by: Chris Wilson Cc: Fei Yang Cc: Andi Shyti Cc: stable@vger.kernel.org Acked-by: Thomas Hellström Signed-off-by: Mauro Carvalho Chehab --- See [PATCH 0/6] at: https://lore.kernel.org/all/cover.1655306128.git.mchehab@kernel.org/ drivers/gpu/drm/i915/i915_vma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c index 0bffb70b3c5f..7989986161e8 100644 --- a/drivers/gpu/drm/i915/i915_vma.c +++ b/drivers/gpu/drm/i915/i915_vma.c @@ -537,7 +537,8 @@ int i915_vma_bind(struct i915_vma *vma, bind_flags); } - set_bit(I915_BO_WAS_BOUND_BIT, &vma->obj->flags); + if (bind_flags & I915_VMA_LOCAL_BIND) + set_bit(I915_BO_WAS_BOUND_BIT, &vma->obj->flags); atomic_or(bind_flags, &vma->flags); return 0; -- 2.36.1