Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1373398pxb; Fri, 24 Sep 2021 03:08:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTNYsEDmQdinNGf+yj+qxLXnbK38N6DlJ9JQvbc/elBxqhyNAyfNiKflqEaxEtNqpOjHAN X-Received: by 2002:a6b:7314:: with SMTP id e20mr8144833ioh.176.1632478093763; Fri, 24 Sep 2021 03:08:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632478093; cv=none; d=google.com; s=arc-20160816; b=CLDjaXPTtYwLCNUIT1kvmR/Hfe6YSxIuq4Urd1C4PORiT3IPwJpqL9yDSQEhl+3/dQ ajV5XUfvqmzcHMsq7QQfB0zLB3xaIZMQvjnXNp2Tqg6U+SG1AsvBihUCwM4zN/JO1B+4 AjxjQ+AhE5QaglO05vfjyH3ZklCd6hJYXpGXqiuT7y+fUGJcJwXt/gupg6ElI+GlWBtl 4Vvb3QmY3wwWWqJJyE9Whe3EqthVlJbfa+ptakMRxR7yR7A4v0o3O/+/XFlcFZDhgU1l ptqENwdl+CjBLYWcTKl2zi2cBUn73Oqqgod/Rv+K8KdmBVFeiE3aBDKz4+fovOGvvFi3 aTyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=aOpRqJaJrg9rWPwCHuZFZw2ZzJxvJY9DWhvK7MBBIGg=; b=neXu0mfGpwDGS83w0iuIAwVncKKyqbg8vSWqGtzFoE4BWUq+SFCgl+OmA2/0E8rXcO Fvx+isdV/XLLCeMB+PtDRJSOIaop2Zqfa3S6d0gOmGLyJlagAGItWfpHPyxsp82dzgdH 9O9ovtO3z5r1VAznBJCi8cpfhgvf63GD1dIfh9vGVhREo2/H2wBgV8jglVLpldaFnrl+ FhehTWdthjFoMdchaq10ooZegs+w1/JHsCZhmW0SEcyagUiDub++EoVXka/+fI5yUdIm 6JGD4LabZ96KfAbaohDN3rXcIq4DNVRFgqPsNDo9b43JIpE5tjSiG2ZXAW+u+1ElXJaQ Idxw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v13si9180931ilh.89.2021.09.24.03.08.02; Fri, 24 Sep 2021 03:08:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245520AbhIXKIh (ORCPT + 99 others); Fri, 24 Sep 2021 06:08:37 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:3868 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245423AbhIXKIh (ORCPT ); Fri, 24 Sep 2021 06:08:37 -0400 Received: from fraeml741-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4HG71613Mlz67b9b; Fri, 24 Sep 2021 18:04:26 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml741-chm.china.huawei.com (10.206.15.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Fri, 24 Sep 2021 12:07:02 +0200 Received: from localhost.localdomain (10.69.192.58) 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; Fri, 24 Sep 2021 11:06:58 +0100 From: John Garry To: , , , , CC: , , , , , , , John Garry Subject: [PATCH 0/5] iommu: Some IOVA code reorganisation Date: Fri, 24 Sep 2021 18:01:52 +0800 Message-ID: <1632477717-5254-1-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) 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 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/ I also added in another old patch to avoid double-negatives now that the error handling is a bit better for IOVA init code: https://lore.kernel.org/linux-iommu/YAVeDOiKBEKZ2Tdq@myrica/ Baseline is v5.15-rc2 John Garry (5): iova: Move fast alloc size roundup into alloc_iova_fast() iommu: Separate flush queue memories from IOVA domain structure iommu: Move IOVA flush queue code to dma-iommu iommu: Separate IOVA rcache memories from iova_domain structure iommu/iova: Avoid double-negatives in magazine helpers drivers/iommu/dma-iommu.c | 341 +++++++++++++++++++++++--- drivers/iommu/iova.c | 343 ++++++++------------------- drivers/vdpa/vdpa_user/iova_domain.c | 61 ++--- drivers/vdpa/vdpa_user/iova_domain.h | 4 +- include/linux/iova.h | 82 +------ 5 files changed, 451 insertions(+), 380 deletions(-) -- 2.26.2