Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4253892ybi; Mon, 3 Jun 2019 08:00:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwgYDCTtOaZ0f9EjcPsBLWv3qUGmEEXFESkTp5K8eE5D3UtLOvC67hy3x32fxqpcPdAHWNH X-Received: by 2002:a62:ac1a:: with SMTP id v26mr9122320pfe.184.1559574032331; Mon, 03 Jun 2019 08:00:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559574032; cv=none; d=google.com; s=arc-20160816; b=wUBOXbIrDFgMiDzHzNO8b33cgopDha6coxcrcl2Pkwdswu36NjOm3cDZmsppuf5Ai5 wkGWHdd3PNvIRiEYsjlEM2aHplGq7xNNBgjJD+yCUNhi/E58tJhGMkARPU3TQ8bZMeAp ZhBr3IuHeEE52w+E+PT97Zx0YVl7/aW27RFtVex4JkuznLVuSr5u7X718QRz+yyfX0a3 QXeElyZoWKx1LkAcQtFkCDZcmb0S5NxcIABtPCWHQZX3m/dsdOU0xU3/nuOEF145Dkq6 zySAkXZD2Wr1tVFCdufE/7C1BXNZKkG+w4SU+CyTWiWi8emnL08hLT3IjhLYFk6MumUC Outg== 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=IqRHZWSalcDBhBCueHxZ47dx+MyHfyVY0/S0387x9RV4hD+9ph/Vi6zKQSUx8mOw01 RpVXkOvoJiGVk0hdBeFwW7KOIVG0XIYdCPWY/xNXzhE8CXvFIEtfPubnnK2OZpXSKuSR AD4Huckdruc/K+tpJCSP1OorkCJmi4kOoVk5234kARj2I6wBqYN7zW8iIIlqqKNYRzTG MJw9KxGlyEXJ1+bLqNXEn6K3be8rG12cMnffZTAeZGltOl/0d5JjKvWzDe4hnaQ+mZqV 0cA4YjAsVgBQi+mplIYQD27ItKPq8H79FMJ0RPNXjRj2ryWYGPichATTAHpaFYaVbVkv IVTg== 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 91si20770883plc.54.2019.06.03.08.00.16; Mon, 03 Jun 2019 08:00:32 -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 S1729282AbfFCO6l (ORCPT + 99 others); Mon, 3 Jun 2019 10:58:41 -0400 Received: from foss.arm.com ([217.140.101.70]:52626 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728882AbfFCO6j (ORCPT ); Mon, 3 Jun 2019 10:58:39 -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 220C1A78; Mon, 3 Jun 2019 07:58:39 -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 55AB83F246; Mon, 3 Jun 2019 07:58:37 -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@intel.com, robdclark@gmail.com, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, robin.murphy@arm.com Subject: [PATCH v2 1/4] driver core: Add per device iommu param Date: Mon, 3 Jun 2019 15:57:46 +0100 Message-Id: <20190603145749.46347-2-jean-philippe.brucker@arm.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190603145749.46347-1-jean-philippe.brucker@arm.com> References: <20190603145749.46347-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