Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4141720pxj; Tue, 11 May 2021 21:49:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqesnlNCYkFqO3WkIHTE07LRwF1It/tCFvJU2/CR0kQ9AgdBTKg7vknA7IYZq+MJQWNW5C X-Received: by 2002:a05:6602:2002:: with SMTP id y2mr10185690iod.70.1620794949771; Tue, 11 May 2021 21:49:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620794949; cv=none; d=google.com; s=arc-20160816; b=ifHZ4Nnohoha1XT/M3yjM/Wvs9sLcN4ODHH2lBGNvqr1zFAlJUoA1oUMo7mvr+7+cb t3cW4WuI93T9epDl/cv8mFOYOBkFQrNzAj5wDQfWHTEZoy8wzQryg4hlF5LL2fTMTyYf oBbR20qtmNbCQU8uDuqcVOPj5fdeyLe2397Np1CC17ST79xmtEPNfHxJelrKd3pzgDq2 eQbAH2I1LTsOM+S/eEclWCySfTIC/AON3U8F7RaSTSwANtdEUFy9hjl4Jj7Nl6HwE6e+ xQJYQ+PmN+36/Xl6fg0pGsIy1vVEyp6y3UbCMYVL6EEMEkPEv0oH1izaakYQg85pVkP/ m6OA== 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:from:references :to:subject:cc:ironport-sdr:ironport-sdr; bh=GozV/Qanw0P65Q8rjZB1E6M4/ZjUPtYUndyidms5VPc=; b=OYwbmjO59mfpvqNli9LCPaSSu7EfzynWR3RRvt6EOp13G/eHJd9sLKCLUO0mkOi8Lo 4LoVtv4jE3Gpgbo+ujoLH52SeKrkS0WF8iIB9uIi83PEPrBS6MQV6MDKbkqgSqnm8AfL 3AsOxm69oCgAVUjAhCq9PhrXHNZOuwu/+b5HBO8PlQ7OenXqCXroiQF4A5My5zK+j4zv a9kycwqF+/wG8dMyTzXuutDoPbkAmq01WMBBVfpVwfYX1HHkiTwq0py895ZkxPr8tS9G dYw7iQkh+G7fqD5pR46sZ2G7P+jT+IroQrTJd5qTpBp4O9E7hbm1/JHa4AQ9dV8UZU38 GlDg== 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 n10si25477047ilk.92.2021.05.11.21.48.44; Tue, 11 May 2021 21:49:09 -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 S229682AbhELEsv (ORCPT + 99 others); Wed, 12 May 2021 00:48:51 -0400 Received: from mga12.intel.com ([192.55.52.136]:61438 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229495AbhELEsu (ORCPT ); Wed, 12 May 2021 00:48:50 -0400 IronPort-SDR: lm5mruyCjAlZqTVgzWpdSsTzOyC6YCzGB8DaNBHbu+lOyy9ggQAzCOZH4Wv1ZvOlOUFbzbFcMH iIjOqbtQ8OlA== X-IronPort-AV: E=McAfee;i="6200,9189,9981"; a="179210148" X-IronPort-AV: E=Sophos;i="5.82,293,1613462400"; d="scan'208";a="179210148" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2021 21:47:41 -0700 IronPort-SDR: 53J1wazrS1QReixwdHkkxnR6h55hKjKPB+/AHJbpqmNp4e/76VbGCJhC1SNjmVaypT58hu5x5h SX50P3VhkV8A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,292,1613462400"; d="scan'208";a="622109218" Received: from allen-box.sh.intel.com (HELO [10.239.159.128]) ([10.239.159.128]) by fmsmga006.fm.intel.com with ESMTP; 11 May 2021 20:21:05 -0700 Cc: baolu.lu@linux.intel.com, Alex Williamson , Kirti Wankhede , Cornelia Huck , Jonathan Cameron , wanghaibin.wang@huawei.com, jiangkunkun@huawei.com, yuzenghui@huawei.com, lushenming@huawei.com Subject: Re: [RFC PATCH v4 01/13] iommu: Introduce dirty log tracking framework 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 , Jean-Philippe Brucker , Yi Sun , Tian Kevin References: <20210507102211.8836-1-zhukeqian1@huawei.com> <20210507102211.8836-2-zhukeqian1@huawei.com> <18ac787a-179e-71f7-728b-c43feda80a16@huawei.com> <55fda826-9ab6-a3a0-b17e-a4d4879f00bc@linux.intel.com> <60182a35-e151-7150-3708-4e58dd8e78da@huawei.com> From: Lu Baolu Message-ID: <36cc7267-6aa3-db54-b08c-c2dfc0bbacb6@linux.intel.com> Date: Wed, 12 May 2021 11:20:18 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <60182a35-e151-7150-3708-4e58dd8e78da@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/11/21 3:40 PM, Keqian Zhu wrote: >> For upper layers, before starting page tracking, they check the >> dirty_page_trackable attribution of the domain and start it only it's >> capable. Once the page tracking is switched on the vendor iommu driver >> (or iommu core) should block further device attach/detach operations >> until page tracking is stopped. > But when a domain becomes capable after detaching a device, the upper layer > still needs to query it and enable dirty log for it... > > To make things coordinated, maybe the upper layer can register a notifier, > when the domain's capability change, the upper layer do not need to query, instead > they just need to realize a callback, and do their specific policy in the callback. > What do you think? > That might be an option. But why not checking domain's attribution every time a new tracking period is about to start? Best regards, baolu