Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp840023ybb; Wed, 1 Apr 2020 10:34:03 -0700 (PDT) X-Google-Smtp-Source: APiQypJ8Xf3KhQWHJI3GcDDuioCDxCHAmlSpUQy3Gdm3XwITF835NC4LUrAuTwTgJb7ZSx1Dwvxu X-Received: by 2002:aca:b308:: with SMTP id c8mr3484393oif.106.1585762443749; Wed, 01 Apr 2020 10:34:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585762443; cv=none; d=google.com; s=arc-20160816; b=OtALYWzfzpAwDAhf4Qo59G9kQpPSvlFCM5Ct6S3FIcdm53+tb7Fx2QSWtiwFVE0F58 LJsHUiN7ABaFud9LYUTuonn2Ew6VqzDCjnD0pvkU/uThGV/dqm2DrtuDPJja+x9OTKty qvOvvhHmTm6bCc43ohWM/c0i1v74kkylwvnrlvJHnLuO1OxyrUq66hh38efOFvud/c6x qQGCEbUseFf3Vkcyttn4qB7mEbdL7/DkRZL/gk/6jUCgaigCxFrdYQHkPp/XhxwWu7PX N4z792TkFgmDJ2w+mtJZQhWQ5Fed7pyjFVk8x18H0wPlFcT5Z+GtVAOBhyqn842hKk1j bUfw== 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:ironport-sdr:ironport-sdr; bh=9bxgoF9GpRVD/HOdNqM/Yyy6adj3MEe4RPbqeeY/97A=; b=ouL7ikD+a/mfHamDqQph9lEtsGWx5qMKTPb1k++VqSlTD9+gQMEPh6Z6PIA0DQsYHO kD4hyTcMzvGj3WKWn9fmRmjPN7qjVUgiBRJ5kjJp7o3Yi8Yotvq7u7079OqNJV2PkAhb 398dc5OAQ/GoYu2buGO5Xie5NkRQ2tlhUqnP2n0m+Xy66HHS2QThPEWUNnnOY7opTOav 21W4JUHyQ+o9GM2n2rECndbPHi1X8YmXGZm/zQWAbacQ34l7yEMpRE4hWGW+JPnNvy+e rlIxP7vBnc3n2y0CZEm2qz5K1Zxzx9yyft7ZFrUwvxCFf8i2M+0KwrhIIjcTXU9fOD6B szoQ== 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 c7si1000550ooa.65.2020.04.01.10.33.45; Wed, 01 Apr 2020 10:34:03 -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 S1732543AbgDARHn (ORCPT + 99 others); Wed, 1 Apr 2020 13:07:43 -0400 Received: from mga07.intel.com ([134.134.136.100]:21353 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732273AbgDARHn (ORCPT ); Wed, 1 Apr 2020 13:07:43 -0400 IronPort-SDR: HC3QAmG6qRIx1aO4xUx7EN0BRwf4r1fUnkuJRCHUrhH8W7cYHZoGGjBp/CHbnt/KEUrRokEuXC /Cqa/RILpwdQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2020 10:07:42 -0700 IronPort-SDR: oQipLpnApWd0p+CgyFBkSRZiHFTfxhOuwvsqHh1iQub51HAu+NxoD5fHDo9HsHXa60RzSslzN3 Yx50zav9Uwzw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,332,1580803200"; d="scan'208";a="249528821" Received: from jacob-builder.jf.intel.com (HELO jacob-builder) ([10.7.199.155]) by orsmga003.jf.intel.com with ESMTP; 01 Apr 2020 10:07:42 -0700 Date: Wed, 1 Apr 2020 10:13:30 -0700 From: Jacob Pan To: "Tian, Kevin" Cc: Lu Baolu , "iommu@lists.linux-foundation.org" , LKML , Joerg Roedel , David Woodhouse , "Alex Williamson" , Jean-Philippe Brucker , "Liu, Yi L" , "Raj, Ashok" , Christoph Hellwig , "Jonathan Cameron" , Eric Auger , jacob.jun.pan@linux.intel.com Subject: Re: [PATCH V10 06/11] iommu/vt-d: Add bind guest PASID support Message-ID: <20200401101330.275f6e34@jacob-builder> In-Reply-To: References: <1584746861-76386-1-git-send-email-jacob.jun.pan@linux.intel.com> <1584746861-76386-7-git-send-email-jacob.jun.pan@linux.intel.com> <20200330135138.556ea8a4@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, 31 Mar 2020 03:43:39 +0000 "Tian, Kevin" wrote: > > > > struct intel_svm_dev { > > > > @@ -698,9 +700,13 @@ struct intel_svm_dev { > > > > struct intel_svm { > > > > struct mmu_notifier notifier; > > > > struct mm_struct *mm; > > > > + > > > > struct intel_iommu *iommu; > > > > int flags; > > > > int pasid; > > > > + int gpasid; /* Guest PASID in case of vSVA bind with > > > > non-identity host > > > > + * to guest PASID mapping. > > > > + */ > > > > > > we don't need to highlight identity or non-identity thing, since > > > either way shares the same infrastructure here and it is not the > > > knowledge that the kernel driver should assume > > > > > Sorry, I don't get your point. > > > > What I meant was that this field "gpasid" is only used for > > non-identity case. For identity case, we don't have > > SVM_FLAG_GUEST_PASID. > > what's the problem if a guest tries to set gpasid even in identity > case? do you want to add check to reject it? Also I remember we > discussed before that we want to provide a consistent interface > to other consumer e.g. KVM to setup VMCS PASID translation table. > In that case, regardless of identity or non-identity, we need provide > such mapping info. The solution is in flux a little. For KVM to set up VMCS, we are planning to use IOASID set private ID as guest PASID. So this part of the code will go away, i.e. G-H PASID mapping will no longer stored in IOMMU driver. Perhaps we can address this after the transition?