From patchwork Thu Sep 2 14:20:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 12471803 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58213C4320E for ; Thu, 2 Sep 2021 14:21:23 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0B704610A4 for ; Thu, 2 Sep 2021 14:21:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0B704610A4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DE1096E580; Thu, 2 Sep 2021 14:21:13 +0000 (UTC) Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5B0716E575 for ; Thu, 2 Sep 2021 14:21:12 +0000 (UTC) Received: by mail-wr1-x42b.google.com with SMTP id b6so3220034wrh.10 for ; Thu, 02 Sep 2021 07:21:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+Q2SZc1OBu1xQBPQzrxTqu3iZ4X+K3sxaf7KmCN3IvM=; b=SvpJICyHF1oxwz7/d12uqMRkDkl3v2sNCd0w9AlvRC/12mtBGpKuvrJZEMTPtpyTEc sWuOclBThUMCQpUpEcpD6M/2bzZTu36W1ZlP/a66oN6Qbp6nQ9WhVel1vvX6O7SusGER ZQvqUWNxMWv/F7irTwIJpQil7J6JlPlbVIv6w= 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=+Q2SZc1OBu1xQBPQzrxTqu3iZ4X+K3sxaf7KmCN3IvM=; b=NQ4rphp4fB2Yy9oDZZnuqkLWgpaSh6K6A88T/XtGH0l9e0FjzJ2XjyK/M/A4Ap9VFC 9kf0C54gisOsbIvj0uJM3YTL0UgMkRdIEMgnl2OnVRZOlMpnOgc6FxChOnmhKurtjRaA TBBLEoj4EYJLPdXswEdkIESDZK9BU0snRQEvdWkK7tPLzKgP0HLGORNXBufYkyq+BMwj DT5TNeormYZslm8N7Tkp05myeAgDj58iJd4HuJ/k7HjSX4+myM9GS0Rr1tRgZ01EYAUG mK99Pvei7GDGVF9OzPLZoqBUUDLZfwqpd2qwmgeNbkS0E+jdYZgPZQF/ZB3stlMf1nDQ OLUA== X-Gm-Message-State: AOAM5320KzNwjj7Bo2EUSIqoO3eTc+NPszFrrAI6Vgz2sy4UlMg6/6UG SsRyPSM2hWRV5WmqIWzLF8LEqQ== X-Google-Smtp-Source: ABdhPJwX/YExPVxVwZ3YuMF5b3ybFoOzVDIEonKd69VVqZ15OqIJ8eZrlBOpiHfPFMSqeypD9cLafw== X-Received: by 2002:a5d:6cc5:: with SMTP id c5mr3974750wrc.107.1630592470962; Thu, 02 Sep 2021 07:21:10 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id l2sm1841811wmi.1.2021.09.02.07.21.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 07:21:10 -0700 (PDT) From: Daniel Vetter To: DRI Development Cc: Intel Graphics Development , Daniel Vetter , Maarten Lankhorst , Daniel Vetter , Jon Bloomfield , Chris Wilson , Joonas Lahtinen , =?utf-8?q?Thomas_Hellstr?= =?utf-8?q?=C3=B6m?= , Matthew Auld , Lionel Landwerlin , Dave Airlie , Jason Ekstrand Date: Thu, 2 Sep 2021 16:20:50 +0200 Message-Id: <20210902142057.929669-4-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210902142057.929669-1-daniel.vetter@ffwll.ch> References: <20210902142057.929669-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 04/11] drm/i915: Drop code to handle set-vm races from execbuf X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Changing the vm from a finalized gem ctx is no longer possible, which means we don't have to check for that anymore. I was pondering whether to keep the check as a WARN_ON, but things go boom real bad real fast if the vm of a vma is wrong. Plus we'd need to also get the ggtt vm for !full-ppgtt platforms. Ditching it all seemed like a better idea. Reviewed-by: Maarten Lankhorst References: ccbc1b97948a ("drm/i915/gem: Don't allow changing the VM on running contexts (v4)") Signed-off-by: Daniel Vetter Cc: Jon Bloomfield Cc: Chris Wilson Cc: Maarten Lankhorst Cc: Joonas Lahtinen Cc: Daniel Vetter Cc: "Thomas Hellström" Cc: Matthew Auld Cc: Lionel Landwerlin Cc: Dave Airlie Cc: Jason Ekstrand --- drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c index e809aca00f72..905b1cbd22d5 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c @@ -775,11 +775,7 @@ static int __eb_add_lut(struct i915_execbuffer *eb, /* Check that the context hasn't been closed in the meantime */ err = -EINTR; if (!mutex_lock_interruptible(&ctx->lut_mutex)) { - struct i915_address_space *vm = rcu_access_pointer(ctx->vm); - - if (unlikely(vm && vma->vm != vm)) - err = -EAGAIN; /* user racing with ctx set-vm */ - else if (likely(!i915_gem_context_is_closed(ctx))) + if (likely(!i915_gem_context_is_closed(ctx))) err = radix_tree_insert(&ctx->handles_vma, handle, vma); else err = -ENOENT;