From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 B31177477 for ; Thu, 27 Jul 2023 05:51:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690437062; x=1721973062; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xPrIhMzrO/1WIuBZJMjoXCye3jUvuQy6Gz0x3Y15rzk=; b=b5/yXOov85kq4OnHsaYjsm3BipXQlILR/uwOW3uUwc3S94wL9TRhthDa 0oGfJ6AOSwh+wNcVubhMU/YDQMg/AvCK+7Hr/pfvsm0Hzan5L20LZPun+ F4aPJVNPwm/wvNpdH6b1+1ltPCMQDMk084WBs3MCMcn+0XqpjNBgDK0NJ Pet62VRB9JR4e9mLzazV3JH+o9gSPKCjFo96ay4oXScnDk6gsjpas3WQE TCGPlbR2YBa3ySPiVx51ZrMMoLLhzC49o5gJ0UKsFwP3cMdeFXNhP3GZL yQkahAZI93V0WT5DDSDJjxg/T7BkUyryvWlmpQ3S5Mgrf5TbTDhSFNxUV g==; X-IronPort-AV: E=McAfee;i="6600,9927,10783"; a="399152517" X-IronPort-AV: E=Sophos;i="6.01,234,1684825200"; d="scan'208";a="399152517" 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:51:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10783"; a="840585282" X-IronPort-AV: E=Sophos;i="6.01,234,1684825200"; d="scan'208";a="840585282" Received: from allen-box.sh.intel.com ([10.239.159.127]) by fmsmga002.fm.intel.com with ESMTP; 26 Jul 2023 22:50:59 -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 04/12] iommu: Replace device fault handler with iommu_queue_iopf() Date: Thu, 27 Jul 2023 13:48:29 +0800 Message-Id: <20230727054837.147050-5-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> Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The individual iommu drivers report iommu faults by calling iommu_report_device_fault(), where a pre-registered device fault handler is called to route the fault to another fault handler installed on the corresponding iommu domain. The pre-registered device fault handler is static and won't be dynamic as the fault handler is eventually per iommu domain. Replace calling device fault handler with iommu_queue_iopf(). Signed-off-by: Lu Baolu --- drivers/iommu/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 4352a149a935..00309f66153b 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -1381,7 +1381,7 @@ int iommu_report_device_fault(struct device *dev, struct iommu_fault_event *evt) mutex_unlock(&fparam->lock); } - ret = fparam->handler(&evt->fault, fparam->data); + ret = iommu_queue_iopf(&evt->fault, dev); if (ret && evt_pending) { mutex_lock(&fparam->lock); list_del(&evt_pending->list); -- 2.34.1