Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp426594lqb; Tue, 28 May 2024 22:42:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWIvE34jVRO3qIvSwl7Ku3AV0zIBmlHpXvwbz9vse4d+1TnTRJ9BdvSMciL16UjaHGlwoDwwANoBgrTXrpirZufIvTpjGCgdl+yNPiDXw== X-Google-Smtp-Source: AGHT+IFeYCyHp2D7lsFYFDsirwTYoE2UQR/Vpe5vO57P2ldh1zrZ/yZ/wt+rIbxq3EOzkiDV+lHn X-Received: by 2002:a05:6214:5d11:b0:6ad:7075:4212 with SMTP id 6a1803df08f44-6ad70754fd0mr81534346d6.2.1716961322158; Tue, 28 May 2024 22:42:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716961322; cv=pass; d=google.com; s=arc-20160816; b=nx3yioCNaRVKQo9RkU9IFZzLItHvXo+mkx8qvNndV1Gem4DgzLMUgVvq60IWTeu6q9 1dN9NwNw+A9BkQCrREMr8KSqkA4jHuoZ/iBLM/C0gf55+mEHX0Vh0wNJLRsCELCk5EUg QKbneQsakLtBk/hr7dWxSLyp0u+8ldgj+VfDRn70IgEPzKyKhzqREzi41sjGMEpazwAV mU8X9bsfh1WHZClg+D2VWQGYoeIDgZbo/RJhbjZBXwZg58oCcdX4jz/gqIj9vZrmj5nc pTckhQRAR+B/eN7OUjCMYgVy3lSvB6oXC0pNxxEq5LtIKTyMr8q46Tc1ur5gSNUtw3z8 pU9Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=eQNq8xgsQJxZP27HWig2XQK5q4vrOYd5TClX2VUI/7Y=; fh=u7VIfotmvhCnFPKh0R845OAh004BwcT1TGiZ1dQEGzo=; b=IepO8mniOKQnU5xLWW1EIgEsJHybBAPIdR3AjHxeF84XWdiNPw5nhOYAFEv61x4DCv bQGMCdbZB3cz/hK22XDU9ESMbeA1XwOsRyUlhDPLcArfnGtnV9vdgTfPTer1zLWXYtGJ 9vqJINbGTVwj/1/EdUDX/SnsXYucwq3USAHXFycjY9sbwY06iNOZcTDUZh92zwc8BaQi W4YICIz4pBt45k28Q8PkgRP0+HiQD5FxoKUMdvsNzt4kJ/txZgIWeF4e2nDKyEMOIfSC PKN7oHn6kq5aQTDnE87W0gltU9ho8HCAO7cD1Vf9VH2kx8y84391C0b0L6OEViw93EOU l8Lg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="gaZT/mxp"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-193471-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193471-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ac162da616si117672076d6.580.2024.05.28.22.42.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 22:42:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193471-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="gaZT/mxp"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-193471-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193471-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6EE921C24F8D for ; Wed, 29 May 2024 05:42:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A240F16F830; Wed, 29 May 2024 05:36:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="gaZT/mxp" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9803416F271 for ; Wed, 29 May 2024 05:36:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716961004; cv=none; b=aKz4USnpl4th/yieE8L7M7AGziec28ucowcm6zaz/hby/apC/YVY4cWEnRGTcO+eKdoNiv/qiGtnOnFrXhGAdf48LGd3y+JMfanvYRzUFHg9dck3YIwy9D/hUdBxmLWK7r1Je2t5r+GX1c/GsGgMehXIijB1QxTZyaI2KXPK73o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716961004; c=relaxed/simple; bh=uZ18e0DpTIgHLOpzfBuHcXvVKSj+fUz+S5osI7EsSTY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=u9P6HrPEuGBCsUDtwvqNgAhlQqaNzmxEgbaPFxqBy+yPTNg19vR7B7Mdr/ePkNJrZyDKWHubZE8Pk+FpbHvlRlrHOipzXcBi4PefwIdBJp0AJv6l+THFcuajuzj7DIkliOU8UjRY7QTGWgCBHr1zzaV5FqMECQfqWm18BFN/Ui8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=gaZT/mxp; arc=none smtp.client-ip=192.198.163.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716961004; x=1748497004; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uZ18e0DpTIgHLOpzfBuHcXvVKSj+fUz+S5osI7EsSTY=; b=gaZT/mxpLDIP2gP2yr2JZam0yRyejPM5ASQJzfEpJ3Ukat7/5DYG/XKY 2MEvXKQNL56+IVwyENHHdIEaPX9A8NrLsRSDYXGxlxGFNVqz3MCwgL8Am eXCycmTq9JAghEfqGYiDTA1dQg4opKQWqovTedHahmFxgFqG3fpquv95L T1gROj+Dsl26KxbIpe6PrwTy8x6vmgZWDaAtlWEP3tZKEJJ58Q0+BD1Sx 8u9YZjLN4dN8vz9YStHPG1942TaJ/JMAHolaiW7xRvSpxN5pwM1O3sHkE GTTmBteZplAY2AFU7HKA0LAMAif3DUUALxYsJuKv4WE7oC9GsAHYMa1Kj Q==; X-CSE-ConnectionGUID: iOaC2/LxRx+vv5XAL7+glw== X-CSE-MsgGUID: AWN1noWfTreCYbIPriOLcg== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13569132" X-IronPort-AV: E=Sophos;i="6.08,197,1712646000"; d="scan'208";a="13569132" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2024 22:36:37 -0700 X-CSE-ConnectionGUID: X+RiNsarRtKW3lpRtSJ0IA== X-CSE-MsgGUID: nvefUVcKRTqj8DSSs+S92A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,197,1712646000"; d="scan'208";a="35257811" Received: from unknown (HELO allen-box.sh.intel.com) ([10.239.159.127]) by fmviesa007.fm.intel.com with ESMTP; 28 May 2024 22:36:32 -0700 From: Lu Baolu To: Joerg Roedel , Will Deacon , Robin Murphy , Jason Gunthorpe , Kevin Tian Cc: Yi Liu , David Airlie , Daniel Vetter , Kalle Valo , Bjorn Andersson , Mathieu Poirier , Alex Williamson , mst@redhat.com, Jason Wang , Thierry Reding , Jonathan Hunter , Mikko Perttunen , iommu@lists.linux.dev, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH 20/20] iommu/vt-d: Remove domain_update_iommu_superpage() Date: Wed, 29 May 2024 13:32:50 +0800 Message-Id: <20240529053250.91284-21-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240529053250.91284-1-baolu.lu@linux.intel.com> References: <20240529053250.91284-1-baolu.lu@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The requirement for consistent super page support across all the IOMMU hardware in the system has been removed. In the past, if a new IOMMU was hot-added and lacked consistent super page capability, the hot-add process would be aborted. However, with the updated attachment semantics, it is now permissible for the super page capability to vary among different IOMMU hardware units. Signed-off-by: Lu Baolu --- drivers/iommu/intel/iommu.c | 39 +------------------------------------ 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index 74e005b1c4b4..660d2b6c531b 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -366,36 +366,6 @@ static bool iommu_paging_structure_coherency(struct intel_iommu *iommu) ecap_smpwc(iommu->ecap) : ecap_coherent(iommu->ecap); } -static int domain_update_iommu_superpage(struct dmar_domain *domain, - struct intel_iommu *skip) -{ - struct dmar_drhd_unit *drhd; - struct intel_iommu *iommu; - int mask = 0x3; - - if (!intel_iommu_superpage) - return 0; - - /* set iommu_superpage to the smallest common denominator */ - rcu_read_lock(); - for_each_active_iommu(iommu, drhd) { - if (iommu != skip) { - if (domain && domain->use_first_level) { - if (!cap_fl1gp_support(iommu->cap)) - mask = 0x1; - } else { - mask &= cap_super_page_val(iommu->cap); - } - - if (!mask) - break; - } - } - rcu_read_unlock(); - - return fls(mask); -} - /* Return the super pagesize bitmap if supported. */ static unsigned long domain_super_pgsize_bitmap(struct dmar_domain *domain) { @@ -2845,8 +2815,8 @@ int dmar_parse_one_satc(struct acpi_dmar_header *hdr, void *arg) static int intel_iommu_add(struct dmar_drhd_unit *dmaru) { - int sp, ret; struct intel_iommu *iommu = dmaru->iommu; + int ret; ret = intel_cap_audit(CAP_AUDIT_HOTPLUG_DMAR, iommu); if (ret) @@ -2858,13 +2828,6 @@ static int intel_iommu_add(struct dmar_drhd_unit *dmaru) return -ENXIO; } - sp = domain_update_iommu_superpage(NULL, iommu) - 1; - if (sp >= 0 && !(cap_super_page_val(iommu->cap) & (1 << sp))) { - pr_warn("%s: Doesn't support large page.\n", - iommu->name); - return -ENXIO; - } - /* * Disable translation if already enabled prior to OS handover. */ -- 2.34.1