Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp198817pxb; Tue, 7 Sep 2021 22:08:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTpl1ivsNKRivrUM6owUKRXg/i2J6lzgzogUNtJdKiLnfsBZkJesJgLen58ZKgUuYafI+2 X-Received: by 2002:a02:908a:: with SMTP id x10mr1941333jaf.30.1631077690820; Tue, 07 Sep 2021 22:08:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631077690; cv=none; d=google.com; s=arc-20160816; b=0BwcBhUyiV4P79X5yQvh+d6YjgiC8yMdt7c1kTT4gc8+DZ+mo7H1uyPPpTYBE9cOAH yoqGlCfEYnMT4vj+laajaFDMixdCy/kOPvLjwehACoPYCCtvvD3rrA8v+g1PPGo1m9nd ViSm8b1rOFD3kZPDJ76YtyIYXC5zQFJQVcBILrrGarXHiXpupWOQjcj87cA6ZR16oMcO ZTsx7nd9iozyEWERD15AJt++rXW7VJe7+KBI9UZV81GcuFlFF6fHn6oqvf8H5n471A+m fdlTtArivOQe++ki4OUhgTBzlwORE7mJp5DiJz02Mjb8RTuT2vO0EXcOmKokwKSrlAPr Sa4A== 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 :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=TBon5AUDf0n1x11df88j1MlgPQdVTE2JcQoCZtGK0tc=; b=nbT9oStzaYA/7KbIIQfaSdcrLYW1YFqlGxWTca35bpOEHYnyO0+r2j3Qh6+x53Xxcb NjFYgBWrFYKNcaJkoHNuQ4s8Og4Y6j8GhtGvB2waypOL7n1RGLoUmXm/J5rTGQbSMYMT VTud1iUbomOfvTgH9BwZ3P8xY6HzsBS1k9x9Jhr7lacA1JQbmINaSb64hkILWu1JHFmt bBDyJsz4QRubMGi4L29hJIOWxhkT1ryNY5eMieC4vPIrB29uHb8b+vVTYynT/yrv7nZE AR1HKC13LpNQ67d8+qvDmVQOSgnVkxH7nqv3RWB55N9p3w6k0yN4AZCIePwEmqMS932Q 7LFw== 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 c1si1014351jaa.58.2021.09.07.22.07.58; Tue, 07 Sep 2021 22:08:10 -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 S232630AbhIHFIP (ORCPT + 99 others); Wed, 8 Sep 2021 01:08:15 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:15250 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232339AbhIHFIM (ORCPT ); Wed, 8 Sep 2021 01:08:12 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4H498H3zbjz1DGQQ; Wed, 8 Sep 2021 13:06:07 +0800 (CST) Received: from dggema765-chm.china.huawei.com (10.1.198.207) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.8; Wed, 8 Sep 2021 13:06:58 +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; Wed, 8 Sep 2021 13:06:58 +0800 Subject: Re: [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" References: <202f32cd-8036-563e-028b-781b999766be@arm.com> From: Kunkun Jiang Message-ID: Date: Wed, 8 Sep 2021 13:06:46 +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 In-Reply-To: <202f32cd-8036-563e-028b-781b999766be@arm.com> 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: dggeme709-chm.china.huawei.com (10.1.199.105) 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 On 2021/9/7 17:43, Robin Murphy wrote: > On 2021-09-07 08:41, Kunkun Jiang wrote: >> 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. > > Sure, it's not impossible, there are just a lot of fiddly > considerations, mostly around how to handle SMMU instances with > different capabilities. We haven't had a strong need to support this > case so far, so we've simply been avoiding all that complexity. Yes, there's a lot to consider here. I'll try to analyze it carefully. We can discuss some of the difficulties in the future. From the perspective of improving the performance of VFIO DMA dirty pages tracking, it is worth supporting this feature. Thanks, Kunkun Jiang > > Robin. > >> Looking forward to your suggestions.???? >> >> Thanks, >> Kunkun Jiang >> > .