From patchwork Thu Jul 27 05:48:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 126723 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a985:0:b0:3e4:2afc:c1 with SMTP id t5csp919133vqo; Thu, 27 Jul 2023 00:32:50 -0700 (PDT) X-Google-Smtp-Source: APBJJlFRjXgMsf/AztWAITBjxjMLYJQTdpBLdzGkZ4mBEr7E0pal0ecfigl8ydADMDYZuFiP8Gib X-Received: by 2002:a05:6358:341f:b0:134:c384:59dd with SMTP id h31-20020a056358341f00b00134c38459ddmr1926407rwd.23.1690443170183; Thu, 27 Jul 2023 00:32:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690443170; cv=none; d=google.com; s=arc-20160816; b=KXg2AvEPyAnd6PdwrvG+WvzY142p9mqMjQvCYtK/I0U5zrtPhlQzo/4crMo2P6etrN cwgUDRMVLS1RipcmePUOySQ4WgZe3dl3v9wGzeflYXWJGP4whssdrg1/m1IXHpFExyIp Fnlc8jnUioIL0LP7bGrSiCqll8B7V+cdqeGzv5zzPDT0c7dZuDDFfWmNBjVXBYZjWABh l8YL6bUsLoxpwSOCvOW+ruLmxsjaSa3A22kZkGn8EZhWC2Pbr6gzD0duSbGu7C2BIhsG 2PRbmxv322OhLtlrSvjBJGN+3VU2JaOZAXy7xoLl0TMbwJ5lbXNgpv6kTYYug7+xwmhJ 8Z7g== 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=sKntUxEAzGSEAVF55elSO5cPTFo23J1paIU+HKNw3j4=; fh=5v0QJkujOnxKSzhmeWiMX/0q9X35NwMz+SRMkKa4moc=; b=zZM8TWBCyYkozsCSHDxJnyQ33nDFk1f5nrwVpWRRNxEvtuR+sadRSWHlFsB9XV0mJT I7uU4jJZ6FlWYDLOPyZZv+4LGYYj/Jroicocn7Dk357bhYVRa9BA7xaKZf5ZyQVHZjfS lpN5De2GR9Jp1BI70V1YzCf1Ap3IZYCoA+WrR5iHabSCsUVEjZCT3bOg0eAWSqAE/doe E0C7KDhKlfm8HB9dr0t+gn8Hz/peClRZOcA0MmR04Bc3ZjWjWniBSuyaX9lCdBS8uyy4 /eDLcMg8BfCaaAuLCy94QAL+7lzSLdZVdcDcNm1we3bq6YftghnimNFPBW0fYbqs/UyE 9iPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=OoLgFOKh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i62-20020a638741000000b005572b2f6ea2si825768pge.272.2023.07.27.00.32.17; Thu, 27 Jul 2023 00:32:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=OoLgFOKh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232024AbjG0FwB (ORCPT + 99 others); Thu, 27 Jul 2023 01:52:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232557AbjG0Fvu (ORCPT ); Thu, 27 Jul 2023 01:51:50 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15B032D67; Wed, 26 Jul 2023 22:51:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690437084; x=1721973084; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+30pZB6ZPoSheBWZc+jWeqUw2NgcW/Yd0m8xdMKPZyM=; b=OoLgFOKhCXF5oBPDSciBGj3Qhn+8xQmemJZtPAczCvXvJeIqXacvzF0n bq9TTn6H7vMihWATj8m3ICiUJ/Q5Qsw/s+u3EJ/YVYgsLjNfoTMQ8ASaZ hI7J52Ph54jmoWtYGPYhnCv3zaO6W+CTiSKJwY99Lp3JNo7PGCkSqoMVx clc8AVL7krgAQUuyddrNRzMlVT6BGF+TTV9AF/YdKMRVmmO8wngaS4GT2 xewphWzV0UJGVPtAQXT+LJZRiVbZJCBW5ZPBEyWWLy7wjryYT7Rydj7Fo rMQHdMkWGbZ3deI20I49KfKjmA8phWV43g4bQJtRTv/6HbneAMpWzrMvH w==; X-IronPort-AV: E=McAfee;i="6600,9927,10783"; a="399152507" X-IronPort-AV: E=Sophos;i="6.01,234,1684825200"; d="scan'208";a="399152507" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jul 2023 22:50:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10783"; a="840585273" X-IronPort-AV: E=Sophos;i="6.01,234,1684825200"; d="scan'208";a="840585273" Received: from allen-box.sh.intel.com ([10.239.159.127]) by fmsmga002.fm.intel.com with ESMTP; 26 Jul 2023 22:50:56 -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 Subject: [PATCH v2 03/12] iommu: Remove unrecoverable fault data Date: Thu, 27 Jul 2023 13:48:28 +0800 Message-Id: <20230727054837.147050-4-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230727054837.147050-1-baolu.lu@linux.intel.com> References: <20230727054837.147050-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772558137617849286 X-GMAIL-MSGID: 1772558137617849286 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 --- 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 b3537736f9cb..a1e4390d05a8 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; }; /**