Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2085840ybm; Thu, 23 May 2019 11:08:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEUvmgMHsPGaPI7THwVNvMvZ2mRkUpkf6KmMmDf8KOm1H/1BPorsbHXdiE53lQ8+w7fUHv X-Received: by 2002:a17:90a:be0b:: with SMTP id a11mr3037895pjs.88.1558634926041; Thu, 23 May 2019 11:08:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558634926; cv=none; d=google.com; s=arc-20160816; b=sXg5CKpOMq5nxkGvXUMbqZIN/b+TassOiRA1+fUZYeHUbRWKp+QxW/78BLBvpQ0om+ T3gBbdk3VaB2GNkC4EbrYGOprnb6fuYezSjEP2fhTDDE2aQmzy+89rPjkv7QnZyqJb0C S8I13e69l/BgHw/wcc2xjNhOaX7zSXOPvLkOylKlQ9ofcarw3X4iOQV9bZqRRazKQF8f rBgbbCR57litY0mOEM6PrRva/W/VMSjFXHjGHSYmUfyGWOseKAgZQsatCx9zTSlrH1G2 2Wi2ymOIwvrB5HzC6L6GmaITMjhi3qMBvzSBB2/puGcPvwsUYaVBKoSta2iqXyRkHUsH 8qcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=v/KWRqNCtqdpjepAPjVifdaGF6J5TAS+66OcipQXL/Q=; b=O91APMDHIq1hoPW426PWgaFq8gNEuyk3oQp1CAP0iY58uiojLjeazsIZVzUJ8AyeT9 magNzxBGDdDpQal9BTZ4EwFnJgRmK2jCyQm3U3HtIV0Cq4NXL3owmeJhTQtsGsKHbNtt SSIajKK5YmmiZaCQNNhTR7Qhw99iRylVAiDDZq2piz7sgzUe9wmVhNMb1Zf2/GrBvixH FUj/z3XOAwsI6LU1xSJqDZlV+2hH605FNJSTKR1FiEI9+Xn9L61WfkxVFtvxy2buUOki jyyX+0OrH+JKSFvf4fyaiCCXJQWa6cJ0wwTlINIQys0d5BxAomjB0SRpEuZnH9FlCyHS i1Qg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cg1si252372plb.247.2019.05.23.11.08.30; Thu, 23 May 2019 11:08:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731471AbfEWSHH (ORCPT + 99 others); Thu, 23 May 2019 14:07:07 -0400 Received: from foss.arm.com ([217.140.101.70]:52086 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731093AbfEWSHG (ORCPT ); Thu, 23 May 2019 14:07:06 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9E87715A2; Thu, 23 May 2019 11:07:05 -0700 (PDT) Received: from ostrya.cambridge.arm.com (ostrya.cambridge.arm.com [10.1.196.129]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 00C863F5AF; Thu, 23 May 2019 11:07:03 -0700 (PDT) From: Jean-Philippe Brucker To: joro@8bytes.org, alex.williamson@redhat.com Cc: jacob.jun.pan@linux.intel.com, eric.auger@redhat.com, ashok.raj@intel.com, yi.l.liu@linux.intel.com, robdclark@gmail.com, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org Subject: [PATCH 1/4] driver core: Add per device iommu param Date: Thu, 23 May 2019 19:06:10 +0100 Message-Id: <20190523180613.55049-2-jean-philippe.brucker@arm.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190523180613.55049-1-jean-philippe.brucker@arm.com> References: <20190523180613.55049-1-jean-philippe.brucker@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jacob Pan DMA faults can be detected by IOMMU at device level. Adding a pointer to struct device allows IOMMU subsystem to report relevant faults back to the device driver for further handling. For direct assigned device (or user space drivers), guest OS holds responsibility to handle and respond per device IOMMU fault. Therefore we need fault reporting mechanism to propagate faults beyond IOMMU subsystem. There are two other IOMMU data pointers under struct device today, here we introduce iommu_param as a parent pointer such that all device IOMMU data can be consolidated here. The idea was suggested here by Greg KH and Joerg. The name iommu_param is chosen here since iommu_data has been used. Suggested-by: Greg Kroah-Hartman Reviewed-by: Greg Kroah-Hartman Signed-off-by: Jacob Pan Link: https://lkml.org/lkml/2017/10/6/81 --- include/linux/device.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/device.h b/include/linux/device.h index e85264fb6616..f0a975abd6e9 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -42,6 +42,7 @@ struct iommu_ops; struct iommu_group; struct iommu_fwspec; struct dev_pin_info; +struct iommu_param; struct bus_attribute { struct attribute attr; @@ -959,6 +960,7 @@ struct dev_links_info { * device (i.e. the bus driver that discovered the device). * @iommu_group: IOMMU group the device belongs to. * @iommu_fwspec: IOMMU-specific properties supplied by firmware. + * @iommu_param: Per device generic IOMMU runtime data * * @offline_disabled: If set, the device is permanently online. * @offline: Set after successful invocation of bus type's .offline(). @@ -1052,6 +1054,7 @@ struct device { void (*release)(struct device *dev); struct iommu_group *iommu_group; struct iommu_fwspec *iommu_fwspec; + struct iommu_param *iommu_param; bool offline_disabled:1; bool offline:1; -- 2.21.0