Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp649662pxb; Thu, 15 Apr 2021 03:22:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycUXOaC/4U/p8/hP91Sql495JOALz8IRfwH8sgkULDumRT2urAnHJmMWLk0DFzMiMctDvG X-Received: by 2002:a63:fb15:: with SMTP id o21mr2790518pgh.337.1618482144561; Thu, 15 Apr 2021 03:22:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618482144; cv=none; d=google.com; s=arc-20160816; b=YfqYrevqXd7oCI1sunixZNB/eby8FmPjF4Uk3S3P1UJlqK1H9vZRfBgEwfkoTrVsyn zl+OwD8y9diQoGVXkK4fmGRiHJ377g1flvCj8Jtyp9ih4unhvy61ehhITnBsDQ/XgX1b MNy6Q2Y6TKlVYPeEjYdjWGMDD2zge87/4pD0wmtyw3FAixfqnHdJSAg9VNe7el/AvWVQ iFZAYlPjCu8rC8qT/OACblfjP6QrmxNa13qZ26Qi25/yPpD+iWFNLEC07isuOWvn9NNO EiTwr1dSlsIsJUWZ0+H1VbVvOIA1dQCIBpC6wg484/WtYkna7M4AdTJV28VBiBEhjr9T H68w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:to:cc:ironport-sdr:ironport-sdr; bh=gY/HSiUjmDyd1tDjOrbETuQDTwFzwB28/t9wy+sipzA=; b=nDilGYVgXSsvTXPKsMH+UPInKzWRWmqfDmU66J4QDlK5lxPw29xuhMvPoBSLfABNNy N/5yv8ZykDHcSE1BI277r8tluS4EzUJq6YgWc2XLOfw6oA/peQTM+wS8It+iHWqV5A9p 9yl9iIm0tXtYBXCRPPaBMNXH9NFIOxn3pxJjNtkrWFje8xnFqW/9oIUYe4/Z0vqLkaRq ggw0aBvjfj3qNKu3kSFFeJv0GAfLdHyb5WsaKjFu3FBa9ebx2HSVxOj3dyKzwuG7KNKF gK8vgxkGkkJYgOM62ZQBGQtX5PVqsYSPAFNWEh7PtbvZDtE0u6nptiLw8iKNWX8BmgxR ibiQ== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a23si2766921pfo.115.2021.04.15.03.22.12; Thu, 15 Apr 2021 03:22:24 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231423AbhDOKVx (ORCPT + 99 others); Thu, 15 Apr 2021 06:21:53 -0400 Received: from mga14.intel.com ([192.55.52.115]:30066 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229481AbhDOKVw (ORCPT ); Thu, 15 Apr 2021 06:21:52 -0400 IronPort-SDR: OFxdEZTxUD5vuGtxvI7cj7zPElaSBhKdPlTuHWwbST1/n6FJikXJWfPqIemtAxPphVdWFFyp8m i4EW6BKEf2Fg== X-IronPort-AV: E=McAfee;i="6200,9189,9954"; a="194390027" X-IronPort-AV: E=Sophos;i="5.82,223,1613462400"; d="scan'208";a="194390027" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2021 03:21:29 -0700 IronPort-SDR: S4tkgA4j2Grn9PWxRgbOLJ6hnJxtiufe2YSOnSbpbDbhtm6EBzJKb667y0goYd/rcq3OMWvghG EvdwM4I1L0Hg== X-IronPort-AV: E=Sophos;i="5.82,223,1613462400"; d="scan'208";a="425129910" Received: from blu2-mobl3.ccr.corp.intel.com (HELO [10.254.214.126]) ([10.254.214.126]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2021 03:21:25 -0700 Cc: baolu.lu@linux.intel.com, Alex Williamson , Cornelia Huck , Kirti Wankhede , wanghaibin.wang@huawei.com, jiangkunkun@huawei.com, yuzenghui@huawei.com, lushenming@huawei.com To: Keqian Zhu , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, Robin Murphy , Will Deacon , Joerg Roedel , Yi Sun , Jean-Philippe Brucker , Jonathan Cameron , Tian Kevin References: <20210413085457.25400-1-zhukeqian1@huawei.com> <20210413085457.25400-2-zhukeqian1@huawei.com> <56b001fa-b4fe-c595-dc5e-f362d2f07a19@linux.intel.com> <88cba608-2f22-eb83-f22e-50cb547b6ee8@huawei.com> From: Lu Baolu Subject: Re: [PATCH v3 01/12] iommu: Introduce dirty log tracking framework Message-ID: <2c01425f-813c-4278-ba06-26d651496a5c@linux.intel.com> Date: Thu, 15 Apr 2021 18:21:22 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <88cba608-2f22-eb83-f22e-50cb547b6ee8@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 2021/4/15 15:43, Keqian Zhu wrote: >>> design it as not switchable. I will modify the commit message of patch#12, thanks! >> I am not sure that I fully get your point. But I can't see any gaps of >> using iommu_dev_enable/disable_feature() to switch dirty log on and off. >> Probably I missed anything. > IOMMU_DEV_FEAT_HWDBM just tells user whether underlying IOMMU driver supports > dirty tracking, it is not used to management the status of dirty log tracking. > > The feature reporting is per device, but the status management is per iommu_domain. > Only when all devices in a domain support HWDBM, we can start dirty log for the domain. So why not for_each_device_attached_domain() iommu_dev_enable_feature(IOMMU_DEV_FEAT_HWDBM) ? > > And I think we'd better not mix the feature reporting and status management. Thoughts? > I am worrying about having two sets of APIs for single purpose. From vendor iommu driver's point of view, this feature is per device. Hence, it still needs to do the same thing. Best regards, baolu