Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp911407rwb; Fri, 23 Sep 2022 05:59:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM621JMew8RylQVPdfmpH3VgtDXJEUuUgls7sfBYN2/qruizcpGb+EFUoTnRjTkgJ2YGhzvc X-Received: by 2002:a17:907:2724:b0:779:7545:5df6 with SMTP id d4-20020a170907272400b0077975455df6mr6877199ejl.325.1663937985394; Fri, 23 Sep 2022 05:59:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663937985; cv=none; d=google.com; s=arc-20160816; b=zLMgGXaI02FZsfqLWRl/TwfBp8zY1vp5afN3pJUHDRH/E1sf/HNE7oxP8b/Rgu23q4 v8Qhj/1UWU/qCnWBDmXvOYiuabbO7DATjKx7GFs+Prpl6Sooi7xDhJebC7P8h5yIA0QE kRldQ6gbfhgbaagdVYGfZytafRYdI9aaxKiJGvz+wPn6yhlwFhqMW5otGTc0RlMs/HzN T5/CewgjgUgi6/MjdOtrOWwuN/KXyjjfyXkCIQgJ6N4nmb/uWIfqGw3mJUWy2ymKV7Ub 18IoL/2j7mo3FjcV56Npea+8V7f8LEwlYgciQolX5uTZXCjl8yatbBBbFyeqMDg5RDAz ZuVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=336xS3gMy7y/j7ViDR2mLUe4GMCUaNESGMJRcs+CWcU=; b=rMd8umBSwCLmCZrrNZ4GEdK/dLbWrHPN/EgDd6/LRjB9HB7YNXixWV5cDGNc4RjuYg qxzHvZ9g3Yc1g3UmdSGgYCJAFqLXJO1MSErbVgUW6ba4oK5tt4UbACOaW+IuFekbaSEV mX2M7XEjeCnL2lAHxjFMO2xZZt7rEtIJhMw+62zL1MjGG2DuE2H6/4CGVfno32NAlR7F mOvD1kSH2mGCWxnAIKP0y9ThMPj1LlyaAJiOpx807qyQxS4zJkQq03k6FLm5s/FwTS/7 vlLAYB7XlqQ6oBeZBDH3IuMPVz73CblvaC7QbWtKOv50lcMKOKRN94Cxv4Mbj53KKNH0 ToUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Ab70J8IV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id he36-20020a1709073da400b00734b2821879si8518171ejc.898.2022.09.23.05.59.10; Fri, 23 Sep 2022 05:59:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Ab70J8IV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231317AbiIWMmI (ORCPT + 99 others); Fri, 23 Sep 2022 08:42:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231221AbiIWMmF (ORCPT ); Fri, 23 Sep 2022 08:42:05 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88A71132FF1; Fri, 23 Sep 2022 05:42:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663936923; x=1695472923; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=clNq8dpfrkH+SH9w6jXyZ7MWDXW18Peooue3eo5KpHE=; b=Ab70J8IVb/lJBswTapg3vuIizgdN8mgkuM3UODM41z6nUES7Z9j3djd8 c7Mq9lTf8iR6jmiCHxDhoEZpYI/Wt+ARscU1RRxUmox9BwVGxqf2Gfm3F C2gXvS7HUDdNniHJuEOkXym3WwfqlD2m/aD/DwGIy9tnq2VCpXV+tJ283 /RSP1KRzWVoZ6Dgj3WWiE8Kl71OmMzMqKKNZVMrdnuge88frJxFMYORVf xrWglKDgMkA4OQdOJbz4Udcew8Afc4jYNAfo33ISPI73tnL5h0usUW8h9 ifqOY7MN9CmFDQOIXOeNx8/SkaoP8U47E14z2fkcTCifgKkkdVnUYUGH8 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10479"; a="362394485" X-IronPort-AV: E=Sophos;i="5.93,339,1654585200"; d="scan'208";a="362394485" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2022 05:42:03 -0700 X-IronPort-AV: E=Sophos;i="5.93,339,1654585200"; d="scan'208";a="653387301" Received: from blu2-mobl3.ccr.corp.intel.com (HELO [10.254.214.140]) ([10.254.214.140]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2022 05:41:58 -0700 Message-ID: Date: Fri, 23 Sep 2022 20:41:56 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Cc: baolu.lu@linux.intel.com, Joerg Roedel , Christoph Hellwig , Bjorn Helgaas , Kevin Tian , Ashok Raj , Will Deacon , Robin Murphy , Jean-Philippe Brucker , Dave Jiang , Fenghua Yu , Vinod Koul , Eric Auger , Liu Yi L , Jacob jun Pan , Zhangfei Gao , Zhu Tony , iommu@lists.linux.dev, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v13 07/13] iommu/vt-d: Add SVA domain support Content-Language: en-US To: Jason Gunthorpe References: <20220906124458.46461-1-baolu.lu@linux.intel.com> <20220906124458.46461-8-baolu.lu@linux.intel.com> <075278e0-77ce-2361-8ded-6cd6bb20216f@linux.intel.com> From: Baolu Lu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/9/23 20:15, Jason Gunthorpe wrote: > On Fri, Sep 23, 2022 at 10:21:51AM +0800, Baolu Lu wrote: > >> At the beginning of this project, I wanted to consolidate the mm >> notifications into the core. However, ARM SMMUv3 and Intel handle the mm >> notifications a little differently. Then I decided to do this work >> separately from the current series. > > It doesn't look really different.. They are essentially the same, but slightly different. For example, arm smmuv3 provides .free_notifier, and I don't think it could be merged to the release callback. > > The SVA iommu domain needs two new ops triggered by the notifier: > > - 'stop using the mm, subsitute a blocking domain' tied to release > - Cache invalidate a range, maybe this is just iotlb_sync_map() > > And we could even think about the first as the core code literally > attaching a dummy blocking domain and releasing the SVA domain. There > is no reason we need to have every driver do this tricky bit of > lifecycle management. Yes. I have similar ideas. We can further discuss it with the real code later. Best regards, baolu