Message ID | 20230411064815.31456-10-baolu.lu@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2380795vqo; Tue, 11 Apr 2023 00:12:16 -0700 (PDT) X-Google-Smtp-Source: AKy350b89mDS4blLSqnGQQpvOgf5HalQq4NnUhH92f7KSsXmsCKf0VMFAJFN62iLyci9Iiwx8tut X-Received: by 2002:a17:903:2347:b0:1a6:413c:4a54 with SMTP id c7-20020a170903234700b001a6413c4a54mr7403267plh.1.1681197136558; Tue, 11 Apr 2023 00:12:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681197136; cv=none; d=google.com; s=arc-20160816; b=PASaXPD0pZpcSfOlpbgp0KPPZb80MW7eInbdzQHq8ofL2EL4vR6CsDUHzTml/D9Vse vkhblZN7IPT764oIfd2COeg+Fy07BpXOJJ1H5phuUD3RrL0tHxKbz72YoRcYu6MhkV9D 2ZzzYTGislkSSbUony7N/UPGHwdC44cwbnHd4ATZNY/kdZGO1bKWUGCf/LrVsad4Ogcd zyr33hKCy59tydnOCzrM8V88Dyh6Y6VnLSAFmmjX6HWVLwKy8TKrORCtnPbrVh7JFSLb du1BDayrDHBRdcJAu6PjuU4JpnG/hRMMNErLc+PU4MmGoPxlYsxv/pnPsv3M8XLqEGwg NS+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=95Slb6gDq2Q8DqAEdw9GcmaKIDFRfGxJCE5rKIys6xk=; b=gndSKjmi/7QbPiqOvdqfrxjz3gnI4ymLIE2fjlmk0ltwl55TeBkvKFqpakb4tErZti SzRjaiJNdG9vXIUTVGdcvuTMtOQUmyZDXG8raly9lIjtS0iOsoTH2UrkE1H2Ld8GCBih gJxpUnvbaJolOy+xJj7Oq7P7Dxdity4sNvWCLbtz1Zhb9/3t+3FBJy03x8GrJmtthXKq To6craIqd7Ca7JMj/sW2YgcRmbSvAKX1dgBrh4rjf33slc4p5tkETL8+IFBwngi2/wl/ 6it4gO9s7uLPGVpgw7jbG1+CiPPy+d+mT01SyOWhPlmS1PeYVG0uG6umWAo8aYui0KZI Bepw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WXJ3PtYf; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d10-20020a170902ceca00b0019e67626276si13888513plg.392.2023.04.11.00.12.03; Tue, 11 Apr 2023 00:12:16 -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=WXJ3PtYf; 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 S230365AbjDKGuQ (ORCPT <rfc822;yuanzuo1009@gmail.com> + 99 others); Tue, 11 Apr 2023 02:50:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229766AbjDKGtu (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 11 Apr 2023 02:49:50 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 275922D6B for <linux-kernel@vger.kernel.org>; Mon, 10 Apr 2023 23:49:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681195755; x=1712731755; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BV5LLOlacNTt4g++kWcPPRqikSTDi86tcqNaVPEHCy0=; b=WXJ3PtYfwrE0YDj0S1yGMr/0aaNQoCWDT3x4QcCajDQhxXaynhXZ9a1Y Hw5di0n+GXUmCjsQ6PFqRW2JqVRZ6MHm+N1Otudr0ryh0ttzRjWh/2KWb 8TlST+JP5UhvqRGIu8ULTKJX+Anp9HcqbjVlagdV3oGY190PbUT/UX1EH 6+OOaBj5FLIqo4s1mKM/6kNRTZ/hgL2jhBwI/IS889Xr44b0mIMRdJgD5 XkV/rsC9Pi34czv+MCcGeSyKW2E0Gn0CHZA2pXz3TbOJiJEe6xs22F5Vs C32NM1OjfBMigNn+evfp7LRTPSLXpxXguVFtn6IYjZdqBsaHR3ZdPu7gm w==; X-IronPort-AV: E=McAfee;i="6600,9927,10676"; a="341028574" X-IronPort-AV: E=Sophos;i="5.98,336,1673942400"; d="scan'208";a="341028574" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Apr 2023 23:48:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10676"; a="1018256606" X-IronPort-AV: E=Sophos;i="5.98,336,1673942400"; d="scan'208";a="1018256606" Received: from allen-box.sh.intel.com ([10.239.159.127]) by fmsmga005.fm.intel.com with ESMTP; 10 Apr 2023 23:48:29 -0700 From: Lu Baolu <baolu.lu@linux.intel.com> To: Joerg Roedel <joro@8bytes.org> Cc: Vinod Koul <vkoul@kernel.org>, Tina Zhang <tina.zhang@intel.com>, Jacob Pan <jacob.jun.pan@linux.intel.com>, Christophe JAILLET <christophe.jaillet@wanadoo.fr>, iommu@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 09/17] iommu/vt-d: Use non-privileged mode for all PASIDs Date: Tue, 11 Apr 2023 14:48:07 +0800 Message-Id: <20230411064815.31456-10-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230411064815.31456-1-baolu.lu@linux.intel.com> References: <20230411064815.31456-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762862968803679329?= X-GMAIL-MSGID: =?utf-8?q?1762862968803679329?= |
Series |
Intel IOMMU updates for Linux v6.4
|
|
Commit Message
Baolu Lu
April 11, 2023, 6:48 a.m. UTC
From: Jacob Pan <jacob.jun.pan@linux.intel.com> 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 <jacob.jun.pan@linux.intel.com> Link: https://lore.kernel.org/r/20230331231137.1947675-2-jacob.jun.pan@linux.intel.com Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> --- 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 c771233d6f2a..f4e536fd5a28 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -2316,8 +2316,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;