Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp513880imw; Wed, 13 Jul 2022 02:57:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1trEF/WsdbQbxLFCHWOhpzchNgrFNc+ieODzCdFMrD6YeuccnhqFF78+klamgo2e4QoFXm+ X-Received: by 2002:a17:903:24e:b0:16b:9fa2:41e5 with SMTP id j14-20020a170903024e00b0016b9fa241e5mr2395860plh.127.1657706231635; Wed, 13 Jul 2022 02:57:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657706231; cv=none; d=google.com; s=arc-20160816; b=FJ1FOp/tu3xZIgxy7Dg1uww5LasNd9/R77I+loHaH9wtw0MbYGkJy3fI/nnTCQZDQq VQx54Tuz30jGWC1UhD1resfH0X1Sp+tSfxhZDpLA91lMQ8Rb9WGcBKIMeGjU3hHKINQ2 fqHK1ByT+G1IwBA5uv/Na81UPNUYr+D3xFRJ3kc/cQ+Y8wNxV/cnDRl157w4KA1/uTbp Vj9lMEMbgXj/ilIJVDyW1oLHSXSMXt6l8aI1TebHYkLYw2MX7XMDueKAjRiToR0zvvrC BDaPMyMMtaPH8Hrx5Wu3p0IRv+tkXPMnQlY+2sVcKnemOU4x9WwK5rgiuA3rEz/JPWU8 eydw== 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=qd4yumco0Fa1IZ2NhBLphVL01bk9CCQijtdnf4mti30=; b=b8dWgJWxB4Y8lDJRi5YPXxcszHI2Rxeg53+MbycjZnIuGPPJfVXHH66b56IjM7K9SS b0CPwjTa1EJD57fpu7IWkei8Gbya23O/DiJRmG9bFXvW0t2qTITbqK6gqI1r2Kh4hWfZ giGOnlIwi3dabLJv3mrhqtljFyTwndPiHZgBh7+SUOaNhTyvWF7foIAV5Utw9piPnSor 4HQJk8phPA8MHDjA+Zk6unBMcynPQOzhDw5h51VuLWq13BJRHOuAgMP9Tb6xRoqBVMMs MM8fYiyfXINy4gMSBf9hFm+M0UnxsfYHnneubXNM7q8vqk4QN6Xfxmwz7QTekltc0LsC OXww== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b="RtajU/xM"; 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 e22-20020a633716000000b0040d9ebed1c6si16073662pga.806.2022.07.13.02.56.59; Wed, 13 Jul 2022 02:57:11 -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="RtajU/xM"; 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 S235894AbiGMJar (ORCPT + 99 others); Wed, 13 Jul 2022 05:30:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231936AbiGMJaZ (ORCPT ); Wed, 13 Jul 2022 05:30:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5487CF2E20 for ; Wed, 13 Jul 2022 02:30:24 -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 E162A61CC0 for ; Wed, 13 Jul 2022 09:30:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5700FC341E1; Wed, 13 Jul 2022 09:30:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657704622; bh=Fkt5pO3rEYdJ3e4kKvqhVhroFKgVT0cB8fjVsWq7iJ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RtajU/xM0JkvFZqJ7Nf4uF2iZiE0nK5yPJQ8l7fIR1i/sE7K9j+uHglsYT5rjO/4G LUq9n3d3msgBx+dsGR28QhSXXaQtpSA05/M1Os/bRWtjpITdX33ms66GPMx4jjHfSp N/gyvlDR0Z0Sa9HGNzsrW7PFhaEJ6bXOnDiaqcc2bBz4qxnF5mDYFo4vIjLSdUIlYS hLuSWjCx7wYdmbuOVDuo4knHlVBqZ0X43uXNf6uBQwciTyK4rua1zJpO9VCAloIxjy CJB5s45etREBQlrAIYhFvuYZS2hrBrm2Uq66BCtgYkUmttfX0yqF2uyTksbIkjEW4G R7dBFJyiC/J7Q== Received: from mchehab by mail.kernel.org with local (Exim 4.95) (envelope-from ) id 1oBYhH-0050Ll-Q7; Wed, 13 Jul 2022 10:30:19 +0100 From: Mauro Carvalho Chehab Cc: =?UTF-8?q?Piotr=20Pi=C3=B3rkowski?= , Alan Previn , Daniel Vetter , Daniele Ceraolo Spurio , David Airlie , Jani Nikula , John Harrison , Joonas Lahtinen , Lucas De Marchi , Matt Roper , Matthew Brost , Mauro Carvalho Chehab , Michal Wajdeczko , Prathap Kumar Valsan , Rodrigo Vivi , Tvrtko Ursulin , Umesh Nerlige Ramappa , Vinay Belgaumkar , dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 12/21] drm/i915/guc: Introduce TLB_INVALIDATION_ALL action Date: Wed, 13 Jul 2022 10:30:09 +0100 Message-Id: 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=-7.7 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: Piotr PiĆ³rkowski Add a new way to invalidate TLB via GuC using actions 0x7002 (TLB_INVALIDATION_ALL). Those actions will be used on upcoming patches. Signed-off-by: Piotr PiĆ³rkowski Cc: Michal Wajdeczko Signed-off-by: Mauro Carvalho Chehab --- See [PATCH 00/21] at: https://lore.kernel.org/all/cover.1657703926.git.mchehab@kernel.org/ drivers/gpu/drm/i915/gt/uc/abi/guc_actions_abi.h | 1 + drivers/gpu/drm/i915/gt/uc/intel_guc.c | 14 ++++++++++++++ drivers/gpu/drm/i915/gt/uc/intel_guc.h | 1 + 3 files changed, 16 insertions(+) diff --git a/drivers/gpu/drm/i915/gt/uc/abi/guc_actions_abi.h b/drivers/gpu/drm/i915/gt/uc/abi/guc_actions_abi.h index 14e35a2f8306..fb0af33e43cc 100644 --- a/drivers/gpu/drm/i915/gt/uc/abi/guc_actions_abi.h +++ b/drivers/gpu/drm/i915/gt/uc/abi/guc_actions_abi.h @@ -138,6 +138,7 @@ enum intel_guc_action { INTEL_GUC_ACTION_PAGE_FAULT_NOTIFICATION = 0x6001, INTEL_GUC_ACTION_TLB_INVALIDATION = 0x7000, INTEL_GUC_ACTION_TLB_INVALIDATION_DONE = 0x7001, + INTEL_GUC_ACTION_TLB_INVALIDATION_ALL = 0x7002, INTEL_GUC_ACTION_STATE_CAPTURE_NOTIFICATION = 0x8002, INTEL_GUC_ACTION_NOTIFY_FLUSH_LOG_BUFFER_TO_FILE = 0x8003, INTEL_GUC_ACTION_NOTIFY_CRASH_DUMP_POSTED = 0x8004, diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.c b/drivers/gpu/drm/i915/gt/uc/intel_guc.c index 5c59f9b144a3..8a104a292598 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.c @@ -945,6 +945,20 @@ int intel_guc_invalidate_tlb_guc(struct intel_guc *guc, return guc_send_invalidate_tlb(guc, action, ARRAY_SIZE(action)); } +int intel_guc_invalidate_tlb_all(struct intel_guc *guc) +{ + u32 action[] = { + INTEL_GUC_ACTION_TLB_INVALIDATION_ALL, + 0, + INTEL_GUC_TLB_INVAL_MODE_HEAVY << INTEL_GUC_TLB_INVAL_MODE_SHIFT | + INTEL_GUC_TLB_INVAL_FLUSH_CACHE, + }; + + GEM_BUG_ON(!INTEL_GUC_SUPPORTS_TLB_INVALIDATION(guc)); + + return guc_send_invalidate_tlb(guc, action, ARRAY_SIZE(action)); +} + /** * intel_guc_load_status - dump information about GuC load status * @guc: the GuC diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h b/drivers/gpu/drm/i915/gt/uc/intel_guc.h index 73c46d405dc4..01c6478451cc 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.h +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.h @@ -386,6 +386,7 @@ int intel_guc_self_cfg64(struct intel_guc *guc, u16 key, u64 value); int intel_guc_invalidate_tlb_guc(struct intel_guc *guc, enum intel_guc_tlb_inval_mode mode); +int intel_guc_invalidate_tlb_all(struct intel_guc *guc); static inline bool intel_guc_is_supported(struct intel_guc *guc) { -- 2.36.1