From patchwork Thu Nov 16 01:50:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 165651 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp2933180vqg; Wed, 15 Nov 2023 17:56:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IGLtdfsBxrgpxwBdt0MGKpDiQ9iVv3p9jfkb6ykgFKRwzdLei1DKUNbWKJ6jOeBCu93G1zJ X-Received: by 2002:a05:6a00:2da6:b0:693:4a5c:268f with SMTP id fb38-20020a056a002da600b006934a5c268fmr17690368pfb.6.1700099764993; Wed, 15 Nov 2023 17:56:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700099764; cv=none; d=google.com; s=arc-20160816; b=n0JMV2Fus+Ocx7RYoFY8g0NObvLzmGvvy/rzCHkFYiPUZc0f2rVMpNqJTmaBiFz9oJ HGQUePtzSOLmux/NqH2zVxpu2S4Uf7QNG4psBVyBYYT79wR/QI67F02YhQuWxYmnGtDv 7sh4ISyOANwBrRbDZLIuxocCJzUUluApOiIme1ZVOkTmKmdfAt48i95lCWjY1Xfx7VfD phLhJ86FYMXIeTPRAAoHicwpBCK8CmF/WuIrdsuXwtJz53/DLUjQcQsnzMuoDfBluPUc Fh2FuTmletjYA1cByfn4/8rtNfINyq4/s8oBba80B1+TYUXEYsNJUoFaNvKKCgbkcELJ c9dQ== 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=lD8/b39KlN0KjZ9oHa6iBM7OsvqkHrJkuIlywKcSgbA=; fh=5K4v/0ku97kpa0vTvhWLyUEWwXZiIFVMmzwLLirrjJ4=; b=aoCPydP2k0P5fL9Mw45JW7apxMxUw9kmjHnfAnC3gruKB9YMsf6Rd6LTj+oxmiHFEU NVuraGMKc8yPhJFByAzYBE+8GYkiQZ46IQv0I7mlIzMlAYY6lF9A2nVmfOSlkTh8vRMx T9B40cmVxOL9QazSk6U+DpTPZNEIqPA60/hiCcPKzuT57qnzUQ87SzlaIwoArhCjFp/1 r0HpKgi7Ta0ESAusCzvlclQQmhkp41F49L5JPn40MXmQOE0JvKzHNVIvHkCGxkdxxmxq mhI5lsolsKtY8P7DGYBJPRFPLR2D64QceM7gLtsloxz38K4I58xhrmwLWfroJITZ5CSZ NnqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lLmkl0Fh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id i7-20020a6561a7000000b005b86b35778fsi10935191pgv.180.2023.11.15.17.56.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 17:56:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lLmkl0Fh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 5C41A806C35F; Wed, 15 Nov 2023 17:56:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344500AbjKPBzU (ORCPT + 28 others); Wed, 15 Nov 2023 20:55:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344493AbjKPBzP (ORCPT ); Wed, 15 Nov 2023 20:55:15 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49EBF198 for ; Wed, 15 Nov 2023 17:55:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700099712; x=1731635712; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=I8+jCn+VllpmwtFb6bxxIgTCdCKQIsTCc63leYdRI1g=; b=lLmkl0Fh85PMztmea7fvkNEhq2b8pmqRhbs5ZPmEgevcSPOyoL/NGDcE +B58YVhj0CrXK+2m2tU+In1AMl9sne+8NbUj83sf/lxf6TBXTMOZnmIGU V7MODQTQcg/wFJtxlD3jcPmamylAny4+QCHyjAQDLDuOqiV8NAvV84K/k /mJmGdn0ExVMk9wQWWbDjNItwy8Xt4mh46AFadZBKsbvzNvhM5r4kIbis cvyD/JTK7W/Qjf9/pWvEMV29C3OnUZ36CFA/+tgYmKGb00cf3iTBm15AF CkZqPdJlgaafuDCyTwo5VNozrmkumFOs37MUiLCNBmjAtY1pAaktB/iKm A==; X-IronPort-AV: E=McAfee;i="6600,9927,10895"; a="381387718" X-IronPort-AV: E=Sophos;i="6.03,306,1694761200"; d="scan'208";a="381387718" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2023 17:55:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.03,306,1694761200"; d="scan'208";a="13395428" Received: from allen-box.sh.intel.com ([10.239.159.127]) by fmviesa001.fm.intel.com with ESMTP; 15 Nov 2023 17:55:10 -0800 From: Lu Baolu To: Joerg Roedel , Will Deacon , Robin Murphy , Jason Gunthorpe , Kevin Tian Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH 3/4] iommu/vt-d: Remove unused vcmd interfaces Date: Thu, 16 Nov 2023 09:50:47 +0800 Message-Id: <20231116015048.29675-4-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231116015048.29675-1-baolu.lu@linux.intel.com> References: <20231116015048.29675-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 15 Nov 2023 17:56:02 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782683811103535224 X-GMAIL-MSGID: 1782683811103535224 Commit 99b5726b4423 ("iommu: Remove ioasid infrastructure") has removed ioasid allocation interfaces from the iommu subsystem. As a result, these vcmd interfaces have become obsolete. Remove them to avoid dead code. Signed-off-by: Lu Baolu --- drivers/iommu/intel/pasid.h | 2 -- drivers/iommu/intel/pasid.c | 57 ------------------------------------- 2 files changed, 59 deletions(-) diff --git a/drivers/iommu/intel/pasid.h b/drivers/iommu/intel/pasid.h index 16265bc1f7ec..647723c650bf 100644 --- a/drivers/iommu/intel/pasid.h +++ b/drivers/iommu/intel/pasid.h @@ -117,8 +117,6 @@ int intel_pasid_setup_nested(struct intel_iommu *iommu, struct device *dev, void intel_pasid_tear_down_entry(struct intel_iommu *iommu, struct device *dev, u32 pasid, bool fault_ignore); -int vcmd_alloc_pasid(struct intel_iommu *iommu, u32 *pasid); -void vcmd_free_pasid(struct intel_iommu *iommu, u32 pasid); void intel_pasid_setup_page_snoop_control(struct intel_iommu *iommu, struct device *dev, u32 pasid); #endif /* __INTEL_PASID_H */ diff --git a/drivers/iommu/intel/pasid.c b/drivers/iommu/intel/pasid.c index 8a1bcabf71a9..57ae716a2c70 100644 --- a/drivers/iommu/intel/pasid.c +++ b/drivers/iommu/intel/pasid.c @@ -26,63 +26,6 @@ */ u32 intel_pasid_max_id = PASID_MAX; -int vcmd_alloc_pasid(struct intel_iommu *iommu, u32 *pasid) -{ - unsigned long flags; - u8 status_code; - int ret = 0; - u64 res; - - raw_spin_lock_irqsave(&iommu->register_lock, flags); - dmar_writeq(iommu->reg + DMAR_VCMD_REG, VCMD_CMD_ALLOC); - IOMMU_WAIT_OP(iommu, DMAR_VCRSP_REG, dmar_readq, - !(res & VCMD_VRSP_IP), res); - raw_spin_unlock_irqrestore(&iommu->register_lock, flags); - - status_code = VCMD_VRSP_SC(res); - switch (status_code) { - case VCMD_VRSP_SC_SUCCESS: - *pasid = VCMD_VRSP_RESULT_PASID(res); - break; - case VCMD_VRSP_SC_NO_PASID_AVAIL: - pr_info("IOMMU: %s: No PASID available\n", iommu->name); - ret = -ENOSPC; - break; - default: - ret = -ENODEV; - pr_warn("IOMMU: %s: Unexpected error code %d\n", - iommu->name, status_code); - } - - return ret; -} - -void vcmd_free_pasid(struct intel_iommu *iommu, u32 pasid) -{ - unsigned long flags; - u8 status_code; - u64 res; - - raw_spin_lock_irqsave(&iommu->register_lock, flags); - dmar_writeq(iommu->reg + DMAR_VCMD_REG, - VCMD_CMD_OPERAND(pasid) | VCMD_CMD_FREE); - IOMMU_WAIT_OP(iommu, DMAR_VCRSP_REG, dmar_readq, - !(res & VCMD_VRSP_IP), res); - raw_spin_unlock_irqrestore(&iommu->register_lock, flags); - - status_code = VCMD_VRSP_SC(res); - switch (status_code) { - case VCMD_VRSP_SC_SUCCESS: - break; - case VCMD_VRSP_SC_INVALID_PASID: - pr_info("IOMMU: %s: Invalid PASID\n", iommu->name); - break; - default: - pr_warn("IOMMU: %s: Unexpected error code %d\n", - iommu->name, status_code); - } -} - /* * Per device pasid table management: */