From patchwork Thu Sep 14 08:56:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 139505 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp270044vqi; Thu, 14 Sep 2023 04:14:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEhDvdi0SduMis7DIUKWqfdYkzu4TX4WYbO4nF3XCetF+uXozz7n975gIA15+dpX53iIImC X-Received: by 2002:a05:6358:429f:b0:139:b4c0:94d with SMTP id s31-20020a056358429f00b00139b4c0094dmr6417217rwc.12.1694690073818; Thu, 14 Sep 2023 04:14:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694690073; cv=none; d=google.com; s=arc-20160816; b=EftcYeL+UB7NE42by691kawRoxF70z+i3l8SGjwBreBQqbNAoIwPfX9Tc/Byfk52KB Snu8QO5VYDY3jE2W4SFsgeWLdxUl8kOw3rUY39hyBsf/qQbSSRD/Q7dnXq0vIUjcbsOP BjB08zlIgiGZzJqeV7e9MaL0+LNBP6uPCiy+OKOq75LbVIOvm2BZLZmQa0xm0Y7GQavZ 0Efa4kDiIJzuvb0IzliadlqQ9YL/Te6jl3q8p7w3MDY4XaCw0LaoagEM3ukkeacmvtft nRd0nvnwvKcNwAxhhMIKf1kS43b7zMiiTA6LOvjss6eSuXZfgULOEe39e9HkYPJcH9dT mU2w== 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=abZDBk9Cblzyff+0d/AbBqY4NYK5MlE5bpcCICF1CgM=; fh=JFvRLtRIMZvCnJUsxV0gv79r+wO9Mnl08XOA+KkZDv4=; b=ZJGQuz7Rsc3/9DVR9PXbwkObsMW+EFz+aUQ65HWJPh8JMYP4pSu7sKjE3wT+/vGYnt L+yeQARUx96QU2t0HnludPBhclQ7RUUnY2BA8kvZ1D1mmPZH3mAi6wVs4aByC3iQ8lwo NLVPL8kvNjpIN1gOLbsVRUUHVOljMNOIQ1e7rnBtpDrxFdKVST9iqOYl5fi8AwOK8cfS Iwk2cb3Scht7JvnJ+jxuUHOu8+0l1hb5IBpVi1UmKC2KYAbDGS0b3NithAKzbfCCc4X/ BDS+eTAYZGQGb1mbRjwo+PrkMwFy5CoG6ADlaMonSAWvU7HyxPVfrI5SO+TCbQcGZaKx UQ6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=R6TtctXM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id w8-20020a63f508000000b0056418f28df6si1271085pgh.838.2023.09.14.04.14.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 04:14:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=R6TtctXM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 6A55480DC407; Thu, 14 Sep 2023 02:00:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236744AbjINJAR (ORCPT + 35 others); Thu, 14 Sep 2023 05:00:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236583AbjINJAJ (ORCPT ); Thu, 14 Sep 2023 05:00:09 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FB241BF2; Thu, 14 Sep 2023 02:00:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694682005; x=1726218005; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1mB0Y+KERhzTwiTUZyoz/Hd7O5Mr0RrQQDSegOTdUTo=; b=R6TtctXM5579zPwrCD7BU3izcn/eePeYAOf7v2n6sz37ucmeJl6ozjAT 116PVSxt3+Xc9beEDjj1APSuXPBwQzE50JHti6lTKZj5lKP21I7GXvji4 SWGGPfpC76YkNpgPVeW4uoyKL0t8xSgPW4fOHqj8K8exlVwMrgVWbg44E lkEjUi1sZfLvzlJvOviP/l1MCNrJQWsKV5dwSBq8NTjLxLmzTYmUicCoM slXbpGpAmnHIoKsuXuhxz7Ryi3JaczZgC4TS9XTEZnHhh0blrpEtTfUj7 hzGGKFGAGokf7zEESmHvbz1tftqWwfx+/x+eLv2i6o+1/FB2kUA9lRrrN Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10832"; a="465266320" X-IronPort-AV: E=Sophos;i="6.02,145,1688454000"; d="scan'208";a="465266320" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Sep 2023 01:59:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10832"; a="859612766" X-IronPort-AV: E=Sophos;i="6.02,145,1688454000"; d="scan'208";a="859612766" Received: from allen-box.sh.intel.com ([10.239.159.127]) by fmsmga002.fm.intel.com with ESMTP; 14 Sep 2023 01:59:51 -0700 From: Lu Baolu To: Joerg Roedel , Will Deacon , Robin Murphy , Jason Gunthorpe , Kevin Tian , Jean-Philippe Brucker , Nicolin Chen Cc: Yi Liu , Jacob Pan , iommu@lists.linux.dev, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Lu Baolu , Jason Gunthorpe Subject: [PATCH v5 03/12] iommu: Remove unrecoverable fault data Date: Thu, 14 Sep 2023 16:56:29 +0800 Message-Id: <20230914085638.17307-4-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230914085638.17307-1-baolu.lu@linux.intel.com> References: <20230914085638.17307-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 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]); Thu, 14 Sep 2023 02:00:36 -0700 (PDT) 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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777011338799047503 X-GMAIL-MSGID: 1777011338799047503 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 895405567f86..1040047982aa 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -48,69 +48,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 @@ -140,19 +80,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; }; /**