Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp3517944pxb; Tue, 7 Sep 2021 01:04:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygMz7FmqX4KnTZEP+ffXRiWq+gU5i0Yhjl0BSuIu3aQKYbkQeuagKxsgQloaffDzhMFapU X-Received: by 2002:a17:907:20d1:: with SMTP id qq17mr17371438ejb.439.1631001873529; Tue, 07 Sep 2021 01:04:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631001873; cv=none; d=google.com; s=arc-20160816; b=aAy7VD1Ufc77/coymSiKWe6MY4Qe95tshSTysM1ktG/THFyzFZLIkC9gPAxK7JSRqM mAWCxudSKzsY9edpeIJvCVDH4sp4hkW8AciLj8U39PEfopyDHmRqWaqt/vZ81mvZkYBB PUOPTrC6icloFyowaTvxstDEwQasJuurOL9UjS4Nz4wePyEeqSCRls7H4fAZVaXsnNTN CB0a4LIlp4cYNEBv3dpq0pEKeXzl+TPbFEWSfRHZjfP/ykHqMwZDmL0+HlaO0UP05IEY U2bxsrLG4SoVP7kNopADSKjZ2/ttEBxFig1qeE4Tv4T+spQwQz+JnKrh8if6Wt8wkGga V8cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :mime-version:user-agent:date:message-id:cc:to:subject:from; bh=6KgVK7n8tJX4z7SmA56Qb7pceZ6ArGwX7WASHfpFlrg=; b=Ihs8zFMwks6paRpRhVesnIMtcjRF0F9Hw07OOwaFKtvVgmcznbdS34TPi9xJdHU14Q VmMxraVmRWPHcqfA3IEvZ5PHvqw2tPcaCv2jyA/F6gyNTAWKOH6xxNGAKmFW3dSKQ0iL U8h/fP3WoL7Z/+i9U7euakOfx6uYapez7juozvFeTnpWXVjkQaXSU9Wg3asFOG/BjmLJ Micue8YcsAa3QRLe16HUSuPu33jR6jd79Xh3zjnvuvr+mQwASO29EAaTv8E25DeFAjiq ilnoHnP4ONdsOV8uDJl7CBxT1wUmtf28CyIRoZonm1SyoQcunVxRCZFlaxKmgkVdlvll CPqA== 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 q2si10142071eds.540.2021.09.07.01.04.09; Tue, 07 Sep 2021 01:04:33 -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 S241229AbhIGHoA (ORCPT + 99 others); Tue, 7 Sep 2021 03:44:00 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:9009 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240450AbhIGHnM (ORCPT ); Tue, 7 Sep 2021 03:43:12 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4H3cdk19QvzVqZY; Tue, 7 Sep 2021 15:41:14 +0800 (CST) Received: from dggema765-chm.china.huawei.com (10.1.198.207) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.8; Tue, 7 Sep 2021 15:42:04 +0800 Received: from [10.174.185.210] (10.174.185.210) by dggema765-chm.china.huawei.com (10.1.198.207) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.8; Tue, 7 Sep 2021 15:42:03 +0800 From: Kunkun Jiang Subject: [question] Assign multiple devices from different SMMUs to a arm_smmu_domain To: Robin Murphy , Will Deacon , "Linux IOMMU" , open list CC: , Zenghui Yu , "Keqian Zhu" Message-ID: Date: Tue, 7 Sep 2021 15:41:52 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [10.174.185.210] X-ClientProxiedBy: dggeme701-chm.china.huawei.com (10.1.199.97) To dggema765-chm.china.huawei.com (10.1.198.207) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, I am working on VFIO DMA dirty pages tracking based on ARM SMMU HTTU, and have done a lot of testing.In the test, I found a problem that greatly affects performance of VFIO DMA dirty pages tracking. According to the current arm-smmu-v3 driver, multiple VFIO pass-through device comes from different SMMUs will be assigned to different arm_smmu_domain. It will create page table for each arm_smmu_domain, even though these page tables are exactly the same. Bacause dirty pages tracking needs to traverse the page table, multiple page tables will make performance worse. I learned the ARM SMMUv3 spec and had some exchanges with my colleagues who work on SMMU hardware. I did not find the restriction that multiple SMMUs cannot share the same page table. We migth be able to do this like x86 IOMMU. If I have missed something, please point it out. Looking forward to your suggestions.???? Thanks, Kunkun Jiang