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: 12471827 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 571D5C4320E for ; Thu, 2 Sep 2021 14:21:30 +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 26C02610E7 for ; Thu, 2 Sep 2021 14:21:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 26C02610E7 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 460886E58A; Thu, 2 Sep 2021 14:21:16 +0000 (UTC) Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by gabe.freedesktop.org (Postfix) with ESMTPS id AC1B46E56D for ; Thu, 2 Sep 2021 14:21:12 +0000 (UTC) Received: by mail-wr1-x436.google.com with SMTP id u16so3228556wrn.5 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=HOTPCj0NAQSk6wqlI+comB8sr4vsPBhPDC6vjZe2eCOiwjzDzMHatcwZvTGOSnrH8f BKXLAxpB8x+hDn9kzKFoeVr+pcXFaO/0ZLI86qrMAK4dWivIMB9KvepNgosSfEDbcacM aeixpgeS7lfwwBBW9sXGcXswYCY/ezeUe1Y/v5mTIWy+dU6bCfzqcliDOuw/lrRCgR+b R1E5eqyrtvxXNInUtigF+tadyokPKb9SxdRAiqEsa4ncqsM+vCZny/8deQREiwTdZ8wn aT+Cjc1kyOvDt5diX4VGLZgfwIk4OIxVhabM6mhl7zh8eY/7Sq+aTM7sDG6V075Mr+Dl 46Ag== X-Gm-Message-State: AOAM531e50JVZntZw4WDX78RQ9DBDk06rC4dVCOP0GIRz7FKj3OH6wUF n0luUVRZ/RdehUzV1AiQse6P6oCFkwqidg== 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 Subject: [PATCH 04/11] drm/i915: Drop code to handle set-vm races from execbuf 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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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;