From mboxrd@z Thu Jan 1 00:00:00 1970 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=-10.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 E8EADC47082 for ; Tue, 8 Jun 2021 05:29:48 +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 8185C61263 for ; Tue, 8 Jun 2021 05:29:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8185C61263 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shipmail.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D79DE6EAA0; Tue, 8 Jun 2021 05:29:47 +0000 (UTC) Received: from ste-pvt-msa2.bahnhof.se (ste-pvt-msa2.bahnhof.se [213.80.101.71]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2387B6EAA0 for ; Tue, 8 Jun 2021 05:29:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by ste-pvt-msa2.bahnhof.se (Postfix) with ESMTP id 794243F60B; Tue, 8 Jun 2021 07:29:44 +0200 (CEST) Authentication-Results: ste-pvt-msa2.bahnhof.se; dkim=pass (1024-bit key; unprotected) header.d=shipmail.org header.i=@shipmail.org header.b="m06ADqIy"; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at bahnhof.se Authentication-Results: ste-ftg-msa2.bahnhof.se (amavisd-new); dkim=pass (1024-bit key) header.d=shipmail.org Received: from ste-pvt-msa2.bahnhof.se ([127.0.0.1]) by localhost (ste-ftg-msa2.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id M1P77z5_ri77; Tue, 8 Jun 2021 07:29:43 +0200 (CEST) Received: by ste-pvt-msa2.bahnhof.se (Postfix) with ESMTPA id 3236B3F5EC; Tue, 8 Jun 2021 07:29:42 +0200 (CEST) Received: from [192.168.0.209] (h-155-4-205-35.A357.priv.bahnhof.se [155.4.205.35]) by mail1.shipmail.org (Postfix) with ESMTPSA id B0C333601A1; Tue, 8 Jun 2021 07:29:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=shipmail.org; s=mail; t=1623130182; bh=h1xib0KAM/i25TNMblA0avEO3xMMOfGINH7nEfBOzTE=; h=Subject:To:References:From:Date:In-Reply-To:From; b=m06ADqIywrorcYQ18VCTMLsfSIjD2GMJQpKYjTfdilv7KSJ4Xzmm56NFGpd7VyUxs 3M0mjSD2hyRGplgMAF/UoKB7EMWixaphT95hNe6OnzBXj0LVDloxB5wYSiMbQgip+A UHgmldzGGgFq5xketmgPFKy3bL7WpfwYsYJohJUw= Subject: Re: [PATCH 01/10] drm/ttm: allocate resource object instead of embedding it v2 To: =?UTF-8?Q?Christian_K=c3=b6nig?= , matthew.auld@intel.com, dri-devel@lists.freedesktop.org References: <20210602100914.46246-1-christian.koenig@amd.com> <78dbb6a2-99f3-2362-8d74-6489e78df21a@gmail.com> <94009311-6161-19ae-d846-59fb396a69b6@shipmail.org> <6d316dfe-0378-8284-1f8e-29caf5619e34@gmail.com> From: =?UTF-8?Q?Thomas_Hellstr=c3=b6m_=28Intel=29?= Message-ID: Date: Tue, 8 Jun 2021 07:29:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <6d316dfe-0378-8284-1f8e-29caf5619e34@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US 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" Hi, On 6/7/21 7:59 PM, Christian König wrote: > > > Am 07.06.21 um 19:58 schrieb Thomas Hellström (Intel): >> >> On 6/7/21 7:54 PM, Christian König wrote: >>> >>> >>> Am 07.06.21 um 19:06 schrieb Thomas Hellström (Intel): >>>> >>>> On 6/7/21 6:40 PM, Thomas Hellström (Intel) wrote: >>>>> >>>>> On 6/2/21 12:09 PM, Christian König wrote: >>>>> ... >>>>>> @@ -728,14 +728,15 @@ static int ttm_bo_add_move_fence(struct >>>>>> ttm_buffer_object *bo, >>>>>>    */ >>>>>>   static int ttm_bo_mem_force_space(struct ttm_buffer_object *bo, >>>>>>                     const struct ttm_place *place, >>>>>> -                  struct ttm_resource *mem, >>>>>> +                  struct ttm_resource **mem, >>>>>>                     struct ttm_operation_ctx *ctx) >>>>>>   { >>>>>>       struct ttm_device *bdev = bo->bdev; >>>>>> -    struct ttm_resource_manager *man = ttm_manager_type(bdev, >>>>>> mem->mem_type); >>>>>> +    struct ttm_resource_manager *man; >>>>>>       struct ww_acquire_ctx *ticket; >>>>>>       int ret; >>>>>>   +    man = ttm_manager_type(bdev, (*mem)->mem_type); >>>>> >>>>> Isn't (*mem) uninitialized here? Should be place->mem_type? >>>>> Eviction is immediately sent to the bushes. >>>>> >>>>> Got at least one additional NULL pointer deref to track down in >>>>> the eviction code, but could be a merge error of mine as well. >>>> >>>> Actually this last one was probably due to a bad temporary fix of >>>> the above one. >>> >>> I've found one more warning during my testing now. But that is just >>> a false positive. >>> >>> Apart from that I haven't seen any other fallout, but fingers crossed. >> >> vmwgfx doesn't seem to happy. It works AFAICT., but warns in >> vmw_move() about ttm_bo_assign_mem() replacing an existing resource. > > Yeah, that's the one I've just fixed. Patch is underway. If that's the move_to_ghost patch, I don't think that would fix the vmwgfx issue, as IIRC vmwgfx ever uses ghost objects. /Thomas