Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3503574pxb; Mon, 4 Apr 2022 19:05:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxd6+2515TcXg7ouV0Dz6+iJwsMu9a5LTKTKlr8/ufgsza3zKdcqDcOrxHNyKQM5mSh54Tb X-Received: by 2002:a65:6951:0:b0:381:f10:ccaa with SMTP id w17-20020a656951000000b003810f10ccaamr878759pgq.587.1649124314932; Mon, 04 Apr 2022 19:05:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649124314; cv=none; d=google.com; s=arc-20160816; b=If/wtxrPmv8TzPQa8Mhh0u1CEl+io+LFT0Y1e7bH8rE7tmUR3EAjSN9F+HJJxLPJKB 5wj+X4sU5eEam4sDKybK39GQA7c/UxuHIfO3sFTfHol6LC3sD3/ZlE6IazGec5H8nS1Z ZQ9IqjvWBpvgZqfVQ6TyMygzNrH0M14JtIsnzU2NT3sTohsIxzr9a4Z8/VqRRIQtVrYo tSc9hGSzHwG2JYltKsHwggsBgCLMelS7B9YaaKXsHTG0rmcxZ+7HatoyYHsQ0ESF8nMl YQJvzGd+VH/hKWa6yz0za1ctf7GGXFoDCP0I8stG7OKWNlPpahxl5ioMiWmjh7VuuXGH HUZg== 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=xAH9vii6WAjaSiR2Dnu3qcA3zIWYG53SZpNLM+m9FTg=; b=rRZrHwxHy9TQ31ku/CYqnksraWP6HLqSzy3qtEdf7IF+FSLTFj+shzeoESdNVmC4uP bbqZCLXhY/2jTt8Xr1OB+GL4IxunVw64VcUtrrgul6zv/g0QZKt9oWd50w01gWLi+p+h hl/Q4NbuNX5nlbBkvVLGIREyUW+CXb2jABb2FbJ7BI874CL7bVtgp9E0nJ/74GuZ+Qa7 yyWaTyVBawYdCEPI/mbc4AYy17xFwYDGq2EyUuZqmR1t+GWm3z0M3cEzqJ3L3OQwe3+t nnPpYZHsiJzKGdKbgNxo2qOvp4qwA3m/4WmIS7TIVY88YtKdu97FMZQPRUM8fa1XlF6L pBoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dxlgT20Q; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id oj2-20020a17090b4d8200b001c6d6ea28d7si865070pjb.155.2022.04.04.19.05.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 19:05:14 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dxlgT20Q; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7AF5A21DF1A; Mon, 4 Apr 2022 17:28:10 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347585AbiDDF5c (ORCPT + 99 others); Mon, 4 Apr 2022 01:57:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235279AbiDDF52 (ORCPT ); Mon, 4 Apr 2022 01:57:28 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02EB03299B for ; Sun, 3 Apr 2022 22:55:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649051731; x=1680587731; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=VRzHUmWn6xSVl9VxnZQQsCjifYYpTLqDX0N+7W19r24=; b=dxlgT20QbBZrsOtwgshOPhhSvrsh+oc8xWUVzKpZOYggbdc+2CiwdwuZ NhK7JUpcO6MOev1YU01BojrtHMk1+2FnVxnmtolYW/FG8OkrcuhwyTgkV ywr9RA/xggYJzZTO8wz0TYdeLBhz/+DTKG9d0FJ55H/NJWYNHQhw3Wfbh cXx3ORRNcI1GCAN0UH/qS9wEi4Uj3/FcQZ0dE1MH19nfAvjebOsPDJBxI GREJdaUPZ6f1Fk6RjKL5is0klsCD1f3qpDFd2Uy7acfC9YGtI27kAPVrj jcQdnXFcp3PUnFgU4A0yik47zyMhkEgzFVYHWU41IbyuuNOjGeJhm0lb5 w==; X-IronPort-AV: E=McAfee;i="6200,9189,10306"; a="260622957" X-IronPort-AV: E=Sophos;i="5.90,233,1643702400"; d="scan'208";a="260622957" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Apr 2022 22:55:31 -0700 X-IronPort-AV: E=Sophos;i="5.90,233,1643702400"; d="scan'208";a="548533670" Received: from blu2-mobl3.ccr.corp.intel.com (HELO [10.254.214.140]) ([10.254.214.140]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Apr 2022 22:55:28 -0700 Message-ID: <9be015a3-c436-5829-b117-e0a70bc29954@linux.intel.com> Date: Mon, 4 Apr 2022 13:55:25 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Cc: baolu.lu@linux.intel.com, Joerg Roedel , Christoph Hellwig , Kevin Tian , Ashok Raj , Will Deacon , Robin Murphy , Jean-Philippe Brucker , Eric Auger , Liu Yi L , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC v2 08/11] iommu/sva: Use attach/detach_pasid_dev in SVA interfaces Content-Language: en-US To: Jason Gunthorpe , Jacob Pan References: <20220329053800.3049561-1-baolu.lu@linux.intel.com> <20220329053800.3049561-9-baolu.lu@linux.intel.com> <20220331135922.6c677117@jacob-builder> <20220331222630.GI2120790@nvidia.com> From: Lu Baolu In-Reply-To: <20220331222630.GI2120790@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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/4/1 6:26, Jason Gunthorpe wrote: > On Thu, Mar 31, 2022 at 01:59:22PM -0700, Jacob Pan wrote: > >>> + handle->dev = dev; >>> + handle->domain = domain; >>> + handle->pasid = mm->pasid; >> why do we need to store pasid here? Conceptually, pasid is per sva domain >> not per bind. You can get it from handle->domain->sva_cookie. > That is a mistake - SVA needs to follow the general PASID design - the > domain does not encode the PASID, the PASID comes from the device You are right. We should not store any pasid information in the domain. Best regards, baolu