Received: by 10.192.165.148 with SMTP id m20csp3242822imm; Mon, 23 Apr 2018 03:13:18 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+yC8tOw9b+LWiGtTO1f0L+mAVDW5MbtugmdD4nhYWo6OJs2CRJ/+89xmHCV/lkMZ8yprGE X-Received: by 10.98.64.91 with SMTP id n88mr19471634pfa.229.1524478398278; Mon, 23 Apr 2018 03:13:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524478398; cv=none; d=google.com; s=arc-20160816; b=x+gfdAQAqM5kKgP/SL5ACjF/Zpk5Q7NihUlUYt/Zna15mVyPU9DCI9FwBLd8WdZJgy VoLyXV0aV1lTWHSm1TkNBjL8ZJQfsvL2HEPLFCfNtXwui+ILUicZ25FW/2GxVUdeGukp roW1zdsAqeGA57AbmbX+V9fzp1+RW05v2rDi9eSUenkKHw1thGD2s0BJPM0bbB9BfxlG 28qmWBrG4H9Q0dzoJlG584rp4KTLIWDRb+o8HsIv81LDU59/1TGuRfgi0DLzbsaFK+SH bxt1j1Z6jhwizo5xT3H/d3vM52GGCDjqvvigcArfftrCaVd1l3dA5FjoPQNj3cNBELkF KkUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=fJQp4/bsi8TimXVPrn0MgujuJ8fo20vinDvb/5h5JMk=; b=bKP1k6ltbROqkPRnomCDPdOYpouqgzeeWr6fGbP/t/cyoecmWYMwKwpKjYtn0XTkdl imni7E5MhniaYU1GNKHu1Xy4zIDKG8O7g/THKRsAmive+DKBxS0y2VSrOWNtnTl0uINk SfqvGOfjRiUS1pq4eR9E+batF0OEk0sz1eBEJgsDSvyiY5CLV8Hg0NONv/rB4ry6ikL+ X8N2KmsZJNE98mGUgsiUhqBA1H+qlYW14yUFJJ1DeQHDfShkAueguD5Nb//NHF98vqi0 LULdNZSgDwdRcGKbsMdH0PYTdosJLAGtsvMh9EYwQRsEuhBJvp2tAFZ3Nc+Nia3JTvZW uCYg== 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 s1si1301681pgq.282.2018.04.23.03.13.04; Mon, 23 Apr 2018 03:13:18 -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 S1754651AbeDWKLz (ORCPT + 99 others); Mon, 23 Apr 2018 06:11:55 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:38394 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754393AbeDWKLx (ORCPT ); Mon, 23 Apr 2018 06:11:53 -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 CC7AD1435; Mon, 23 Apr 2018 03:11:52 -0700 (PDT) Received: from ostrya.localdomain (ostrya.cambridge.arm.com [10.1.210.33]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 50DEF3F4FF; Mon, 23 Apr 2018 03:11:50 -0700 (PDT) Date: Mon, 23 Apr 2018 11:11:41 +0100 From: Jean-Philippe Brucker To: Jacob Pan Cc: "iommu@lists.linux-foundation.org" , LKML , Joerg Roedel , David Woodhouse , Greg Kroah-Hartman , Alex Williamson , Rafael Wysocki , "Liu, Yi L" , "Tian, Kevin" , Raj Ashok , Jean Delvare , Christoph Hellwig , Lu Baolu , Yi L Subject: Re: [PATCH v4 10/22] iommu: introduce device fault data Message-ID: <20180423101140.GA38106@ostrya.localdomain> References: <1523915351-54415-1-git-send-email-jacob.jun.pan@linux.intel.com> <1523915351-54415-11-git-send-email-jacob.jun.pan@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1523915351-54415-11-git-send-email-jacob.jun.pan@linux.intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 16, 2018 at 10:48:59PM +0100, Jacob Pan wrote: > +/** > + * struct iommu_fault_event - Generic per device fault data > + * > + * - PCI and non-PCI devices > + * - Recoverable faults (e.g. page request), information based on PCI ATS > + * and PASID spec. > + * - Un-recoverable faults of device interest > + * - DMA remapping and IRQ remapping faults > + > + * @type contains fault type. > + * @reason fault reasons if relevant outside IOMMU driver, IOMMU driver internal > + * faults are not reported > + * @addr: tells the offending page address > + * @pasid: contains process address space ID, used in shared virtual memory(SVM) > + * @rid: requestor ID You can remove @rid from the comment > + * @page_req_group_id: page request group index > + * @last_req: last request in a page request group > + * @pasid_valid: indicates if the PRQ has a valid PASID > + * @prot: page access protection flag, e.g. IOMMU_FAULT_READ, IOMMU_FAULT_WRITE > + * @device_private: if present, uniquely identify device-specific > + * private data for an individual page request. > + * @iommu_private: used by the IOMMU driver for storing fault-specific > + * data. Users should not modify this field before > + * sending the fault response. In my opinion you can remove @iommu_private entirely. I proposed this field so that the IOMMU driver can store fault metadata when reporting them, and read them back when completing the fault. I'm not using it in SMMUv3 anymore (instead re-fetching the metadata) and it can't be used anyway, because the value isn't copied into page_response_msg. Thanks, Jean > + */ > +struct iommu_fault_event { > + enum iommu_fault_type type; > + enum iommu_fault_reason reason; > + u64 addr; > + u32 pasid; > + u32 page_req_group_id; > + u32 last_req : 1; > + u32 pasid_valid : 1; > + u32 prot; > + u64 device_private; > + u64 iommu_private; > +};