Received: by 10.192.165.156 with SMTP id m28csp1137256imm; Mon, 16 Apr 2018 14:55:49 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+X+LAEs0LF4pDsbXzg4IzbsyrsfE9zhamj8fNEVPH14d22KdQXP3nHGNQ5chp1R5aAl9iw X-Received: by 10.99.124.81 with SMTP id l17mr11219008pgn.5.1523915749371; Mon, 16 Apr 2018 14:55:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523915749; cv=none; d=google.com; s=arc-20160816; b=Cgh/3AyY7efv7eylQhCzhFLN+A8aS/N50cC9la04vBgnwoGDYkPld8Dy2T9mfh+udO pxJownSANCn2gIs/WExkDTT9MZLSHqC++HazZbS6uHPWz97bf/wOzPGZVzHC0GdtIqam 6Qwpy7Y+VCwmSxAX8/aZ9uaMMhNBkakazKF4D5BHapF4CCJ0IS4reqmkzkhJB3loWhr9 nXd3j7+lsl2oyDKQirnHIqUAmjRkPDTIhH6fsnpAINTI7ILe2LH0000urGMDplh4H1Uj urD2sd+ZYJV59XFKmo2XaGGMS98G6ffQzMo8NcyRM5qAZc4FdF6nD3Qe0xEeKUzO0dVN P8dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=la+nNPxR8Owj1th0qgZahGRYtDdWbFK4485x0rpdarc=; b=rTXQ4X4A1upqU90Wi5Xcjf/6iaXDZi60ikwlnHOpWFJEUuTMC9l4XWjNY+v/l14Irc a/mReR6wWZNdzSfZbcTK0X2xJZ/t53nge2qHYpctoL/wE5c2PFCRLQFRwfBfGdAD/+gn oKMqMNzgrNqvdrtkntjXdkzIygPsqPkCNs4kGXMpgNRC/ydC/tuKjX7pr4RDU27TihiO UmHyD/Wz2S6b7SqsoT/VYn41sKkk1CRZeuirmylt5+VTh4wb+EN3qOSQ44aUBvf0WJD0 5XNd4SaPgYvYQZre1iyg5g20AS7RtheDX5qGhCq877cVDLLBuFs3wO9kC381SVLkirad E0+w== 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 u17si10052557pgv.383.2018.04.16.14.55.35; Mon, 16 Apr 2018 14:55:49 -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 S1753426AbeDPVuv (ORCPT + 99 others); Mon, 16 Apr 2018 17:50:51 -0400 Received: from mga09.intel.com ([134.134.136.24]:12290 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752931AbeDPVqq (ORCPT ); Mon, 16 Apr 2018 17:46:46 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Apr 2018 14:46:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,460,1517904000"; d="scan'208";a="34740169" Received: from jacob-builder.jf.intel.com ([10.7.199.155]) by orsmga006.jf.intel.com with ESMTP; 16 Apr 2018 14:46:43 -0700 From: Jacob Pan To: iommu@lists.linux-foundation.org, LKML , Joerg Roedel , David Woodhouse , Greg Kroah-Hartman , Alex Williamson , Jean-Philippe Brucker Cc: Rafael Wysocki , "Liu, Yi L" , "Tian, Kevin" , Raj Ashok , Jean Delvare , "Christoph Hellwig" , "Lu Baolu" , Jacob Pan Subject: [PATCH v4 11/22] driver core: add per device iommu param Date: Mon, 16 Apr 2018 14:49:00 -0700 Message-Id: <1523915351-54415-12-git-send-email-jacob.jun.pan@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523915351-54415-1-git-send-email-jacob.jun.pan@linux.intel.com> References: <1523915351-54415-1-git-send-email-jacob.jun.pan@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Jacob Pan Signed-off-by: Jean-Philippe Brucker 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 0059b99..7c79e4e 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -41,6 +41,7 @@ struct iommu_ops; struct iommu_group; struct iommu_fwspec; struct dev_pin_info; +struct iommu_param; struct bus_attribute { struct attribute attr; @@ -897,6 +898,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(). @@ -986,6 +988,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.7.4