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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A542FC433EF for ; Mon, 4 Oct 2021 13:54:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 88FDE61184 for ; Mon, 4 Oct 2021 13:54:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239008AbhJDN4Z (ORCPT ); Mon, 4 Oct 2021 09:56:25 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:3912 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235345AbhJDNz7 (ORCPT ); Mon, 4 Oct 2021 09:55:59 -0400 Received: from fraeml711-chm.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4HNMZ019Tfz67lgF; Mon, 4 Oct 2021 21:51:04 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml711-chm.china.huawei.com (10.206.15.60) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 4 Oct 2021 15:54:09 +0200 Received: from [10.47.27.199] (10.47.27.199) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 4 Oct 2021 14:54:07 +0100 Subject: Re: [PATCH 0/5] iommu: Some IOVA code reorganisation To: Will Deacon CC: , , , , , , , , , , References: <1632477717-5254-1-git-send-email-john.garry@huawei.com> <20211004114418.GC27373@willie-the-truck> From: John Garry Message-ID: <1ff2aeb0-a5d0-f2a4-bd5d-d8f9669a54ed@huawei.com> Date: Mon, 4 Oct 2021 14:56:49 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <20211004114418.GC27373@willie-the-truck> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.47.27.199] X-ClientProxiedBy: lhreml710-chm.china.huawei.com (10.201.108.61) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/10/2021 12:44, Will Deacon wrote: > On Fri, Sep 24, 2021 at 06:01:52PM +0800, John Garry wrote: >> The IOVA domain structure is a bit overloaded, holding: >> - IOVA tree management >> - FQ control >> - IOVA rcache memories >> >> Indeed only a couple of IOVA users use the rcache, and only dma-iommu.c >> uses the FQ feature. >> >> This series separates out that structure. In addition, it moves the FQ >> code into dma-iommu.c . This is not strictly necessary, but it does make >> it easier for the FQ domain lookup the rcache domain. >> >> The rcache code stays where it is, as it may be reworked in future, so >> there is not much point in relocating and then discarding. >> >> This topic was initially discussed and suggested (I think) by Robin here: >> https://lore.kernel.org/linux-iommu/1d06eda1-9961-d023-f5e7-fe87e768f067@arm.com/ > Hi Will, > It would be useful to have Robin's Ack on patches 2-4. The implementation > looks straightforward to me, but the thread above isn't very clear about > what is being suggested. Sure, I intentionally didn't add names to patches so avoid possible incorrect attribution. > > To play devil's advocate: there aren't many direct users of the iovad code: > either they'll die out entirely (and everybody will use the dma-iommu code) > and it's fine having the flush queue code where it is, or we'll get more > users and the likelihood of somebody else wanting flush queues increases. > I make it 5x direct users (including vdpa). Anyway, as I mentioned, I'm not totally determined to relocate the FQ code. It's just that dma-iommu is the only user today and co-locating makes the iova rcache domain info lookup easier from the FQ code. Thanks, John