Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4573698ybg; Tue, 29 Oct 2019 09:09:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVN/+rB0Yg68nfe6r2lSZX7XDhBBLZ3bQtGssXTPxIab+Pmu85/mCxIn9kT3GfsxncHfbQ X-Received: by 2002:a17:906:34c8:: with SMTP id h8mr4015212ejb.135.1572365352722; Tue, 29 Oct 2019 09:09:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572365352; cv=none; d=google.com; s=arc-20160816; b=A/EVLaR0jILTJ17pQrJ4941d2LynfuVh/JpEdHHXFApQvfF17NyF9ax88wctmhnFCG iIFY/Sfd8ORbHUI2IwhYGOMZpRdZBQkgXu2FyMt42UFWccDo/G8y4BrLfb3JcXfieSQ8 G7h0BYT+zvUOhpUfI1CQJ8cYT66V4E2HjWyhUTanW90G8ZdCN0NEJHrZqDpR+ovVBpul 9f/MHz+kuAdnYwK9glQEeCeItND1cUQX51NZDv5yhHiXzIEPnYThGOOIrrqyh4Re4Lum wYDStvH52K2YikzPlxd22KmuUzD5L/AF0uV5db6no9TAAuv1yPT9JtWQE0nNw0qAVyyR XVHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=YyyZlEQ/GcgNT4w6OHARxmFD4mwy8EDoLotpp1XwzrI=; b=dlKTkvjneEr0NtC/uqouuikQ1VwLEbKkbWMiVfbVfBIl8nsD9ZXLF+RTH3SBDH0zbw GFCO9LKR1l0g3xTdj4ZZrOHLWUxgtM/7saLW7Rq3kwPaauRnI0/SevJhuiR08ee54ZlP hj5QssnnDaRtfsc/sVtfeBAiOxr+5KeVDngAy3qvYQ9JnZv1+DSfawaDTMwIbbpfCKDq Lkz5h3jCHWKPjT0NvwW6szrLv8po/ObSjGWWtFU3l+qvmXD1XwqWITVPclmP7TRfrp+J Eq2mgL7AHaMIbmXSzLid3fcQpyI4VN9jgmFpaE9Sq24uq9L4LbLSGNk508c/DN7JM2So Q/Xw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id u6si6044484ejx.348.2019.10.29.09.08.47; Tue, 29 Oct 2019 09:09:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S2390273AbfJ2QHQ (ORCPT + 99 others); Tue, 29 Oct 2019 12:07:16 -0400 Received: from mga17.intel.com ([192.55.52.151]:62698 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390135AbfJ2QHP (ORCPT ); Tue, 29 Oct 2019 12:07:15 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Oct 2019 09:07:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,244,1569308400"; d="scan'208";a="283283458" Received: from jacob-builder.jf.intel.com (HELO jacob-builder) ([10.7.199.155]) by orsmga001.jf.intel.com with ESMTP; 29 Oct 2019 09:07:14 -0700 Date: Tue, 29 Oct 2019 09:11:39 -0700 From: Jacob Pan To: "Tian, Kevin" Cc: "iommu@lists.linux-foundation.org" , LKML , Joerg Roedel , "David Woodhouse" , Alex Williamson , Jean-Philippe Brucker , "Liu, Yi L" , "Raj, Ashok" , Christoph Hellwig , Lu Baolu , Jonathan Cameron , Eric Auger , jacob.jun.pan@linux.intel.com Subject: Re: [PATCH v7 09/11] iommu/vt-d: Add bind guest PASID support Message-ID: <20191029091139.7ddc155f@jacob-builder> In-Reply-To: References: <1571946904-86776-1-git-send-email-jacob.jun.pan@linux.intel.com> <1571946904-86776-10-git-send-email-jacob.jun.pan@linux.intel.com> <20191025103337.1e51c0c9@jacob-builder> <20191028090231.4777c6a9@jacob-builder> Organization: OTC X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 29 Oct 2019 07:57:21 +0000 "Tian, Kevin" wrote: > > From: Jacob Pan [mailto:jacob.jun.pan@linux.intel.com] > > Sent: Tuesday, October 29, 2019 12:03 AM > > > > On Mon, 28 Oct 2019 06:03:36 +0000 > > "Tian, Kevin" wrote: > > > > > > > > + .sva_bind_gpasid = intel_svm_bind_gpasid, > > > > > > + .sva_unbind_gpasid = > > > > > > intel_svm_unbind_gpasid, +#endif > > > > > > > > > > again, pure PASID management logic should be separated from > > > > > SVM. > > > > I am not following, these two functions are SVM functionality, > > > > not pure PASID management which is already separated in > > > > ioasid.c > > > > > > I should say pure "scalable mode" logic. Above callbacks are not > > > related to host SVM per se. They are serving gpasid requests from > > > guest side, thus part of generic scalable mode capability. > > Got your point, but we are sharing data structures with host SVM, > > it is very difficult and inefficient to separate the two. > > I don't think difficulty is the reason against such direction. We > need do things right. :-) I'm fine with putting it in a TODO list, > but at least need the right information in the 1st place to tell that > current way is just a short-term approach, and we should revisit > later. I guess the fundamental question is: Should the scalable mode logic, i.e. guest SVA at PASID granu device, be perceived as part of the overall SVA functionality? My view is yes, we shall share SVA and gSVA whenever we can. The longer term, which I am working on right now, is to converge intel_svm_bind_mm to the generic iommu_sva_bind_device() and use common data structures as well. It is conceivable that these common structures span across hardware architectures, also guest vs host SVA usages. i.e. iommu_ops have iommu_sva_bind_gpasid() for SM/gSVA iommu_sva_bind_device() for native SVA Or I am missing your point completely?