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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 1D574C433DB for ; Sun, 7 Feb 2021 10:41:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D52BC601FF for ; Sun, 7 Feb 2021 10:41:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229721AbhBGKla (ORCPT ); Sun, 7 Feb 2021 05:41:30 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:12446 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229683AbhBGKl1 (ORCPT ); Sun, 7 Feb 2021 05:41:27 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4DYQdQ19Zzzj95M; Sun, 7 Feb 2021 18:39:38 +0800 (CST) Received: from [10.174.184.42] (10.174.184.42) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.498.0; Sun, 7 Feb 2021 18:40:37 +0800 Subject: Re: [RFC PATCH 10/11] vfio/iommu_type1: Optimize dirty bitmap population based on iommu HWDBM To: Yi Sun References: <20210128151742.18840-1-zhukeqian1@huawei.com> <20210128151742.18840-11-zhukeqian1@huawei.com> <20210207095630.GA28580@yi.y.sun> CC: , , , , , Will Deacon , "Alex Williamson" , Marc Zyngier , Catalin Marinas , Kirti Wankhede , Cornelia Huck , Mark Rutland , James Morse , Robin Murphy , Suzuki K Poulose , , , , , , , From: Keqian Zhu Message-ID: <407d28db-1f86-8d4f-ab15-3c3ac56bbe7f@huawei.com> Date: Sun, 7 Feb 2021 18:40:36 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20210207095630.GA28580@yi.y.sun> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.184.42] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Hi Yi, On 2021/2/7 17:56, Yi Sun wrote: > Hi, > > On 21-01-28 23:17:41, Keqian Zhu wrote: > > [...] > >> +static void vfio_dma_dirty_log_start(struct vfio_iommu *iommu, >> + struct vfio_dma *dma) >> +{ >> + struct vfio_domain *d; >> + >> + list_for_each_entry(d, &iommu->domain_list, next) { >> + /* Go through all domain anyway even if we fail */ >> + iommu_split_block(d->domain, dma->iova, dma->size); >> + } >> +} > > This should be a switch to prepare for dirty log start. Per Intel > Vtd spec, there is SLADE defined in Scalable-Mode PASID Table Entry. > It enables Accessed/Dirty Flags in second-level paging entries. > So, a generic iommu interface here is better. For Intel iommu, it > enables SLADE. For ARM, it splits block. Indeed, a generic interface name is better. The vendor iommu driver plays vendor's specific actions to start dirty log, and Intel iommu and ARM smmu may differ. Besides, we may add more actions in ARM smmu driver in future. One question: Though I am not familiar with Intel iommu, I think it also should split block mapping besides enable SLADE. Right? Thanks, Keqian