Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1244002ybb; Fri, 20 Mar 2020 16:24:42 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtMAj+SgV7RbNrgmzbeWk7LpfqMQrGt3sgEzRI7CSdbskVhaq5yLNf93fx/I10c+zVxInCG X-Received: by 2002:aca:aa55:: with SMTP id t82mr8615296oie.147.1584746682356; Fri, 20 Mar 2020 16:24:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584746682; cv=none; d=google.com; s=arc-20160816; b=DhjzDGxwhtNGUlkKojWaBqK8ziItOORJQWJ57pnHul6UY3zT9AKnkJIfLWp+9uZyGd 8OeZBwFre2MSEyZeYb+YqqSeybpJG5C+p77Plzx0FikvN60y8Lx2HnGJglx0SCqvb3Dp NFYb3UVWuxanNH60FBSs7izUIfIyLxkwfkwyPaeyIKPVPPdYD4rm+Uxgsmg7OLi1xoVA mwBX5fUzFDysXBD7sg1xn6oW8CREhUEfOULJhjEUKhJVP/grqbrjc456NdEXUUKkx3e0 NjArEQhfI80WF98kw5257uiYQbxHuNtMvzcpfaUUxyJZwcZAm0tb1da4G998f8ObylSY V1cQ== 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:ironport-sdr:ironport-sdr; bh=+83n5erpJR6mkl568mkBG0tCw0zsAiikvYB717ncl2o=; b=r0jgfOiyVlCgrB5ojEISJqltAfi1r9EwkiEmVr2+3r2CFZXurKLHWX0y+I4tovArB7 6MGM5AKjtKdtVmyS2ImhTZ0iGhVs4nOFLvHbmpdd4LxILDeOMbFAtLfXcV5nM+hV22WT YLNPHGOTEQtf3IGRuTNtu2ZWiZAjFpiXCvycSKJAP9uFoEWyGMlDsIx7Pgyl638GKL/B ByCQIZeX9dU5a3PfYcOHOIVnl0lD/j64VYrF2afJJy0lS0KKQ4/Yr5o42+cFWyABH2rP WeS3NHLwoVfVgAUbtJInXRFWENULpMIUaLBiINh5wLz35mrvxFxyG/m4rM9+dx54GJEV I2EA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i12si4360295otk.39.2020.03.20.16.24.30; Fri, 20 Mar 2020 16:24:42 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727750AbgCTXWh (ORCPT + 99 others); Fri, 20 Mar 2020 19:22:37 -0400 Received: from mga18.intel.com ([134.134.136.126]:42258 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726801AbgCTXWB (ORCPT ); Fri, 20 Mar 2020 19:22:01 -0400 IronPort-SDR: nE30BbxsIJeEZTkrsz5zfmVCRJ0oee5eQ3bcHWypqPZwd4w8SZEDk8z3MrEKrqq3jRc7awlH+L wLUMOhpxTrQg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2020 16:22:01 -0700 IronPort-SDR: LJVKwcIzOJtDGHsu3m254oy/H0+/ET8oAlcgG7tLcT3pDag45CTzCeppYGKkbKyCO3cjBcDI2z l+aWsE3ugZig== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,286,1580803200"; d="scan'208";a="418877220" Received: from jacob-builder.jf.intel.com ([10.7.199.155]) by orsmga005.jf.intel.com with ESMTP; 20 Mar 2020 16:22:01 -0700 From: Jacob Pan To: "Lu Baolu" , iommu@lists.linux-foundation.org, LKML , Joerg Roedel , David Woodhouse , Alex Williamson , Jean-Philippe Brucker Cc: "Yi Liu" , "Tian, Kevin" , Raj Ashok , "Christoph Hellwig" , Jonathan Cameron , Eric Auger , Jacob Pan Subject: [PATCH V10 01/11] iommu/vt-d: Move domain helper to header Date: Fri, 20 Mar 2020 16:27:31 -0700 Message-Id: <1584746861-76386-2-git-send-email-jacob.jun.pan@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1584746861-76386-1-git-send-email-jacob.jun.pan@linux.intel.com> References: <1584746861-76386-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 Move domain helper to header to be used by SVA code. Signed-off-by: Jacob Pan Reviewed-by: Eric Auger --- drivers/iommu/intel-iommu.c | 6 ------ include/linux/intel-iommu.h | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 4be549478691..e599b2537b1c 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -446,12 +446,6 @@ static void init_translation_status(struct intel_iommu *iommu) iommu->flags |= VTD_FLAG_TRANS_PRE_ENABLED; } -/* Convert generic 'struct iommu_domain to private struct dmar_domain */ -static struct dmar_domain *to_dmar_domain(struct iommu_domain *dom) -{ - return container_of(dom, struct dmar_domain, domain); -} - static int __init intel_iommu_setup(char *str) { if (!str) diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index 980234ae0312..ed7171d2ae1f 100644 --- a/include/linux/intel-iommu.h +++ b/include/linux/intel-iommu.h @@ -595,6 +595,12 @@ static inline void __iommu_flush_cache( clflush_cache_range(addr, size); } +/* Convert generic struct iommu_domain to private struct dmar_domain */ +static inline struct dmar_domain *to_dmar_domain(struct iommu_domain *dom) +{ + return container_of(dom, struct dmar_domain, domain); +} + /* * 0: readable * 1: writable -- 2.7.4