From patchwork Thu May 30 03:48:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 165391 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp413300ili; Wed, 29 May 2019 20:49:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqzhDOtJ8jjMOMwTkfyylHFnojOdGBC9KTZVjYCn5U4HdQ1mtKDk1yoLzAQQ9ooZ8VcREG5K X-Received: by 2002:a63:cb:: with SMTP id 194mr1711969pga.395.1559188179516; Wed, 29 May 2019 20:49:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559188179; cv=none; d=google.com; s=arc-20160816; b=uYLx3wKF59LWjPXbBZ+fTOVyIb1DKoD765KWT9hcPvKSvR3/Nx2gjxoaH89cTydEZn FRjJXo+ldSWLnvo7tvRydlz+5Legp/tLPSKDGPLvMHISfB1c/+ba4IbKbG+RK8+qhd9t C/+e7ItYI8c3UjRaoVWD81fzyl4MhH4Uw+2CFZoe2HLLr0nQA701xMmStJcvxxltZU+3 1z5hF1BjQmoHmTxOhgQMuU5t0M70JRoAiNiquYztH6IE+qkt9fON6H0fdKJ2/vKiiMc3 qJukfqOpSNSYXEqEzSkM86S9gyrmPONyLaNoNzpugh/Me3BsKoKoZ/EVnnawBfEMi/x6 fJQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=78zqXE5c5oB4duG3Duat7pmvDwolE/bKbVbAIcQjnGg=; b=YJej7fXjONpzgYKFOsRgcR1diMUFHtGep6P3RTcnvXve70838RpTpTvgrpEZMEhMRl exmuNhIMAhg7Ucz2YVoNBVzL9JLu9FjdGitHEIU1HUd1/8aTj2jslASoAQbN0MYAF0Lg MXx+UNvhJ9BXWittajuJOrVPqCSCa9D1s4xQIQsI534Dxr2mH5Q5jbdWiKOdjchiSnF/ RZptBgS28OFzXhMjlxIv/IE2qRjcNHHYxrSbWT/t/mZqcm80UGmlZclIcj0vDLizQVup jjTZUXgVif3YhWSM+bcH+Vocu60STCclmEdpfnmBVQsja5s3NrNAR6Gf1lvZhE3SKkQq dkdA== 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 i11si1945835plt.92.2019.05.29.20.49.39; Wed, 29 May 2019 20:49:39 -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 S1733224AbfE3Dti (ORCPT + 30 others); Wed, 29 May 2019 23:49:38 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:53302 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387711AbfE3Dta (ORCPT ); Wed, 29 May 2019 23:49:30 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id D27FD9252FECB80D3628; Thu, 30 May 2019 11:49:27 +0800 (CST) Received: from HGHY4L002753561.china.huawei.com (10.133.215.186) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Thu, 30 May 2019 11:49:17 +0800 From: Zhen Lei To: Jean-Philippe Brucker , John Garry , Robin Murphy , Will Deacon , Joerg Roedel , Jonathan Corbet , linux-doc , Sebastian Ott , Gerald Schaefer , "Martin Schwidefsky" , Heiko Carstens , Benjamin Herrenschmidt , Paul Mackerras , "Michael Ellerman" , Tony Luck , Fenghua Yu , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , David Woodhouse , iommu , linux-kernel , linux-s390 , linuxppc-dev , x86 , linux-ia64 CC: Zhen Lei , Hanjun Guo Subject: [PATCH v8 5/7] iommu/vt-d: add support for IOMMU default DMA mode build options Date: Thu, 30 May 2019 11:48:29 +0800 Message-ID: <20190530034831.4184-6-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20190530034831.4184-1-thunder.leizhen@huawei.com> References: <20190530034831.4184-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.133.215.186] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The default DMA mode of INTEL IOMMU is LAZY, this patch make it can be set to STRICT at build time. It can be overridden by boot option. There is no functional change. Signed-off-by: Zhen Lei --- drivers/iommu/Kconfig | 2 +- drivers/iommu/intel-iommu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 1.8.3 diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index b5af859956c4fda..af580274b7c5270 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -79,7 +79,7 @@ choice prompt "IOMMU default DMA mode" depends on IOMMU_API default IOMMU_DEFAULT_PASSTHROUGH if (PPC_POWERNV && PCI) - default IOMMU_DEFAULT_LAZY if S390_IOMMU + default IOMMU_DEFAULT_LAZY if (INTEL_IOMMU || S390_IOMMU) default IOMMU_DEFAULT_STRICT help This option allows IOMMU DMA mode to be chose at build time, to diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index a209199f3af6460..50d74ea0acdbdca 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -362,7 +362,7 @@ static int domain_detach_iommu(struct dmar_domain *domain, static int dmar_map_gfx = 1; static int dmar_forcedac; -static int intel_iommu_strict; +static int intel_iommu_strict = IS_ENABLED(CONFIG_IOMMU_DEFAULT_STRICT); static int intel_iommu_superpage = 1; static int intel_iommu_sm; static int iommu_identity_mapping;