Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2994208rdb; Wed, 15 Nov 2023 17:56:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IENg3QeZ/ajTyZmhvJFNzTaTGRoI0VQZdX8tzpr3/IDJKeklnqBIHzkcbxoIEt8AE2M8oRl X-Received: by 2002:a81:520d:0:b0:5a7:aa16:6b05 with SMTP id g13-20020a81520d000000b005a7aa166b05mr14880302ywb.33.1700099766403; Wed, 15 Nov 2023 17:56:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700099766; cv=none; d=google.com; s=arc-20160816; b=pS8FRaF7PszRhXriYMyHxsaoIf3uM0A2A+aGnNR75iaLaU/x4b7HohsjISrrkqYA4M 60buERME3Y4UIg4mGBSMN1w9QSIEdMpcyCX363DNyOGkQpUrX0tpV0C8DIVXzyLlmO+A 4eTrNRbtaV6Qr7CIH6EQLCTVqx6ew+n7b/l5jlKZhTWSIzNfNu5CG2rZslujphha7Duj 8PclWr4LBrPHgSL78/LzjGaZLMU1V2W0DyXfoTnqSc3SET4eR3B3cL+YocXdY0r3N6re 5/qE3eSGkwoU0iV00qH4MlCyNVUoiOlWDrfnrNQf+hvVa6Y4utFrHlBjK4P67Qu4u7Cv cO4w== 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.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id s4-20020a056a0008c400b006c4d1f0308bsi11464695pfu.262.2023.11.15.17.56.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 17:56:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; 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.38 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 fry.vger.email (Postfix) with ESMTP id 595038075EE0; Wed, 15 Nov 2023 17:56:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344498AbjKPBzU (ORCPT + 99 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 Content-Transfer-Encoding: 8bit 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,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Wed, 15 Nov 2023 17:56:00 -0800 (PST) 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: */ -- 2.34.1