From patchwork Tue Jan 30 08:08:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 194151 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1192630dyb; Tue, 30 Jan 2024 04:46:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IGJ+Hj/IcxCpbsZgGe84Iin5sa1mvjnUQSyw96//eSTy0tNbHkWxUPvMCbKjV77Zh3yh5dJ X-Received: by 2002:aa7:8b94:0:b0:6dd:db87:6357 with SMTP id r20-20020aa78b94000000b006dddb876357mr4252939pfd.4.1706618767186; Tue, 30 Jan 2024 04:46:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706618767; cv=pass; d=google.com; s=arc-20160816; b=rBWw13enGBRwq/0aZvHQpypUN68n8d5g7qZvaROlMkOYNAvkrPy8gFm0luHQQKkpjl sbnuSN2xqmG92+grLMeqPD8kczRAt/OBiuk/2plaFbo4CWJW/HN9E9TgzF+2umH4hwqe +IpyC005pfpI/QVjVK3Idbb/+H2CdVErZwjFNGlhny+vqUQhQUG3LV6C5ARKWmCU6C9b 9jde/T4/QbQp6UfisazsDOnf1AZuwObATtJU2Oqg+/r7yicxWUhGpnIUcaU2VJ0hOUzC eaVa3L84jt+If37wzB8Tr53hgiXSVUNSgS5OUiy0Gfvasr4N7Ra03brFZt3twMc7liSG MKiw== 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=84pihd1GcODoGB5DbIneUg67qy1cohd+Zrz4LIi1KWY=; fh=oaHNS1xUSnQss3sOwgE3xgF1EHmYE8WzykuHrV1+rzg=; b=aKloBEa6geyAZp1Zatfmp3EM3raX46KnEngkXAIKiRUR6ajlaTnYl5WGA0/b+tWy/I syLJpQH1J4T4gof06qWFlk62MCwvfeowQb9NbF7rL6zp8VUTR5CiVuoUYODnwPE17RwX tNWv2x8e3gKsCWuE5HkI4aAcxhwPtnIn3Q6luXzeApdmyBpwWcsHG5Qh/j/ElUymwgLs yAFxdYRmwfsIaGPP9DcpsdE+tucB3r4CUVD1RhMzSdPQ7QgJDo2/RME71DZ+yCzAGvnM Mf6iAFWlkuTwBJmi6ETua/tLo9G5Py45mOBtVKgOWnTARVixUhkY7re/tjdmc22l08x3 +bUg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NAg0Oxxk; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-44105-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44105-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id y22-20020a056a00181600b006ddc415d401si7384851pfa.316.2024.01.30.04.46.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 04:46:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44105-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NAg0Oxxk; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-44105-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44105-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 4D269B25CCE for ; Tue, 30 Jan 2024 08:16:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 513785F849; Tue, 30 Jan 2024 08:14:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="NAg0Oxxk" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (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 1C25758AAD; Tue, 30 Jan 2024 08:14:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706602464; cv=none; b=Ef2NZJY8dNyopsxvCAn4hSCnS1hYr98zWTCMjaMKCxXSuy8dyizl5U7HBLXemuYzRia82MXinyWubxGONGBFAXFxUrd0hqKKB5Zv/BFA+TsxgIDzriBbe4wgiBzaeqtMYd9IMhEN/fklUCVooZQR6RzcxU4NJtKQT6aIWfFWhXc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706602464; c=relaxed/simple; bh=zVzhxvqRR0BI96qQJ4hq4Lg0Tgi2Dc/PHhg3c81/aoQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kmsFTSXGg6vQWUPApoi+7XSiU920aYXwRfv2KSavyGOGK4d1EFujhVIrOS8nYXSU+YF65B1a8Fi9JGMZrAtbf8MwcRYgEFIxpAW3tNi9DHT3mbx7MvN2UNwPaxVQ4ARE4Uqq0CDz1wZQSP3W+eJrgvr2jRZz5kUnmq1qddPAN4I= 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=NAg0Oxxk; arc=none smtp.client-ip=198.175.65.12 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=1706602463; x=1738138463; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zVzhxvqRR0BI96qQJ4hq4Lg0Tgi2Dc/PHhg3c81/aoQ=; b=NAg0OxxkmwLslXD05K3ztXS9i5aV6dTv+aEbROCre6Oq2nUCyw6qdx6S 44peFM/Gb7RqLKKhpfnoAJ3NbGF2TlQTrRmz91CHpidapUOWpTyqV/hvl nEpJB9qXlSxVbpHjtGapTtJYwGUydW5CGRQ44cepmViz5I4rzw/kCma0y cqlhzc2JYB2tn0TrKKhuovGFtMSlJ0sQpF99JdY5cfvQNDMcglwukA9rj zbiOwQqNevMVmXu2bZK1NQS+PayMInM+WRW/H24KBQvyVMmn46Zzxkyvt 34pcWii4p6PqXVth8SaINZDJmFun7SMpg03URMrtuaKRyN8ZTZtyma6G8 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10968"; a="10588224" X-IronPort-AV: E=Sophos;i="6.05,707,1701158400"; d="scan'208";a="10588224" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 00:14:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,707,1701158400"; d="scan'208";a="3633723" Received: from allen-box.sh.intel.com ([10.239.159.127]) by fmviesa003.fm.intel.com with ESMTP; 30 Jan 2024 00:14:19 -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 v11 03/16] iommu: Remove unrecoverable fault data Date: Tue, 30 Jan 2024 16:08:22 +0800 Message-Id: <20240130080835.58921-4-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240130080835.58921-1-baolu.lu@linux.intel.com> References: <20240130080835.58921-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: 1789519480391455777 X-GMAIL-MSGID: 1789519480391455777 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 472a8ce029b1..c960c4fae3bc 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; }; /**