Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3846756rwl; Mon, 27 Mar 2023 21:57:11 -0700 (PDT) X-Google-Smtp-Source: AKy350YXPqHjYAq0hhw2Z82Y2kTiTN3snWTyfPcYBugyNNwt82y448rOyQr9H1w77gV5vh0Qi7/x X-Received: by 2002:a17:906:6a2a:b0:878:711d:9310 with SMTP id qw42-20020a1709066a2a00b00878711d9310mr16883111ejc.1.1679979431706; Mon, 27 Mar 2023 21:57:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679979431; cv=none; d=google.com; s=arc-20160816; b=Gz+o5MYEa0fbv3HLV0q7Shq5agmnfmRpVlFMvQBM9i7fntoy0qcchnsTm6X4HqnpvB qLxH9IbkZuNRHFMOexknmShIFmptDda+NYoEyYm5C8DoQUjOkZTmKy18K6Gdlhybfhpv /s7PimVA4TmAXODFzI24u1ekbU9aS0IXmCX3QE8r2OVNMz+cKsgktcmqBk0IrGHpSVks gKIAFgCIXMr02dPH+8fHdgNR4V5igkOABtOpVb1eKTXsAA5ucOaKf8JJjptUtsp9EcXU 1qq2Ywn5cvCSbhjdKKpBUj8IcSsd3YdGZxtTey7xTVU+wFgZuDpvli2pApZsI7yGy9k5 V2Ug== 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=L3jYbMP3W7NutA+HQjnnBsJC14sWCMM45PuOAMsm9mA=; b=mp/y0wUYMjz2q+1e2iQSL7Ezx6I/VSDGYCAqD+D3a+sGx7HLi3dNPaxSd9ihiw6mhs Qs1+U2dezsoGK8wz5WKbfYXVbN8NJ0ySw3Jjdkg7xLFTkRSIjIWEwNit3GPt0EYFn9qa 9WjPwl5Z+4JQ1k4tNxi+NVHueKwkdDKqDy+8ypKpjzGn/aOlxytoC+CcgZWfzY9j6aiw 6XUzEow/AIn9ntdR+IsgSZh50F1kX2oao/yuCBGmJVqjlfbpZvUGaAejx3n4HgWJNXM2 aetPSj32c+x7uwLfVQkZKpi8HVu+0LkBNps9V5mIWMPITqAyBDxhzVWKyn0og9TH++2v KmOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XN2VXZJF; 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 s5-20020a170906960500b00930f5ecbd94si29197536ejx.346.2023.03.27.21.56.47; Mon, 27 Mar 2023 21:57:11 -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=XN2VXZJF; 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 S229670AbjC1E4S (ORCPT + 99 others); Tue, 28 Mar 2023 00:56:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229912AbjC1E4Q (ORCPT ); Tue, 28 Mar 2023 00:56:16 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6BCF212B; Mon, 27 Mar 2023 21:55:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679979341; x=1711515341; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=7t8HEByj4cLff00VoXO0IFf+83/zzmjcbsLyOg5ScbM=; b=XN2VXZJFAePHX7YebbfYjoTX+kLRf4P0FUSVTOmZpUAFWwJZ4jb34Za6 4qljPxDHIAvAMvR5hhmYexHlBlE+Z6AdkpltEyiQelBwlgL2mJvZZ/pzF 34EWyPCJAIuHtCkP0xukolj3kvGyz6mZi2/fr5UBNhIgq7fdJuMngX/+5 I8/36hy189nxlRGu0NK5epa9WNiU0tnSb+dhNJkaFGHmsZ8yKgXyHl+OA 4BSYN/FsJL0H5gL51zalouY3UWwWf/1Y02GL4/bskbgYhSa6PoGtKEHq6 8U2JTY16td1BmpGT+JSmVqrWp1JNJ7i7Ex0BlB55hcz2BEFmZMNoE9tC9 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10662"; a="337974778" X-IronPort-AV: E=Sophos;i="5.98,296,1673942400"; d="scan'208";a="337974778" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2023 21:55:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10662"; a="1013395525" X-IronPort-AV: E=Sophos;i="5.98,296,1673942400"; d="scan'208";a="1013395525" Received: from allen-box.sh.intel.com (HELO [10.239.159.48]) ([10.239.159.48]) by fmsmga005.fm.intel.com with ESMTP; 27 Mar 2023 21:54:57 -0700 Message-ID: <8839763d-8a40-caad-4048-0d335fb3beb9@linux.intel.com> Date: Tue, 28 Mar 2023 12:55:16 +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, Robin Murphy , Will Deacon , David Woodhouse , Raj Ashok , "Tian, Kevin" , Yi Liu , "Yu, Fenghua" , Dave Jiang , Tony Luck , "Zanussi, Tom" Subject: Re: [PATCH v2 1/8] iommu/vt-d: Use non-privileged mode for all PASIDs Content-Language: en-US To: Jacob Pan , LKML , iommu@lists.linux.dev, Jason Gunthorpe , Joerg Roedel , dmaengine@vger.kernel.org, vkoul@kernel.org References: <20230327232138.1490712-1-jacob.jun.pan@linux.intel.com> <20230327232138.1490712-2-jacob.jun.pan@linux.intel.com> From: Baolu Lu In-Reply-To: <20230327232138.1490712-2-jacob.jun.pan@linux.intel.com> 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,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/28/23 7:21 AM, Jacob Pan wrote: > Supervisor Request Enable (SRE) bit in a PASID entry is for permission > checking on DMA requests. When SRE = 0, DMA with supervisor privilege > will be blocked. However, for in-kernel DMA this is not necessary in that > we are targeting kernel memory anyway. There's no need to differentiate > user and kernel for in-kernel DMA. > > Let's use non-privileged (user) permission for all PASIDs used in kernel, > it will be consistent with DMA without PASID (RID_PASID) as well. > > Signed-off-by: Jacob Pan Reviewed-by: Lu Baolu Best regards, baolu