Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp757806pxj; Thu, 13 May 2021 16:37:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjBkqx4QzSS2kbZL5vJlZ59UU+Y07KMGGww3K/22DUN3NNTRcT7oVBdWvsqknk8jyYE6N8 X-Received: by 2002:a05:6e02:928:: with SMTP id o8mr3550647ilt.178.1620949045104; Thu, 13 May 2021 16:37:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620949045; cv=none; d=google.com; s=arc-20160816; b=0iWyUTfAjSWtKVijX+34ocMR3EkLlDCNJloe+OMnldqq3OBYPMVcbWTE4lPjoEdtUs ROhniFtEo8KV+bOu9KVzqE1vmb5QZhORGfyD98x9aIo11W6mp1FGahTAMq3YB/N2qhgC UBcjpwDBKPtQ16P9s8OZ7es5dvArXAKuueQwoa2tekzRB4S9fgBf3WdcvbylUci3aaKi FAm29i4ItuJSjjuh6LdolWbnDts1W3cGnnX0ndS8cFJIXU2PCkcOEEA2ZHVfszVTbJJE zoBw0MvzPIYJlQXQ75Xl31uFnQTTUdd50sKU1y1EMTEYN91T6R8Fjjk1/SFSECv3CGwA z2yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:ironport-sdr :ironport-sdr; bh=TswkEOU9wqg6TeMUGUDR+vvBCtrOSk+FDtZJaqeoaHI=; b=tHzDL7IUR+BZAPFlOiLe70eqd75uibXj+H3afAKxu+XoyXNu4IkSV4obpb7gecnAtr I8lSV51jjgGZrEc8UoZpOv/F50xPdh5vFEqTGm2exUuoO5VcAzTzxlec+vEXMzaRWasv z1ySgV8k5+hIAYSkHmlnWM+7pEeywOFDRCGv3XVFbUAcveOh8L7ab7mGCG/4BjYmWICI +DHsSntnM2HrrhE+h1hnPTVapiShcuR/ud6wp4w7MIvszCBPixhLwTSYg2oeWsZF/kVV SA561UqQ7kRs7R0VQfw5PyfMAIBpR2PHzeICIy39Ctc6iHm4oF8eUSdePe3hytAILv65 3ijw== 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 d13si5602013ion.63.2021.05.13.16.37.10; Thu, 13 May 2021 16:37:25 -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 S232346AbhEMT7E (ORCPT + 99 others); Thu, 13 May 2021 15:59:04 -0400 Received: from mga01.intel.com ([192.55.52.88]:17069 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231939AbhEMT7D (ORCPT ); Thu, 13 May 2021 15:59:03 -0400 IronPort-SDR: xSSXmWVY3duG9FrBXq32+0B1MwqBK2BUa+DwhY7Qi/M1Sa2ZZp5qNRwiQ/xq4atv4x2p+LVKAP ONYX3HRz8xuA== X-IronPort-AV: E=McAfee;i="6200,9189,9983"; a="221039457" X-IronPort-AV: E=Sophos;i="5.82,296,1613462400"; d="scan'208";a="221039457" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2021 12:57:51 -0700 IronPort-SDR: E2rhr2ojxOhoRpAjEdPNGL93ipKiiRZK+7lnx6dfQRww+hfoGQuxMN/qGtSvwx8ijnGaqBaWhp Z7EHKyCqoMPQ== X-IronPort-AV: E=Sophos;i="5.82,296,1613462400"; d="scan'208";a="431411776" Received: from agluck-desk2.sc.intel.com (HELO agluck-desk2.amr.corp.intel.com) ([10.3.52.146]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2021 12:57:51 -0700 Date: Thu, 13 May 2021 12:57:49 -0700 From: "Luck, Tony" To: Jacob Pan Cc: Jason Gunthorpe , Christoph Hellwig , LKML , "iommu@lists.linux-foundation.org" , Joerg Roedel , Lu Baolu , Jean-Philippe Brucker , "Liu, Yi L" , "Raj, Ashok" , "Tian, Kevin" , "Jiang, Dave" , "wangzhou1@hisilicon.com" , "zhangfei.gao@linaro.org" , "vkoul@kernel.org" , David Woodhouse Subject: Re: [PATCH v4 1/2] iommu/sva: Tighten SVA bind API with explicit flags Message-ID: <20210513195749.GA801830@agluck-desk2.amr.corp.intel.com> References: <20210513060012.0fcc7653@jacob-builder> <20210513133834.GC1002214@nvidia.com> <20210513081050.5cf6a6ed@jacob-builder> <20210513173303.GL1002214@nvidia.com> <20210513185349.GA801495@agluck-desk2.amr.corp.intel.com> <20210513190040.GR1002214@nvidia.com> <20210513192014.GU1002214@nvidia.com> <20210513124621.01421173@jacob-builder> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210513124621.01421173@jacob-builder> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 13, 2021 at 12:46:21PM -0700, Jacob Pan wrote: > It seems there are two options: > 1. Add a new IOMMU API to set up a system PASID with a *separate* IOMMU page > table/domain, mark the device is PASID only with a flag. Use DMA APIs > to explicit map/unmap. Based on this PASID-only flag, Vendor IOMMU driver > will decide whether to use system PASID domain during map/unmap. Not clear > if we also need to make IOVA==kernel VA. > > 2. Add a new IOMMU API to setup a system PASID which points to init_mm.pgd. > This API only allows trusted device to bind with the system PASID at its > own risk. There is no need for DMA API. This is the same as the current > code except with an explicit API. > > Which option? Option #1 looks cleaner to me. Option #2 gives access to bits of memory that the users of system PASID shouldn't ever need to touch ... just map regions of memory that the kernel has a "struct page" for. What does "use DMA APIs to explicitly map/unmap" mean? Is that for the whole region? I'm expecting that once this system PASID has been initialized, then any accelerator device with a kernel use case would use the same PASID. I.e. DSA for page clearing, IAX for ZSwap compression & decompression, etc. -Tony