Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp184972rwl; Tue, 28 Mar 2023 23:39:39 -0700 (PDT) X-Google-Smtp-Source: AKy350aWa+ny7IQcd8yVIEey8qogBYU3NnS9oKhVCoDswAVP6GMyd+E+jHs0KW8ETtDACGB6ZtM0 X-Received: by 2002:a17:906:6189:b0:944:6d88:206 with SMTP id sl9-20020a170906618900b009446d880206mr11776661ejc.71.1680071979478; Tue, 28 Mar 2023 23:39:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680071979; cv=none; d=google.com; s=arc-20160816; b=TJZ3QOXL+1NklzQZe/XghrfYUvc9bk8JzULcEWcvrJ7fN7jRDyeY5IssLHKYc9n5oF 3KcbaArqATg3zMiZZeeZNpqS27kGQfxS3I/GOvLR/Nf1r12I/D0Uh0mqfrBzAHiyE5pM K7nAbpJwGn3jS+e5LcuCkchP6x6QSdYtGylVl4fBNRcJB9tKhYmneevZlQAn8zPSoIZd 1CYl6jF5/e0R7dHGhsXPPRJYpY0larodYcLBeoNrykz0LToAMKyTZXaqx7V5Oi870GAb N2Rj/tGvkXnkbNUqJ0bW76j8ecOX9asO0fmsxwoWhZ0i1zVLLwvWz2vpu24Z0s4PlmpZ 0Hdw== 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=QWvc/IN0EIGsHIhZrBZo0n72QhMhV1y0KCy01a81M0U=; b=lciZWiL7NzwsCiNNHO/HSc3CvkPObyTeyf5sCZNLKfAfSwzFtwiwxlOg35tEoqaoiH aDd+It+iDXBcODJ7PUj7Lgz/TVUV+bsBCqsdSh1U6MhIgwZjlJlYzHHi4c9AOXH1eQDe xGNUAaC/e4QhpEARaw7qHCMHHZNWxJbWXwCn92Uhh2GZrhBgT2ngvEPMLANy5RXkTJvx PXcPns7uOsOw6uSeAA5ZlwhoCSuS52+7Q6146F/I5ZjLq/Z7fNroTu4Zyw6KKM0i4JCH XHJita8gmCKaWxAzIb4sMENpP3Edb5WNQLDdOALxDCik+F0bZ4M4yPRv5FqEHc84vTGV Co9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NpDTAfXY; 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 n8-20020a170906b30800b0093182033b89si32187222ejz.711.2023.03.28.23.39.11; Tue, 28 Mar 2023 23:39:39 -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=NpDTAfXY; 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 S229551AbjC2GNE (ORCPT + 99 others); Wed, 29 Mar 2023 02:13:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229546AbjC2GND (ORCPT ); Wed, 29 Mar 2023 02:13:03 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EB231FE0; Tue, 28 Mar 2023 23:13:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680070382; x=1711606382; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=oxmXk/Jf6fYFdSfm6pbGui75cwVHE+ozCDImWBIUPGg=; b=NpDTAfXY4jHN7yqqkox92fI2O+yl7QiWl8zEHtpfe4CyPo93BO76S92S ZmoYMJB+Kml7fljNmuGpf9G8OqzfymjBV6bhUzgK9WH5IUAgAUz5Ky06r OxvLyokMH+VQp/hqz0jktRs4fj+0LNf8FbxsVl7DHiIwklvG3xotH1UO6 LtPbC0xeymhz1KGYNgt6AQYw9gvA3Pj2s98+43aPASmJcg3e4jpiIyhX/ ColLTn1qWMqzfu6jWJLNS2EQIipdZsqX9rydchxKNtYN1n4ZaNRlBrIBE cUz6+HDO23p9rWTJcIDubRPN1+yzfBzlNn+0ScP2QXPSTnE4OUSt4VErQ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="329254925" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="329254925" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2023 23:13:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="661476319" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="661476319" Received: from allen-box.sh.intel.com (HELO [10.239.159.48]) ([10.239.159.48]) by orsmga006.jf.intel.com with ESMTP; 28 Mar 2023 23:12:56 -0700 Message-ID: <709827a9-da98-1751-c69c-e2b883784093@linux.intel.com> Date: Wed, 29 Mar 2023 14:13:14 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Cc: baolu.lu@linux.intel.com, LKML , iommu@lists.linux.dev, Jason Gunthorpe , Joerg Roedel , dmaengine@vger.kernel.org, vkoul@kernel.org, Robin Murphy , Will Deacon , David Woodhouse , Raj Ashok , "Tian, Kevin" , Yi Liu , "Yu, Fenghua" , Dave Jiang , Tony Luck , "Zanussi, Tom" Subject: Re: [PATCH v2 4/8] iommu/vt-d: Reserve RID_PASID from global SVA PASID space Content-Language: en-US To: Jacob Pan References: <20230327232138.1490712-1-jacob.jun.pan@linux.intel.com> <20230327232138.1490712-5-jacob.jun.pan@linux.intel.com> <41d31adf-577e-431c-c400-2708885400c1@linux.intel.com> <20230328092919.372f0545@jacob-builder> <20230328135200.139f280a@jacob-builder> From: Baolu Lu In-Reply-To: <20230328135200.139f280a@jacob-builder> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 3/29/23 4:52 AM, Jacob Pan wrote: > On Tue, 28 Mar 2023 09:29:19 -0700, Jacob Pan > wrote: > >>>> On VT-d platforms, RID_PASID is used for DMA request without PASID. We >>>> should not treat RID_PASID special instead let it be allocated from >>>> the global SVA PASID number space. >>> It's same to AMD and ARM SMMUv3, right? They also need an explicit >>> reservation of PASID 0. >>> >> yes, all IOMMU drivers need to do that. I will give it a try but might >> need help to place the call. > It might be simpler to just let SVA code allocate from 1 up instead of 0 > (as is in the current code). Global PASID allocator would still allow the > full range from 0 to max. Then there is no change to architectures that > don't support non-zero RID_PASID. For VT-d, it would still work in the > future when we have nonzero RID_PASID. is that reasonable? Yes. It's reasonable from the status quo. Best regards, baolu