Received: by 10.192.165.156 with SMTP id m28csp1137905imm; Mon, 16 Apr 2018 14:56:44 -0700 (PDT) X-Google-Smtp-Source: AIpwx49HAJPSqTsgwi+WZMMnZ4gmxAmgHxRKrISnh7PQhez0RuLPGr7oqoShVFhYJTtWmA1TyJvD X-Received: by 10.98.147.135 with SMTP id r7mr23138640pfk.31.1523915804668; Mon, 16 Apr 2018 14:56:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523915804; cv=none; d=google.com; s=arc-20160816; b=Tk6Zj57FIF0A1UQ/FTSrPfGqrnkbw1XryVTQMMa+1WCHUN88fTnVYp0s9d1M9PLTyk PA9uF+IqDfEptxKJCHSUN1Tc+p2gzc4RsWzzMTf9qDIMG5EK57fcn+8TPDAMcCesVuii /ZVlG+uQtPNn/CrulSbNXeySTzdNDDfvXQqVS9sypQqhT6+Wl4XHYiAsL/YSQmAmExXG odANGjBLuitufB2wLLYDtHrlP8xtMyRQo4oz7ygHb5IOJOHKw2vLv0ynge2m8elA5ODg HAmwUq0v4p2+9MrKVlq5cjSy5ukeMvK6Ly4pBJ2vnJHnVT+dgtu7GxvIFcBuD6lqHpPV blIQ== 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=Sfj8IR3fYALtJ+NXs2COknwR2U/7T7GscbIIY0ViY6g=; b=PS87uxMR8/IZXuCi7C2byRkEGC55/QYUqkrnwHK+BP78HHkiY7UwyvvgW0u2zWHkKI Cka9PJjEEXm0Zf4EgB42PUZFZ03ZUr9NNaiJRH3WuDh9UZCifq23qY30d2mU3fTmncYA xQ6naXp8Wh69W+lvQbI2cvHi3Aiq+auxOXe9JobfCNqI5Mou7vxuaZxM30R1qWcxtsJK 8u3h7FwiVoOPDa6qQEhl8N/xdBSqbF7vtQtAdVXoM9PGI9bumHIOBQkC8SyTnQb5fKXt JR1TinV9QBheSJX8etDNTlHaepMWDDrRhCsiWVeBO/U+m1RwNFsMhXXHmoS5JZEm0cWQ zQYQ== 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 c87si8139264pfk.53.2018.04.16.14.56.30; Mon, 16 Apr 2018 14:56:44 -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 S1753110AbeDPVyy (ORCPT + 99 others); Mon, 16 Apr 2018 17:54:54 -0400 Received: from mga09.intel.com ([134.134.136.24]:12291 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751876AbeDPVqn (ORCPT ); Mon, 16 Apr 2018 17:46:43 -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:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,460,1517904000"; d="scan'208";a="34740137" Received: from jacob-builder.jf.intel.com ([10.7.199.155]) by orsmga006.jf.intel.com with ESMTP; 16 Apr 2018 14:46:42 -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 02/22] iommu/vt-d: move device_domain_info to header Date: Mon, 16 Apr 2018 14:48:51 -0700 Message-Id: <1523915351-54415-3-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 Allow both intel-iommu.c and dmar.c to access device_domain_info. Prepare for additional per device arch data used in TLB flush function Signed-off-by: Jacob Pan --- drivers/iommu/intel-iommu.c | 18 ------------------ include/linux/intel-iommu.h | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index d60b2fb..a0f81a4 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -391,24 +391,6 @@ struct dmar_domain { iommu core */ }; -/* PCI domain-device relationship */ -struct device_domain_info { - struct list_head link; /* link to domain siblings */ - struct list_head global; /* link to global list */ - u8 bus; /* PCI bus number */ - u8 devfn; /* PCI devfn number */ - u8 pasid_supported:3; - u8 pasid_enabled:1; - u8 pri_supported:1; - u8 pri_enabled:1; - u8 ats_supported:1; - u8 ats_enabled:1; - u8 ats_qdep; - struct device *dev; /* it's NULL for PCIe-to-PCI bridge */ - struct intel_iommu *iommu; /* IOMMU used by this device */ - struct dmar_domain *domain; /* pointer to domain */ -}; - struct dmar_rmrr_unit { struct list_head list; /* list of rmrr units */ struct acpi_dmar_header *hdr; /* ACPI header */ diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index eec4827..304afae 100644 --- a/include/linux/intel-iommu.h +++ b/include/linux/intel-iommu.h @@ -461,6 +461,25 @@ struct intel_iommu { u32 flags; /* Software defined flags */ }; +/* PCI domain-device relationship */ +struct device_domain_info { + struct list_head link; /* link to domain siblings */ + struct list_head global; /* link to global list */ + u8 bus; /* PCI bus number */ + u8 devfn; /* PCI devfn number */ + u8 pasid_supported:3; + u8 pasid_enabled:1; + u8 pri_supported:1; + u8 pri_enabled:1; + u8 ats_supported:1; + u8 ats_enabled:1; + u8 ats_qdep; + u64 fault_mask; /* selected IOMMU faults to be reported */ + struct device *dev; /* it's NULL for PCIe-to-PCI bridge */ + struct intel_iommu *iommu; /* IOMMU used by this device */ + struct dmar_domain *domain; /* pointer to domain */ +}; + static inline void __iommu_flush_cache( struct intel_iommu *iommu, void *addr, int size) { -- 2.7.4