Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp533286imw; Fri, 8 Jul 2022 07:17:34 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ucygk+wyAsBFIEoL/ZTNR/yTgvzXfeSfO+7Frk7jSm061dUyJsP2DMC6ErwyBw4JUMHZfc X-Received: by 2002:a17:90b:4b49:b0:1ef:a03e:b671 with SMTP id mi9-20020a17090b4b4900b001efa03eb671mr86828pjb.108.1657289854663; Fri, 08 Jul 2022 07:17:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657289854; cv=none; d=google.com; s=arc-20160816; b=kRspd5KwMKMkexjQtGsHQx17RsfPXYUPW7GS3DfVdRvJT6wkoRwGaaGiQhZD7gcL/K QccxoLHGdZXgvsHRCpCWKvFk6tppv9Beeay/tJnj+ezixeiA/7Bq3ByYZfyg8cNwgEt1 W2IiERcB4iUwvI3+350hmKo0yAFjiZgIsTBv6ib+j8/jjP/Cg0VFhigUpVZ/IYfA1A8F 1dqjtPhbvecGqN0p7wRL3h5HafCjEvUGT4BUqx5HeXSQReTxL8ThaonATIkDs8/GtQ6d 7ahU5d95fQ7GmfLUphKh+km7RNpMQpXGw+WR8kbaG1qzeQJzSKKoZQryoCBWCycOZ1Zf 2zkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=uPitJXYakxF7391ONyTBKBgDO8CjjqAM4k/TCX3LeYo=; b=Uy+jPjZpHh2go22eBYK09s87iExmU0XM8cntETppLbigJrqfCvXfu7eriFf5r/NzTV bJZaCeQUc91YVNj99/prjmdJ164cgUh3+0R0RrC8E6mCFjGef+MoMhoexhY/cXJXXZOl JZC3Ld5+8ODG7l3MZMSKkIgKXGfy29HPeR3qysfJmwZUhX8YZKcEvJTFCVY5v/GjhqvX Q3YtIOEeGE9BQ41NkkySLEcnYskNRGMCVjiDd5abIU1741c5NLdXzcf2aEVnwTpaqtw2 q/dPEL7yL2LKqdkRFLnsvh06ona5gVDJEAuhgBgnFNB++kt/U5hBqzxGOp4HfWQM0FUH oJZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=R0CLTGeY; 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=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 30-20020a17090a019e00b001efd8672fc6si2545687pjc.86.2022.07.08.07.17.10; Fri, 08 Jul 2022 07:17:34 -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=pass header.i=@collabora.com header.s=mail header.b=R0CLTGeY; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238058AbiGHNbu (ORCPT + 99 others); Fri, 8 Jul 2022 09:31:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231918AbiGHNbt (ORCPT ); Fri, 8 Jul 2022 09:31:49 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3E462F390 for ; Fri, 8 Jul 2022 06:31:48 -0700 (PDT) Received: from [192.168.178.53] (82-71-8-225.dsl.in-addr.zen.co.uk [82.71.8.225]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: bbeckett) by madras.collabora.co.uk (Postfix) with ESMTPSA id E7B9966019BD; Fri, 8 Jul 2022 14:31:46 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1657287107; bh=9aqKBEmL0mePVbm0H5VgD1JSnIfv5pf2hncBFPn3xBc=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=R0CLTGeYI4w4Tf9rZXPEZvkC2OGM7L1krC9voBm79jzgDd3rImBOZZhjpBn8cMkM3 LZ78QLZTevWRBvNKLbMZIWmc3eIF9059xfwnR8IwKsPrWmhmZQY6uPsXEnDpG/kgFN F3qo/6O0n4njt5VADrPuLpnJUP/UB+gfiCUi7OMY8y6Kquipv3jSP2iuNFB7SzkMqr TnLZZFVo1fALcrAFRk/yhCjKOZYq58vwcb4nfhuclyMlEhTSzD9scWfcUxP+V4rvXw PEBV+Ye/ZfIz7bvOoiE9zKEy0mZdUrI7l/HwSKNhwRAekDqa70cZR0kls26d37TQSn M8d60n/WXHwSA== Message-ID: <9546dda7-48ec-58fe-d464-53338948b0d3@collabora.com> Date: Fri, 8 Jul 2022 14:31:44 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v10 04/11] drm/i915/gem: selftest should not attempt mmap of private regions Content-Language: en-US To: Matthew Auld , dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter Cc: =?UTF-8?Q?Thomas_Hellstr=c3=b6m?= , kernel@collabora.com, linux-kernel@vger.kernel.org References: <20220707200230.1657555-1-bob.beckett@collabora.com> <20220707200230.1657555-5-bob.beckett@collabora.com> <6e387f90-dce3-486d-83e9-26a975777265@intel.com> <08d33248-be80-15ab-d245-a6e23fe55423@collabora.com> <68231920-8eef-1e10-df40-ac8cd0dd0802@intel.com> From: Robert Beckett In-Reply-To: <68231920-8eef-1e10-df40-ac8cd0dd0802@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/07/2022 14:27, Matthew Auld wrote: > On 08/07/2022 14:22, Robert Beckett wrote: >> >> >> On 08/07/2022 08:53, Matthew Auld wrote: >>> On 07/07/2022 21:02, Robert Beckett wrote: >>>> During testing make can_mmap consider whether the region is private. >>> >>> Do we still need this with: 938d2fd17d17 ("drm/i915/selftests: skip >>> the mman tests for stolen") ? >> >> huh, I guess not. That wasn't in my tree. I guess I should rebase. >> >> Looking at it, my patch would have been preferable initially I think. >> Each location of the additional checks in that patch first call >> cam_mmap(), which I think is the most appropriate place to make the >> decision. > > It fails at the object_create() I think (on small-BAR I mean), which is > before we can call can_mmap(), passing in the object. ah, okay. That makes sense to keep as is then. I'll drop this patch. Thanks. > >> >> I could do a replacement patch that reverts that one if preferred, or >> we can leave it as is and I will drop this patch. >> >> >>> >>>> >>>> Signed-off-by: Robert Beckett >>>> Reviewed-by: Thomas Hellström >>>> --- >>>>   drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c | 3 +++ >>>>   1 file changed, 3 insertions(+) >>>> >>>> diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c >>>> b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c >>>> index 5bc93a1ce3e3..76181e28c75e 100644 >>>> --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c >>>> +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c >>>> @@ -869,6 +869,9 @@ static bool can_mmap(struct drm_i915_gem_object >>>> *obj, enum i915_mmap_type type) >>>>       struct drm_i915_private *i915 = to_i915(obj->base.dev); >>>>       bool no_map; >>>> +    if (obj->mm.region && obj->mm.region->private) >>>> +        return false; >>>> + >>>>       if (obj->ops->mmap_offset) >>>>           return type == I915_MMAP_TYPE_FIXED; >>>>       else if (type == I915_MMAP_TYPE_FIXED)