From patchwork Thu Jun 13 08:42:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 166713 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp949803ilk; Thu, 13 Jun 2019 09:13:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqwng/ZPlZYfiL0/Vf6pT9J5Ps3ZDS4vdJJCusiIm5rkws070SSVxYzewaDBlNoVh3DNnz7M X-Received: by 2002:a62:ed1a:: with SMTP id u26mr68056923pfh.229.1560442268630; Thu, 13 Jun 2019 09:11:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560442268; cv=none; d=google.com; s=arc-20160816; b=zc3G5kh7+zrglc31qf3LcKro6gM1zADv7WfFGnSRqyF1WknJqRCTWBf8TX3V9S+H5z WYGCm4IKF2NXPXolOM7EkVP9jNslg9t/qyv8BoDw2TGtBEryeL8jXEKMQsv/trxXmqdi 3RqhmbugBm72m7zaUdAjfPaK2u/U9vnZuN5qoTWC+oSh6kQHgk44mBA7D5l6mS1Fw8xX 0Rt6IphXvni4KadWBeeF5oQACuC+bY04Ekjc5n2/GZNepn4KjeqNzY1Z+5O4rHAzJ+Fs A0rbAfpfmu+eLsDJ84Cjwk7EXx4uu/Srf9WMNcZdCQwN8FPGW5LQ6wgta0J0MohTBjqy +JMA== 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=X65SEznOZGw6dauVD5gGpItH5z7D+xEQHe1RTCHHpXw=; b=iby/Y/aj1a0tFsTKjvxCjdlmGivKvdnlNzZe0ysDifVhG1c4VhGbQ3y4dCUwC7ww0N q3PZMVLt7JIk7F0UFlz6jZozBAyUlzc3gW2Yx8U+ux36CZNqJgKOCkgtkTekP5P/HijT mRlCSyENNXd4EyGP9XJYsu4lG+p2/GPxMFpng2ILV5Fg3gLrVJwI87aYQ8AfuEdKKaiB 8F7CY3sG92v7k2yOJQCPykt556TktlqSP00NLL4axfs6gLJ6ELg9WaUtJeoe86vifSxZ PlAxmWujEbpY4WLUlgTif+7GNGD6Vvhfmlcl3awq08neK1Y7ZZ4LKUqDc9AyB3YjLVeu 1YlQ== 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 194si166048pga.203.2019.06.13.09.11.07; Thu, 13 Jun 2019 09:11:08 -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 S2391503AbfFMQLG (ORCPT + 24 others); Thu, 13 Jun 2019 12:11:06 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:48142 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731240AbfFMIne (ORCPT ); Thu, 13 Jun 2019 04:43:34 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id E166594E45C93772A88C; Thu, 13 Jun 2019 16:43:31 +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, 13 Jun 2019 16:43:24 +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 Subject: [PATCH v9 5/7] iommu/vt-d: add support for IOMMU default DMA mode build options Date: Thu, 13 Jun 2019 16:42:38 +0800 Message-ID: <20190613084240.16768-6-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20190613084240.16768-1-thunder.leizhen@huawei.com> References: <20190613084240.16768-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 bfbcaa24e283aad..fd297b0e0330d27 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 an IOMMU DMA mode to be chosen at build time, to diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 162b3236e72c3c8..ec5515b7831b23f 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -354,7 +354,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;