From patchwork Wed Nov 15 03:02:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 165153 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:a59:b0:164:83eb:24d7 with SMTP id 25csp2357085rwb; Tue, 14 Nov 2023 19:08:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IG4Vnv6p9YqGbz74n/CHyKtGnDptzdGaFZRFHh/xGZ89fYoNT7uwrOKerDF7xgRkUDEeeG9 X-Received: by 2002:a05:6358:9101:b0:16b:c5cb:97e9 with SMTP id q1-20020a056358910100b0016bc5cb97e9mr4505189rwq.32.1700017687273; Tue, 14 Nov 2023 19:08:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700017687; cv=none; d=google.com; s=arc-20160816; b=NEEppWANShdKwmIGVIekEwFrFbyr8FrgsZyy21qWRS5/5cxV7JSSLkJe2ZLernYTKW zBLgkJXvJRcW0cm0hG9MkMJKh6/MX6kcbHlegTbq/0pLsW3PsY5qUCMBSpn5y1eMP/xV yPOfj/eARyGiqktTyrHbA6urImvVdTMhk62l9gbHjdFBZKayj0rG27QJora3n2SIXu+A IIUwdnym8tSl+0cTiFMHoFo4rd7tdkrAQqOK6Qmc0ETDsFWdqEN8qYl+WRKn/ts4Hl7X om1TWvOhqvd1Nq9f9UuAE0f7qhZUtOd5UyF67g8zao6BL7unuqmzM0zzlIJGeQeUo+7c vCpw== 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=30kKtHotARpTVacyh6cHZm+w66/r1xyoyzc8OPtEcAs=; fh=cKMEKjN6hA4p/tztquNSpzJ8m/owYvOs95994WQgEP4=; b=JZ+A4auyj7FG0gw+AA7+XSZQMSzFqkBn5+DfhKJyQnk/RY/QRMF6faK9fTldyDdpcp dkJ6e3o2d4uU7imrXsE1ydeNCPtDGSQY4XHiIe7rNZ8BXcyzTcLpqG4HKLu6Q279Q05a xUdg7YIa1cpptxlpQiqebBbEu+Vmogd4IacDPKToSCFJe/QF4YO2oH/m1ekF5EwOzp5P sj13GrK6tRNhfI61P11D5rSlSRryPpzPcMs9SQvfMwHOhZtcafCYxjGu9srQqonFTZB8 FbHA05ygv3kGDEnbES4YOWxNSfONWDTjveNwN1TgR8fY9P1Sb6pdmUVy/ZfszHswHV1M SSxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=W3kRDH6X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id g128-20020a636b86000000b005a9b2800a06si9153848pgc.787.2023.11.14.19.08.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 19:08:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=W3kRDH6X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id E342D80B5A38; Tue, 14 Nov 2023 19:07:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234351AbjKODHC (ORCPT + 28 others); Tue, 14 Nov 2023 22:07:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234339AbjKODG7 (ORCPT ); Tue, 14 Nov 2023 22:06:59 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7100DB; Tue, 14 Nov 2023 19:06:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700017615; x=1731553615; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4WHpnPAgpgICs8FBrxCtS/2uBCk1GaTVpWDqcaGoIf8=; b=W3kRDH6Xq6I/0ANzQzIgt+H6MLJNC7QjTUywq5WnKTPx0nRsNEXZjvIC t2h8d3TDq5HGkv8PeH98QHr/iUh5EuqXVzhGafcef4CSf3x5+o/ZdGRxk Wzc0JkGjTUhVsESsvr39R8fYU1DQqpw2oUXENRNTO00n6BhCFDVy6Z1S6 6ajsDbBgmWc5gdTGcjBWpvdY30Rpw1HHCfy8ldZgHZvr1tcMv8GFLFvsW OiRaCq/iir9tbLGQ5liXcNwMjH3lUpst4RoOZcBoasBgU8RN6ykBFsaDD r6BpV25Hr4XIE6MLCIdOAn4sqbBOy5p3f53hwA75lsJIxziwuKhoTEfQO A==; X-IronPort-AV: E=McAfee;i="6600,9927,10894"; a="394715339" X-IronPort-AV: E=Sophos;i="6.03,303,1694761200"; d="scan'208";a="394715339" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Nov 2023 19:06:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10894"; a="1012128786" X-IronPort-AV: E=Sophos;i="6.03,303,1694761200"; d="scan'208";a="1012128786" Received: from allen-box.sh.intel.com ([10.239.159.127]) by fmsmga006.fm.intel.com with ESMTP; 14 Nov 2023 19:06:52 -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 , Yan Zhao , iommu@lists.linux.dev, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Lu Baolu , Jason Gunthorpe Subject: [PATCH v7 03/12] iommu: Remove unrecoverable fault data Date: Wed, 15 Nov 2023 11:02:17 +0800 Message-Id: <20231115030226.16700-4-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231115030226.16700-1-baolu.lu@linux.intel.com> References: <20231115030226.16700-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 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 agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 14 Nov 2023 19:07:52 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782597746532629211 X-GMAIL-MSGID: 1782597746532629211 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 --- include/linux/iommu.h | 70 +------------------------------------------ 1 file changed, 1 insertion(+), 69 deletions(-) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index c2e2225184cf..81eee1afec72 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -50,69 +50,9 @@ 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; -}; - /** * struct iommu_fault_page_request - Page Request data * @flags: encodes whether the corresponding fields are valid and whether this @@ -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; }; /**