Received: by 2002:ab2:2997:0:b0:1ec:cbc4:63fb with SMTP id n23csp324238lqb; Thu, 29 Feb 2024 01:54:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWoWrSDAsBUF5jMTpq4Fps53OFofBlMw/OLLdRVRR8vTTuM3DXUgfij/JBGDDTae512chVkOgPxPOoCzje0b8WJFIX24vYdHKC1Vz8tWA== X-Google-Smtp-Source: AGHT+IHP1l8zAA/I49V4G46r6sOf+pk6fHBPnOq3sCKFBxzEcUzgIOT+w+/JcvgiH2xkdSAksk5w X-Received: by 2002:a05:6358:1994:b0:176:29cf:7b3a with SMTP id v20-20020a056358199400b0017629cf7b3amr1913466rwn.12.1709200498456; Thu, 29 Feb 2024 01:54:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709200498; cv=pass; d=google.com; s=arc-20160816; b=C+pg6uH+VCq8aia9ub5rRslsjD6GMMxR6vSWudPiHX3wtHqpuzAh5A4K+nA9azEHmy sS8V1bFt1rGwAgUm7Cl8kNVWwFVPKqIOJmaUC6xNrEijLJ939I8g05QdBWl76BfFETEp RUm45vk3uX3okqQFstSwlBELrLhqpWR7/TK/YGn1jUNQZT+C/Q7DnNGBaXyMLe99LohP Npq7PqByZBCo6HQVeX7/khj+qY1E39nu0hD3/bgXnJbQJ04RyZZx6xQucZIqCRzCXkYe jx8KCq/S9vkGoqR4OyWnrJ2vKUp4y4CiryjAfR/f4G3b/eu1rrqeOurYxmIZt6aoIwJA pgYw== 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=rF7pTrf3oDVpY4xBXTvoVLhMUHdlTbdql/wKVDWnBLU=; fh=q/aNRRwbk+AHb42I2d6wYfBCRE+T0txaX+dEwQcyGW0=; b=ZOBpfsKxRCU+AI/GN7IGUVXXF3aIooCp6kBQ7crn3M8gKY/UMuSMOBTs8/pTaiY8Ef wYe8qK68X7JdWxHov4neCch2YE91HnmbGZZEMsXmsogYNZqSNHLUtFasWidffVyp1wot XDjj5sI7l8uLhjh01T7MYhbJJxg0PvpS/WCRXQqWtVqk5kTnwXjF0fhBA0YVypUJFY3Q 1bL1jD321eKw1CYpX2Ox6JHHPip3edtWGAKeQY0n8oYFL8MslQdmQxjea2OItCk2DKee a4XOjs+KbRy+Pvf189Yt48hU/NqqDZ1obHATlojHfyLbY5kMG4sDaVN6UqrIsUkBv3D/ B1Xw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cLjA0+8o; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-86485-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86485-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 u22-20020a05620a455600b00787bed7052asi1182136qkp.0.2024.02.29.01.54.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 01:54:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-86485-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=cLjA0+8o; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-86485-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86485-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 034ED1C2434D for ; Thu, 29 Feb 2024 09:54:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 78D2263064; Thu, 29 Feb 2024 09:54:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="cLjA0+8o" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.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 6C2A3629E6 for ; Thu, 29 Feb 2024 09:54:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709200458; cv=none; b=Zidl1DsxsxFXEI1cN9T4Geq5ABithWxrYozW/ngBwIhMqEwDM62BzbiFA61hT5EZBi3+HHQLiQtZepXqOVs6OXSlymGTzQpGzL+rMgjmFGlVccFvIYyTazJTeU7ZakMBViA2gjEgQmFednA+XrIvnC8wnUq1gY3y3MOixZI5Vj4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709200458; c=relaxed/simple; bh=i5VupaqaS+NrLRNsFYfr01tBDs7Ieuup0RZUQBFc98w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RNH52YnbNhcFdjT5wZjZRmb3XmX7nUmWUFoNIRiX3lB89i5M0kAsKVmn3NMyqEvnCahpEHk39R/hFNrnkZQkbErwFoy4s6G5Bfctk35MoSjAoBP+0oslEBYkS0edHNQStPMv1jPQMaFrY6rP9nCP0YVjGQB1esYXnZJ0bZ0AYmc= 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=cLjA0+8o; arc=none smtp.client-ip=198.175.65.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=1709200457; x=1740736457; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=i5VupaqaS+NrLRNsFYfr01tBDs7Ieuup0RZUQBFc98w=; b=cLjA0+8o2zSfRQzUYV02lkw4jot+499FxTMQR8q5h4dYbo/RKQ5rfwzI oz3lY9+bfZYjOXJTeX3nuOI/7Fdkk+HpcUbWyX3cFFO1TABS1bE72DspF LZQUKdVF+QWlv9xDkCk2XDXvN4s3a0zMxu9TFw04ZI1Ce7X/wod+LD5ks 5Hlofcg6fRz66LRm2hDaAi79NJKoAgWG/MGXa/iCUVSX5CvtALlrLrEKd CbBWlNXeqckYuEI++TlNm9esaMAEGd2MW3adQ7UQtNbcfNwQEwhsasfNg 6MgtwOja7Ms28c8x8En6aQ6yqI0DN6f2xdhHfwMuy3VA01dEmjt4cNZ9n A==; X-IronPort-AV: E=McAfee;i="6600,9927,10998"; a="7480797" X-IronPort-AV: E=Sophos;i="6.06,194,1705392000"; d="scan'208";a="7480797" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Feb 2024 01:54:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,194,1705392000"; d="scan'208";a="7695772" Received: from allen-box.sh.intel.com ([10.239.159.127]) by orviesa010.jf.intel.com with ESMTP; 29 Feb 2024 01:54:15 -0800 From: Lu Baolu To: Joerg Roedel , Will Deacon , Robin Murphy , Jason Gunthorpe , Kevin Tian , Eric Badger Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH 3/3] iommu/vt-d: Remove scalabe mode in domain_context_clear_one() Date: Thu, 29 Feb 2024 17:48:04 +0800 Message-Id: <20240229094804.121610-4-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240229094804.121610-1-baolu.lu@linux.intel.com> References: <20240229094804.121610-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 domain_context_clear_one() only handles the context entry teardown in legacy mode. Remove the scalable mode check in it to avoid dead code. Signed-off-by: Lu Baolu --- drivers/iommu/intel/iommu.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index d682eb6ad4d2..50eb9aed47cc 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -2175,9 +2175,6 @@ static void domain_context_clear_one(struct device_domain_info *info, u8 bus, u8 struct context_entry *context; u16 did_old; - if (!iommu) - return; - spin_lock(&iommu->lock); context = iommu_context_addr(iommu, bus, devfn, 0); if (!context) { @@ -2185,14 +2182,7 @@ static void domain_context_clear_one(struct device_domain_info *info, u8 bus, u8 return; } - if (sm_supported(iommu)) { - if (hw_pass_through && domain_type_is_si(info->domain)) - did_old = FLPT_DEFAULT_DID; - else - did_old = domain_id_iommu(info->domain, iommu); - } else { - did_old = context_domain_id(context); - } + did_old = context_domain_id(context); context_clear_entry(context); __iommu_flush_cache(iommu, context, sizeof(*context)); @@ -2203,9 +2193,6 @@ static void domain_context_clear_one(struct device_domain_info *info, u8 bus, u8 DMA_CCMD_MASK_NOBIT, DMA_CCMD_DEVICE_INVL); - if (sm_supported(iommu)) - qi_flush_pasid_cache(iommu, did_old, QI_PC_ALL_PASIDS, 0); - iommu->flush.flush_iotlb(iommu, did_old, 0, -- 2.34.1