Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp430725ybz; Tue, 21 Apr 2020 11:49:32 -0700 (PDT) X-Google-Smtp-Source: APiQypKoBftvZ+ZVCA07vg8ktPmFKedxpXjYU1l6+b/Ge/WXWR/ukLyqjdSdNMn+aSi4DB6bktLD X-Received: by 2002:aa7:dcc3:: with SMTP id w3mr19076972edu.231.1587494972194; Tue, 21 Apr 2020 11:49:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587494972; cv=none; d=google.com; s=arc-20160816; b=foXZlNUucHolG7YBkTFa+p/I8xVapHkPZT+yRvJtIxeeXZwXwzSw+SI10jMQDSiGET kFF5BVjmqEyjbhJ00QJPdraQv1VHg1+SSTmIF7UsOfNR/RA2Ak/eIrJr46URA1+mJJ5Q 2GiIAHlBgrzjZeUokjp5QVVm8vxlROxt5RzpLd4cElAhmcncGp4oMSHKv/zy9iBpttb5 EniODRryo0cHoNlDfmcRwF/HCA88iykVihF5Zc3tvIH2QWoGAesJUhXm4HKXbGWDJvbe 2tJzSTsjE7C3rK1XfiwF/btfyvv9xng04BrA1x9xmVwsAF4ZqjbOl+d3J2xm0Y4cEzeg jzQw== 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=NCVgRYW1Uy+CvCqD40C674JmU2eJT9j9+IKjzbgKU7E=; b=lvlwGs+0AJs/BBvn8iSCisLPix/kRbRjWNWXX9BAwzwMwjatguESQlOs/KneXAZCt7 WkbUYuBWQfoPyEHpMZK61zn/bhIFB0rG0lqmCHfeRJvw9McvSBOKuGRCarebEwFhdFdp ExOLR2L15qtth67D1AyQkU3r/v0S8czCoXku+7E0SnAYmPjZnt4yg0GVMQZC2f5phCzy DG37EdMWndNMeJ5GNsX3kIQjtj4Tlj1tQSo83dhgGdELfpXSHHLW7Y9eGP1pHZOtLbV4 YoDISfWGEhm7cU2xkbgm32NJHPdJ05cQSN+Ki4RWuPzMLEMcaWTvaTEZiL1xPPOcLyVX ECTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id cm8si1484158edb.417.2020.04.21.11.49.08; Tue, 21 Apr 2020 11:49:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726515AbgDUSrL (ORCPT + 99 others); Tue, 21 Apr 2020 14:47:11 -0400 Received: from mga04.intel.com ([192.55.52.120]:22250 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726321AbgDUSrG (ORCPT ); Tue, 21 Apr 2020 14:47:06 -0400 IronPort-SDR: GeDr4Yu8d9CSfSepUJwK9v5kUMVhVljefFxrk3x+ZEOGQwSmbHHda5wJk/ewL/L/bSKyq6rVBu 0DRNrdJadiXw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2020 11:46:48 -0700 IronPort-SDR: PEdHu/+nJfykoNN8zAe++b+kOPo6rHWYsgWZXWWX90QGDm/Mo0BfQbGIhNLFZrFDz5XyS1fgzG kN7XzRRZPbww== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,411,1580803200"; d="scan'208";a="334367863" Received: from jacob-builder.jf.intel.com ([10.7.199.155]) by orsmga001.jf.intel.com with ESMTP; 21 Apr 2020 11:46:48 -0700 From: Jacob Pan To: "Lu Baolu" , iommu@lists.linux-foundation.org, LKML , Joerg Roedel , David Woodhouse , Jean-Philippe Brucker , Eric Auger Cc: "Yi Liu" , "Tian, Kevin" , Raj Ashok , Alex Williamson , "Christoph Hellwig" , Jonathan Cameron , Jacob Pan Subject: [PATCH v12 1/8] iommu/vt-d: Move domain helper to header Date: Tue, 21 Apr 2020 11:52:38 -0700 Message-Id: <1587495165-80096-2-git-send-email-jacob.jun.pan@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1587495165-80096-1-git-send-email-jacob.jun.pan@linux.intel.com> References: <1587495165-80096-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 Reviewed-by: Kevin Tian --- 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 ef0a5246700e..60c31db9ee93 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