From patchwork Wed Feb 7 01:33:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolu Lu X-Patchwork-Id: 197732 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1999557dyb; Tue, 6 Feb 2024 20:39:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IHF7Qk1f/2ZFe7Z8Qfe65AuiOZANA7JhWAGaC0NkccH/yzXGkbrbQnJv7EvvQirdxfPgExg X-Received: by 2002:a17:90a:dc08:b0:28d:c4ff:74a2 with SMTP id i8-20020a17090adc0800b0028dc4ff74a2mr1687142pjv.47.1707280792496; Tue, 06 Feb 2024 20:39:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707280792; cv=pass; d=google.com; s=arc-20160816; b=ESZikNKWxRF5dozkLYuZPSBBBIyxNokv0Fr42x+i4mjgS+gRFATy3Pp4DGgKfF72px YarFQBMnscKp4WbCj7cl4dB+JE3+foJMNNNqr7jZMMuP5V7vbd8Sfm6i08vBx4jO7It5 G1LPvUs30kkyz3EWj7+HVHNUX1Rc3twjHtwGK7A2u9XA/ytsYaiozryr/xuHd+gP9XW4 aWJqRtevAxAT500U4lb7BwFSMGugqfU61Ud7U3NDebpG2k5tlymufbMR9D1HagLKki60 1cLqgx0BH5Ty3uX5yDzTzud/VPxStbHlb60bjai4vweeTLxdRAULiI+ZZK8UOjDgoBJt w8hg== 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=rsFAU8HQCPNhCSKzUrPioEdugTfLLbwL7JjIZqXubyo=; b=n31wxiusXf0TIfUyJdIiKH3gMXnQ18u96f82g6SQCZ11vl1tZMp87nFFIXyKi3+haW tjSM3i4GCgh662IfUBxmOiw5+H5GMDmNf+ruQSRkKCvrHhUNITnxsptASS+yOhnT9w35 mvq+YEuD1GZsxvuR0I+vzzWZiDdRXRo1SGSz5br6UMikhcxWCP9JkC9l0daAZBJlMIEo nFUvbao1fVW4Eq35l4j1fylnDHrpj2N5Jq5zU62mE6R/B06mCkr3EPh849Y2yVFMhIkb zg92NrLG9ZLGyd4ktp1TET7azTmSnyfRceQUm2KXLO46rFW6Q+ASjZQriZkWrjpDI1Zn 7Tiw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=l06FkZln; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-55805-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55805-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCUTpUuMM2Nt0BiPVAf+fRvSGb2MO5OKtELxEA0Xb9Ic9B5k6Pew0Au5NPmsSJe5eJwBIDtnq6UpNaCUerOxl5Ay3ox5lg== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id w4-20020a17090a8a0400b00296a2340c8esi685787pjn.6.2024.02.06.20.39.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 20:39:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55805-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=l06FkZln; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-55805-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55805-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 1370028A427 for ; Wed, 7 Feb 2024 01:41:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1CDDD14F98; Wed, 7 Feb 2024 01:39:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="l06FkZln" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (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 A5CFA10949; Wed, 7 Feb 2024 01:39:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707269970; cv=none; b=lA1ZZaqZIqv/aH1ndziSJdkdeZmxn/MtINtpxld4NOUV4WyvS/6oGHFZ20A1ClUpuG1WnqPirjo5DKaje655zm5f4O0XU9hCbHAXCw3nhk+uPX9zm2+B8JHeEPkfaW7+SD0m9U8I5nv1yLF5yMwvgvVuzZBz0m6PuVJGWdf6NhY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707269970; c=relaxed/simple; bh=zVzhxvqRR0BI96qQJ4hq4Lg0Tgi2Dc/PHhg3c81/aoQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kvmF5AznrH642a+8tQDnXNG7Vf8EbdwMqmaUtLzc5fuUnGB2dvr1du+N/PqK9b7r7Lit1thEU+CmPpgZAzLTqSxejGdKsIKXCAy/escqLHMYsnRWg5UZM9lW4LtLWnn9T2zzMG2gkVRdGU9VToeXkFlFUylSU7byeplfHbTExR4= 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=l06FkZln; arc=none smtp.client-ip=192.198.163.11 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=1707269969; x=1738805969; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zVzhxvqRR0BI96qQJ4hq4Lg0Tgi2Dc/PHhg3c81/aoQ=; b=l06FkZlns54JrH/is3Z8roJ5AEZquvWLewBcx9iITVf0GUZ9UOHhB8Ht 9X/ETmpW6i3cK8HJf2Se6nHuqmP6stLCzKiNTmDTDN3HZhITmlCSMZGyK er4WafeiEqAhIXSmyH/QyfaUWF3DCzC7/Hull2RQSMaa075asz72QOVFU 0ECEj0Fww8QXvoYEmYsLiWTdXczmx9hfEMt0jvDrex3aoOBVkghpXrlHP jdHg6grhHFCkElfyxq+fCtUz1EJ3BGeobzszriSOCjDi5tfdKzhlOrXFl F7/rkIyNdCmXGlnjhFvyyJN0jKDlKka+HGIzpTxl5OlKY7EX+wFo5AtEQ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10976"; a="11534012" X-IronPort-AV: E=Sophos;i="6.05,248,1701158400"; d="scan'208";a="11534012" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2024 17:39:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,248,1701158400"; d="scan'208";a="1190595" Received: from allen-box.sh.intel.com ([10.239.159.127]) by fmviesa010.fm.intel.com with ESMTP; 06 Feb 2024 17:39:17 -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 v12 03/16] iommu: Remove unrecoverable fault data Date: Wed, 7 Feb 2024 09:33:12 +0800 Message-Id: <20240207013325.95182-4-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240207013325.95182-1-baolu.lu@linux.intel.com> References: <20240207013325.95182-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: 1790213664297380642 X-GMAIL-MSGID: 1790213664297380642 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; }; /**