From patchwork Mon Feb 12 01:22:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 199602 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp2281016dyd; Sun, 11 Feb 2024 23:31:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IEfC2ySB56fTfyGDN1eCNWFIae+u7Tm/30WqcFP6tiqq1LtqpV9Snm4uJjElv+n8FtrQKtO X-Received: by 2002:a05:6a20:9f47:b0:19c:a632:e176 with SMTP id ml7-20020a056a209f4700b0019ca632e176mr5878612pzb.11.1707723091523; Sun, 11 Feb 2024 23:31:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707723091; cv=pass; d=google.com; s=arc-20160816; b=HGAZHSF7zS8EvVAgJTRzGo6zBVmWhmx3mWc6g1BjjvKI2gTWcqLQLZBMI2rLmg81aR dhEj9rFAd0FPCJKpJ2FY2tOCSQF4+pMOqouUAm3aSICIm/giRy2mHvuGZfHvRav4OAWG b8ns8TbF3zpmiQLG97tmekDbbDWA4AZrpbwTGwknHgCvIACO22aM1iM/31eA93QvBDY3 1svew7CBTRpJpoDSMCvzqOp51qtjaZCIV6lsRBWAZgkmy/2FJL7R8s4udbhhc0kyA528 8nTeDRsfiXOhOBXGYYj9zwYyAa6/8krAopEVMYNu+MIjnJLHUU78MPPfxkLV8ZM/Bqof WXmg== 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=4QkgEHZdXFFCOzVEFCXYrqdEMSLlD0D6b/AZdQhwM+4=; fh=EZg3XTR8jqrbqbd+1vsKrq+Xx/cPZRFwHywARNKAtXM=; b=D/fuhZLiTiOeoXZRBjYmawoktmr+1w6sjZzmwOY5Ivdb7zQoipC5j58yQOP9EWYR0h LYz+pjy9mnQY9KV3Qb3Pomo2CuI0sG3qc0wb7x5w7TftHBVKFTceH+aO/IAfz1wPRp3z fQ+N78wBvuVEBPywD2rW7POxXRwIFeAg5u2VVQuESa7EIjlPCY1YdCPRqyIHl6WoBjOT yIf61jo/pnWmvTDHeaktU/Fwnty66CGV5wngOEXxcsKZ3+Q+IoDF5Tm+SbiDenzqP1JX 8kQf+uuRlW7/PWTJSaqXzkRvtGYXyAM11IsFDBWgVP0IEuGZ48gpR5cO/xQukrDpB++F kIcA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TZ72oWX4; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-61043-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61043-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCWCLqi1j7Ax8EIsMYpzQ2ZyWUr/N5XNhR4sFheoVjHMf20kiyM7bXtoPPfBl/fPZtOcDQc/db2/GZ7MbvsNpVVaS1OkbQ== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k11-20020a6568cb000000b005d8bc09efbdsi5826403pgt.881.2024.02.11.23.31.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 23:31:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61043-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TZ72oWX4; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-61043-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61043-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 1EDCA281894 for ; Mon, 12 Feb 2024 01:29:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EF719C134; Mon, 12 Feb 2024 01:28:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="TZ72oWX4" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (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 BFAD279FD; Mon, 12 Feb 2024 01:28:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707701309; cv=none; b=m/Vrdwge9AiwRnxNaKJ0iS2/1JkiHr+7wZez5LrljYMlnWAf6ssVyxxg/3h9MICwOcLT7Cqn0YFaRQR3Dn058SQaoZbWDQiCOvmV7t7FRFTbzzlD0nCeIikGOE8je+dOI/v8w4KOIpIJkq1y9+039UCwk3zeTRPpQMp6FdqyxGc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707701309; c=relaxed/simple; bh=5r6D3Qdoii3/4RlUq+OLVXjHOxyAwVfMslu98LqAXaw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RWTBo/kLgnwq15GpOSup0/waW77ih7AM2aCUzwpuFYtqOfk7+bh8ogz0z1EU4+HpEuWAbco8x5Woflqu4DPKKf9qP/NUadl+7gUQsgOZi/iLF0G4JBCdCYJl6BGGAOKTZyZTqIdBGCLjsWbkJcCLRBqPn/kFOZAhDI5+/qiFnkg= 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=TZ72oWX4; arc=none smtp.client-ip=198.175.65.15 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=1707701308; x=1739237308; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5r6D3Qdoii3/4RlUq+OLVXjHOxyAwVfMslu98LqAXaw=; b=TZ72oWX4EZzQqBoJAElgVgDAT48cfF4K3eiyrkYUblNSzp3XW0APdQ2R tmUOemxzMosjymFyT01Z4M8sr+XVw1wZRw4s7lquFFiiikQKs9ceM4Bsw DFzWkO2fPrVWECvRwsYudRS3x6yNa6+CD7CNG4Gxm9tCe/5eh4hazDK6L sUXCNnadpCrRc24P+JjBlod4IFZ/Gze3egEUq5I5+TNAtgeaGRVnzelXL LYoJ87DuKqLV+fqjotgbFIXlgX3RF+TYjibvqfZF4TjbBDvIF94zeQgmW EJIHQJUk8zqqag175eqLtzB5wr+z5vKF5vsRbxVXhZdG3beMWmY2Etfhj g==; X-IronPort-AV: E=McAfee;i="6600,9927,10981"; a="5502080" X-IronPort-AV: E=Sophos;i="6.05,261,1701158400"; d="scan'208";a="5502080" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Feb 2024 17:28:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,261,1701158400"; d="scan'208";a="7132154" Received: from allen-box.sh.intel.com ([10.239.159.127]) by orviesa005.jf.intel.com with ESMTP; 11 Feb 2024 17:28:24 -0800 From: Lu Baolu To: Joerg Roedel , Will Deacon , Robin Murphy , Jason Gunthorpe , Kevin Tian , Jean-Philippe Brucker , Nicolin Chen Cc: Yi Liu , Jacob Pan , Longfang Liu , Yan Zhao , Joel Granados , iommu@lists.linux.dev, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Lu Baolu , Jason Gunthorpe Subject: [PATCH v13 03/16] iommu: Remove unrecoverable fault data Date: Mon, 12 Feb 2024 09:22:14 +0800 Message-Id: <20240212012227.119381-4-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240212012227.119381-1-baolu.lu@linux.intel.com> References: <20240212012227.119381-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790677448752344752 X-GMAIL-MSGID: 1790677448752344752 The unrecoverable fault data is not used anywhere. Remove it to avoid dead code. Suggested-by: Kevin Tian Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe Reviewed-by: Kevin Tian Tested-by: Yan Zhao Tested-by: Longfang Liu --- include/linux/iommu.h | 72 ++----------------------------------------- 1 file changed, 2 insertions(+), 70 deletions(-) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index d44af9168276..68ffbbacaaad 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -50,67 +50,7 @@ struct iommu_dma_cookie; /* Generic fault types, can be expanded IRQ remapping fault */ enum iommu_fault_type { - IOMMU_FAULT_DMA_UNRECOV = 1, /* unrecoverable fault */ - IOMMU_FAULT_PAGE_REQ, /* page request fault */ -}; - -enum iommu_fault_reason { - IOMMU_FAULT_REASON_UNKNOWN = 0, - - /* Could not access the PASID table (fetch caused external abort) */ - IOMMU_FAULT_REASON_PASID_FETCH, - - /* PASID entry is invalid or has configuration errors */ - IOMMU_FAULT_REASON_BAD_PASID_ENTRY, - - /* - * PASID is out of range (e.g. exceeds the maximum PASID - * supported by the IOMMU) or disabled. - */ - IOMMU_FAULT_REASON_PASID_INVALID, - - /* - * An external abort occurred fetching (or updating) a translation - * table descriptor - */ - IOMMU_FAULT_REASON_WALK_EABT, - - /* - * Could not access the page table entry (Bad address), - * actual translation fault - */ - IOMMU_FAULT_REASON_PTE_FETCH, - - /* Protection flag check failed */ - IOMMU_FAULT_REASON_PERMISSION, - - /* access flag check failed */ - IOMMU_FAULT_REASON_ACCESS, - - /* Output address of a translation stage caused Address Size fault */ - IOMMU_FAULT_REASON_OOR_ADDRESS, -}; - -/** - * struct iommu_fault_unrecoverable - Unrecoverable fault data - * @reason: reason of the fault, from &enum iommu_fault_reason - * @flags: parameters of this fault (IOMMU_FAULT_UNRECOV_* values) - * @pasid: Process Address Space ID - * @perm: requested permission access using by the incoming transaction - * (IOMMU_FAULT_PERM_* values) - * @addr: offending page address - * @fetch_addr: address that caused a fetch abort, if any - */ -struct iommu_fault_unrecoverable { - __u32 reason; -#define IOMMU_FAULT_UNRECOV_PASID_VALID (1 << 0) -#define IOMMU_FAULT_UNRECOV_ADDR_VALID (1 << 1) -#define IOMMU_FAULT_UNRECOV_FETCH_ADDR_VALID (1 << 2) - __u32 flags; - __u32 pasid; - __u32 perm; - __u64 addr; - __u64 fetch_addr; + IOMMU_FAULT_PAGE_REQ = 1, /* page request fault */ }; /** @@ -142,19 +82,11 @@ struct iommu_fault_page_request { /** * struct iommu_fault - Generic fault data * @type: fault type from &enum iommu_fault_type - * @padding: reserved for future use (should be zero) - * @event: fault event, when @type is %IOMMU_FAULT_DMA_UNRECOV * @prm: Page Request message, when @type is %IOMMU_FAULT_PAGE_REQ - * @padding2: sets the fault size to allow for future extensions */ struct iommu_fault { __u32 type; - __u32 padding; - union { - struct iommu_fault_unrecoverable event; - struct iommu_fault_page_request prm; - __u8 padding2[56]; - }; + struct iommu_fault_page_request prm; }; /**