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=-8.1 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,HK_RANDOM_FROM,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 AF191C433E2 for ; Wed, 9 Sep 2020 13:44:07 +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 5D76821556 for ; Wed, 9 Sep 2020 13:44:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D76821556 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AF24C6E14D; Wed, 9 Sep 2020 13:44:06 +0000 (UTC) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5E9096E14D for ; Wed, 9 Sep 2020 13:44:05 +0000 (UTC) IronPort-SDR: iZZayal1OrZMOBCTs/Nhyq+YbarFaw/o4zSCP44PcPTA690rPMCZ5R1rGZNVuAK5YiismJEOYT Gf3y3igEivSw== X-IronPort-AV: E=McAfee;i="6000,8403,9738"; a="219885929" X-IronPort-AV: E=Sophos;i="5.76,409,1592895600"; d="scan'208";a="219885929" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2020 06:44:04 -0700 IronPort-SDR: 8kuEQp118vD4bOboDVNYnpElr9z682lyyZpV1Be2jWBXwvKu/ME3IO3AmbouqqE5jCwmG3P28Q vF2aFZzPUt3g== X-IronPort-AV: E=Sophos;i="5.76,409,1592895600"; d="scan'208";a="336773268" Received: from vdc-station-04.ger.corp.intel.com (HELO [10.251.165.91]) ([10.251.165.91]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2020 06:44:01 -0700 To: Chris Wilson , Intel-gfx@lists.freedesktop.org References: <20200909124457.296845-1-tvrtko.ursulin@linux.intel.com> <159965658319.2410.1208794152045447402@build.alporthouse.com> From: Tvrtko Ursulin Organization: Intel Corporation UK Plc Message-ID: <9b473e8f-b26c-21c9-52c6-5c7e676658b0@linux.intel.com> Date: Wed, 9 Sep 2020 14:43:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <159965658319.2410.1208794152045447402@build.alporthouse.com> Content-Language: en-US Subject: Re: [Intel-gfx] [PATCH] drm/i915: Fix DMA mapped scatterlist walks 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: , Cc: Tom Murphy , Matthew Auld , Logan Gunthorpe , Lu Baolu Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On 09/09/2020 14:03, Chris Wilson wrote: > Quoting Tvrtko Ursulin (2020-09-09 13:44:57) >> From: Tvrtko Ursulin >> >> When walking DMA mapped scatterlists sg_dma_len has to be used since it >> can be different (coalesced) from the backing store entry. >> >> This also means we have to end the walk when encountering a zero length >> DMA entry and cannot rely on the normal sg list end marker. >> >> Both issues were there in theory for some time but were hidden by the fact >> Intel IOMMU driver was never coalescing entries. As there are ongoing >> efforts to change this we need to start handling it. > > Does this change anything if we were already feeding in coalesced > entries? I doubt we made all sg generators compact the lists though. I don't think so. My takeaway from this was a realization that page and dma coalescing can be completely different (more so once the iommu patches get in). I did not think of any other problems as long as the dma remapping fits into the number of available sg table entries we allocated. It is just a bit weird, this duality of sg_table "views". > The change looks reasonable, it seems you have kept the dma and page > iterators distinct, which was the only worry that occurred to me. It surprised me we have two iterators, well one and a half. The sgt_dma one being the half of an iterator. :) Regards, Tvrtko P.S. Well as I was writing this reply full test results came in and something is still broken, so scratch that.. _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx