From patchwork Thu Mar 2 00:59:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Pan X-Patchwork-Id: 13156610 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71A0CC7EE33 for ; Thu, 2 Mar 2023 00:56:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229702AbjCBA4V (ORCPT ); Wed, 1 Mar 2023 19:56:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229674AbjCBA4T (ORCPT ); Wed, 1 Mar 2023 19:56:19 -0500 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23CEF56794; Wed, 1 Mar 2023 16:56:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677718578; x=1709254578; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PevryAzFzxdZ/XWUGr+C5kejkQ3Lxn/8y5vx2rg2OzA=; b=XdSCXEYRPJCLKmV212mr/d/iX8rjphKFg12Bfkw2n0+v9c4r5ouc6xmE zyAytE72FX7+J8tmohhYNs7snjNtEBGePvrqSP+jEyfMtZH7YWbqWVJJs 1vwh4Txiv8IlssM6OlzktmuGO9SFnyh/xHn7Efww3/eVKbIIVQxyXzzpu e7ecmVc9VfekkxSfG0KIyPt7qypS5O4q6vyZV9E1JORLIZctXj7tZUWdW QGihXTHzuq1KLpiNZcZ9Uq44G6j3jseW4IexP0Ch1oVzYsfxmEFD6TLP6 zeV+tL3zvCFYQFSxcDQ0Sw990qXEkrNKxIbhOTSFU/hL9ejkJShANXnmV A==; X-IronPort-AV: E=McAfee;i="6500,9779,10636"; a="397141482" X-IronPort-AV: E=Sophos;i="5.98,226,1673942400"; d="scan'208";a="397141482" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2023 16:56:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10636"; a="624708994" X-IronPort-AV: E=Sophos;i="5.98,226,1673942400"; d="scan'208";a="624708994" Received: from srinivas-otcpl-7600.jf.intel.com (HELO jacob-builder.jf.intel.com) ([10.54.39.106]) by orsmga003.jf.intel.com with ESMTP; 01 Mar 2023 16:56:12 -0800 From: Jacob Pan To: LKML , iommu@lists.linux.dev, Jason Gunthorpe , "Lu Baolu" , Joerg Roedel , dmaengine@vger.kernel.org, vkoul@kernel.org Cc: "Robin Murphy" , "Will Deacon" , David Woodhouse , Raj Ashok , "Tian, Kevin" , Yi Liu , "Yu, Fenghua" , Dave Jiang , Tony Luck , "Zanussi, Tom" , Jacob Pan Subject: [PATCH 2/4] iommu/vt-d: Use non-privileged mode for all PASIDs Date: Wed, 1 Mar 2023 16:59:57 -0800 Message-Id: <20230302005959.2695267-3-jacob.jun.pan@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230302005959.2695267-1-jacob.jun.pan@linux.intel.com> References: <20230302005959.2695267-1-jacob.jun.pan@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org For in-kernel DMA, use non-privileged access for all PASIDs to be consistent with RID_PASID. There's no need to differentiate user and kernel for in-kernel DMA. Signed-off-by: Jacob Pan --- drivers/iommu/intel/iommu.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index a0cb3bc851ac..9e3c056e392d 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -2334,8 +2334,6 @@ static int domain_setup_first_level(struct intel_iommu *iommu, if (level != 4 && level != 5) return -EINVAL; - if (pasid != PASID_RID2PASID) - flags |= PASID_FLAG_SUPERVISOR_MODE; if (level == 5) flags |= PASID_FLAG_FL5LP;