From patchwork Thu Jun 13 08:42:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhen Lei X-Patchwork-Id: 166711 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp949389ilk; Thu, 13 Jun 2019 09:12:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+iDPCjq5vaRtim5cWs991qVaXwG12hVxQvNmxYXBxxlv7emDh06rBAmekyKnRm8VbpRRM X-Received: by 2002:a65:6116:: with SMTP id z22mr31216909pgu.50.1560442359156; Thu, 13 Jun 2019 09:12:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560442359; cv=none; d=google.com; s=arc-20160816; b=xpuTmNob0XLaEOiqNnl4tONlg4Ilz7RDMiQ2e1jVFq59nkr/UQjkt4cd5iCpbuKkoZ GZwNYUzIccpXlkg9AHmMyz1YaxgboumaFsZ2D6uGco5ERrsEWa6Lyh6C8Ijbs1kOiHJs IoXPWSpsCA592bhZvG8p3y+Kactx3B85LNwz73SjCKlUVelJHfdBwJTwmZy8VLbvSApE R0nqQHz7e1QnpXITlP9XuVfEcmiUozgW/6hIpiY3Acw59T6fuwI+tc1TLDf2ZcxfdTOj Xap8W5MTuvRDAjszCDr+v1p1e1s/WndGM0VjSizmsbqpooENH/P3Ig8PBCK3rG9ypd+Y mcBQ== 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=2hMqB8wnd8JIsqUGiBkN01uB5MitCJPfunCisR9wa/w=; b=mo1ZeF/utS5GMYHo/z42giaF6xvxFkZZ9XcsKWTZqtteEGllzMKtqQe0yxeFSL90ev BOhBsDhBmsdDCVWS1RG3mRuuXQLQIvSJSGJWbAFMMS2sRuslYunu4AYmJbreX6t2k11B ryf/f9e7FTL7ZbWPxxBDicjrK7zrBa7xBFrgpZpyZ7SHRfODBvwLbyajJydesUSrxR1l nidRC7KFQcN7WBwu3i5UVFnZtVvzJnmJ0SFUhjpJdo6LhHVbJNPKm4jgKC0DTVtR2fEC cWyHfiH+zP83RnX1qYz07ePhrWLv/Oj6GQr3AF3XhgokTuzDEc6SR1TSxFxV8ARTVJU3 3U7A== 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 o3si48958pld.102.2019.06.13.09.12.38; Thu, 13 Jun 2019 09:12: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 S2391510AbfFMQMh (ORCPT + 24 others); Thu, 13 Jun 2019 12:12:37 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:18564 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731222AbfFMInM (ORCPT ); Thu, 13 Jun 2019 04:43:12 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 7C2EF437288702CB4296; Thu, 13 Jun 2019 16:43:10 +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:42:59 +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 1/7] iommu: enhance IOMMU default DMA mode build options Date: Thu, 13 Jun 2019 16:42:34 +0800 Message-ID: <20190613084240.16768-2-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 First, add build option IOMMU_DEFAULT_{LAZY|STRICT}, so that we have the opportunity to set {lazy|strict} mode as default at build time. Then put the three config options in an choice, make people can only choose one of the three at a time. Signed-off-by: Zhen Lei --- drivers/iommu/Kconfig | 44 ++++++++++++++++++++++++++++++++++++-------- drivers/iommu/iommu.c | 3 ++- 2 files changed, 38 insertions(+), 9 deletions(-) -- 1.8.3 diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index 83664db5221df02..fe715fb295c6ed2 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -75,16 +75,44 @@ config IOMMU_DEBUGFS debug/iommu directory, and then populate a subdirectory with entries as required. -config IOMMU_DEFAULT_PASSTHROUGH - bool "IOMMU passthrough by default" +choice + prompt "IOMMU default DMA mode" depends on IOMMU_API - help - Enable passthrough by default, removing the need to pass in - iommu.passthrough=on or iommu=pt through command line. If this - is enabled, you can still disable with iommu.passthrough=off - or iommu=nopt depending on the architecture. + default IOMMU_DEFAULT_STRICT + help + This option allows an IOMMU DMA mode to be chosen at build time, to + override the default DMA mode of each ARCH, removing the need to + pass in kernel parameters through command line. You can still use + ARCH specific boot options to override this option again. - If unsure, say N here. + If unsure, keep the default. + +config IOMMU_DEFAULT_PASSTHROUGH + bool "passthrough" + help + In this mode, the DMA access through IOMMU without any addresses + translation. That means, the wrong or illegal DMA access can not + be caught, no error information will be reported. + +config IOMMU_DEFAULT_LAZY + bool "lazy" + help + Support lazy mode, where for every IOMMU DMA unmap operation, the + flush operation of IOTLB and the free operation of IOVA are deferred. + They are only guaranteed to be done before the related IOVA will be + reused. + +config IOMMU_DEFAULT_STRICT + bool "strict" + help + For every IOMMU DMA unmap operation, the flush operation of IOTLB and + the free operation of IOVA are guaranteed to be done in the unmap + function. + + This mode is safer than the two above, but it maybe slower in some + high performace scenarios. + +endchoice config OF_IOMMU def_bool y diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index f9cacce909d3ae9..05171dd0bd03aee 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -31,7 +31,8 @@ #else static unsigned int iommu_def_domain_type = IOMMU_DOMAIN_DMA; #endif -static bool iommu_dma_strict __read_mostly = true; +static bool iommu_dma_strict __read_mostly = + IS_ENABLED(CONFIG_IOMMU_DEFAULT_STRICT); struct iommu_group { struct kobject kobj; From patchwork Thu Jun 13 08:42:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhen Lei X-Patchwork-Id: 166710 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp948409ilk; Thu, 13 Jun 2019 09:11:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8d9MdMFFmRbYI7pNFSModZmRyCCLZohana4BdAhE8F4r981xJmpxpXqieyTXBWl9K7MYR X-Received: by 2002:aa7:8143:: with SMTP id d3mr91239662pfn.143.1560442312600; Thu, 13 Jun 2019 09:11:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560442312; cv=none; d=google.com; s=arc-20160816; b=xU5jINxitwazgrCEVgv0JwKYDGGvhAqgrDntE85RZasjnP0YwVNCHpxZ37t/AoRk/K 0+HD4xQAlSKLpSlqkE1IePTp6uSr7itpsCGVIbMzFtn7oyElMnN13Q91RudxALtAWxlk rBNgFxNKoigAqHB7an9hhAIzA6dX6nEXnnRRAPyHe1SS7dqHGdn3rg0rttwSsBSl7UJ4 bEbWuq+a0zOEd6Mv0v6LxK6/ygNM2JIh/39pCpXqVoh+MhO/mnR7gqYVNDd9hIpGwykx tMgpN9yh9lkFVJtDMTVbAneqpJSgAgm/ybj/EqRP4qC4VpGfXLHyd/XBLRt5QNSANaV5 sIHg== 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=wUygpQT8wkUwO8S9KieDXOaLQc4reo793+TryE66Le8=; b=tO2KKmloN2H/kv7SAB5fbDNeRe2HpzJ1eV9iDMTqrdNBnfgLVQzeEwswSxFALdoIlB CcbpFUOoWSRx57FM6a0uCe+1gkqt8V2SVqIfFIPjWBgwNYs2xgXH08Pgz8b9AQG/UI47 /2Mulwo3qwKqopKupEfu9xK5t81Bsb6doAdxSdwpJ+clakJrDYQfkDQD483ziBUQ0Slw Fd3GRJrqs5iZ0hG+Yw3EzZwqgAxdftS4XcTgJXtrkJ+PA/6mKG48QQPTW5salzLxtKfY gbExGtCnnW8Vm+1sjFtJdn4g3l7n6ZpZVFQLILUOQahSED/CrZEzJKZKCV+iayDu6qUE 38IQ== 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 w67si26744pfb.125.2019.06.13.09.11.50; Thu, 13 Jun 2019 09:11:52 -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 S2388672AbfFMQLV (ORCPT + 24 others); Thu, 13 Jun 2019 12:11:21 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:47966 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731236AbfFMInd (ORCPT ); Thu, 13 Jun 2019 04:43:33 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id C3A82CF1F307867B8BE6; Thu, 13 Jun 2019 16:43:30 +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:20 +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 2/7] x86/dma: use IS_ENABLED() to simplify the code Date: Thu, 13 Jun 2019 16:42:35 +0800 Message-ID: <20190613084240.16768-3-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 Remove the ifdefs around CONFIG_IOMMU_DEFAULT_PASSTHROUGH to improve readablity. Signed-off-by: Zhen Lei --- arch/x86/kernel/pci-dma.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) -- 1.8.3 diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index dcd272dbd0a9330..8c82b2e28a0fe2d 100644 --- a/arch/x86/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma.c @@ -43,11 +43,7 @@ * It is also possible to disable by default in kernel config, and enable with * iommu=nopt at boot time. */ -#ifdef CONFIG_IOMMU_DEFAULT_PASSTHROUGH -int iommu_pass_through __read_mostly = 1; -#else -int iommu_pass_through __read_mostly; -#endif +int iommu_pass_through __read_mostly = IS_ENABLED(CONFIG_IOMMU_DEFAULT_PASSTHROUGH); extern struct iommu_table_entry __iommu_table[], __iommu_table_end[]; From patchwork Thu Jun 13 08:42:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhen Lei X-Patchwork-Id: 166709 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp948314ilk; Thu, 13 Jun 2019 09:11:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqx1b5/knt/lTdTfHNU9E/HmRdp5U2elUCKr/hHqQbWoCe1qHiVsETOyovDiMvfuBBtqd5Wt X-Received: by 2002:a17:90a:30e4:: with SMTP id h91mr6145540pjb.37.1560442308188; Thu, 13 Jun 2019 09:11:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560442308; cv=none; d=google.com; s=arc-20160816; b=KiVwbzYLjGQ9h+3IzrxuZzTrMMb37QXUpf0vIYgVqHcxijR8KC43h5wj6nW/5OsdUB egf6iWVmrRr4vH1c8AjGwEmmLdTKlM0Yzz5HaP90ITEagxwuFokrcEGITQGT5FHOd3N+ p++Kcs7GkiMbfxQDRmLf1AhPON7DNGUbZ8lVF+MftFVdLlC2Alfs1xnxzH07TnUHO+uR vOGriAPPaOcLme9ypN11UEL2fLXJlSkPtb4tUDTphBWEo5XXBsn0H8B87F8VoaHOgmXs DN65+T2riTISPKDIIFFXOn8cGhUrpIEaSlMrg3Q8KE4nR4jHCclghaMWYd1rml4aJqwM 2axQ== 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=f91UXovWTOJ7S3uIF9AWstQ2mMW2xSeZjcGOjSgZv9I=; b=pXsji2HS16Rn7ow0V7UWdV2BCHaO/670APmnAzMqex99dSoOX0MIC9uljhwUOrVkpF FyytKwdKT0PXdTfP1KSuCAL1d/Pzf842jHPvlAU7CYxzfAa+9qCV0zuqEs0s8YcyA2E1 6s1kkbXLc9lh802b/kvUsQ1MYQjb0jrfAj+w5Tz9vlonm7xoHMSIIv2Hp0E1QN0xUuW9 gq+a61y3BwayHbd/7NeVIaIGdzMFiYkGHqlytHy6ksXX//xGOUURvsGzt9CGvepI7Jfp 1H1eLlNFgxiYbqNE4fMYjCsSkl+wt0okqpPq2FQId8D1qLzRlvQRbAYULM+I0paaRfxi 603g== 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 w67si26744pfb.125.2019.06.13.09.11.47; Thu, 13 Jun 2019 09:11:48 -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 S2391530AbfFMQLX (ORCPT + 24 others); Thu, 13 Jun 2019 12:11:23 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:18565 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731238AbfFMInd (ORCPT ); Thu, 13 Jun 2019 04:43:33 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id E75AE9BFC10B89B23C95; Thu, 13 Jun 2019 16:43:30 +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:21 +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 3/7] s390/pci: add support for IOMMU default DMA mode build options Date: Thu, 13 Jun 2019 16:42:36 +0800 Message-ID: <20190613084240.16768-4-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 is LAZY on s390, 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 Acked-by: Sebastian Ott --- arch/s390/pci/pci_dma.c | 2 +- drivers/iommu/Kconfig | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) -- 1.8.3 diff --git a/arch/s390/pci/pci_dma.c b/arch/s390/pci/pci_dma.c index 9e52d1527f71495..784ad1e0acecfb1 100644 --- a/arch/s390/pci/pci_dma.c +++ b/arch/s390/pci/pci_dma.c @@ -17,7 +17,7 @@ static struct kmem_cache *dma_region_table_cache; static struct kmem_cache *dma_page_table_cache; -static int s390_iommu_strict; +static int s390_iommu_strict = IS_ENABLED(CONFIG_IOMMU_DEFAULT_STRICT); static int zpci_refresh_global(struct zpci_dev *zdev) { diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index fe715fb295c6ed2..a8dd69d175fb3c6 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -78,6 +78,7 @@ config IOMMU_DEBUGFS choice prompt "IOMMU default DMA mode" depends on IOMMU_API + default IOMMU_DEFAULT_LAZY if S390_IOMMU default IOMMU_DEFAULT_STRICT help This option allows an IOMMU DMA mode to be chosen at build time, to @@ -89,6 +90,7 @@ choice config IOMMU_DEFAULT_PASSTHROUGH bool "passthrough" + depends on !S390_IOMMU help In this mode, the DMA access through IOMMU without any addresses translation. That means, the wrong or illegal DMA access can not From patchwork Thu Jun 13 08:42:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhen Lei X-Patchwork-Id: 166708 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp948223ilk; Thu, 13 Jun 2019 09:11:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqw8yOSsiAmLFGK0QoCRfXEcOKi1BAeQsxDhlAFXl9T0HIa6hZEj2nJgTV6+4Vquie63X13m X-Received: by 2002:a63:5f0d:: with SMTP id t13mr25061690pgb.358.1560442303454; Thu, 13 Jun 2019 09:11:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560442303; cv=none; d=google.com; s=arc-20160816; b=VH+3+3lc70B2QEz7bBHFTm/uV49MET9+P5KrUbbcd5T8yWH26kdPM98W1Pe3gJMtWO x2pUErV6m9uurxUQgSiWRIytICLqYeSGznYvvBqS5KV5wnHO3rhRljRnu/OjcrDpmLeT GOKZk+eQkWsSlDTqmK8bbtNPHcwumSB7LsEmCfJYvq+zXFT9z8yaKGt9flUMHY9bX6z9 jMKyaeIWxOW4Ghpb0WiLlVGQM0KhKPgn1e3qm4KGoUtm+0hVphj/coiO6xE7aIXb5OqD MzcDk/RE6OgX59eBZFPPqJWWhxwfkK8T0yifkMenoJup4n/ruiPB/aq87JsKlxKDfhV7 VbMw== 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=ajDkxYtaTG7eHg7VZ9mslt65bkZWI5l3O39aMgF8aEE=; b=BZi51Fm7ttrjS3uM8wYWzRDK/HAFhdFCPK0+q+6HaIO+AhkZp/RvUjvUdFPP1OB+dP 3NCH7qrMHp6Jkg7ZtaXDn40ueJkU5Da0mWBn4ygz4m/EiPTv8kCEDpRMSIcZQxlSObhV Ut+5pEBAX5P3S6LJGxJeG8+MnblpauswJfr9slys/WccEu/3JX+al3hmThYS8x1V9ybd Y0PCJGVBj7v06NiZ6B7C258dj7m/ZRhOfQOegzpiczHlIfj/envhAH5gUHEFl2k/aouO rSE8DjP3Abl4r6CbXP8icHfklY0nzbDBWSpDYuZEWQIuF8TPw3YwVfK+q6Do4WgfETcC icAQ== 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 5si40121plx.200.2019.06.13.09.11.43; Thu, 13 Jun 2019 09:11:43 -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 S2391557AbfFMQL1 (ORCPT + 24 others); Thu, 13 Jun 2019 12:11:27 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:47950 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731237AbfFMInd (ORCPT ); Thu, 13 Jun 2019 04:43:33 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id B78189A2D36077A28788; Thu, 13 Jun 2019 16:43:30 +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:23 +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 4/7] powernv/iommu: add support for IOMMU default DMA mode build options Date: Thu, 13 Jun 2019 16:42:37 +0800 Message-ID: <20190613084240.16768-5-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 is PASSTHROUGH on powernv, 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 --- arch/powerpc/platforms/powernv/pci-ioda.c | 3 ++- drivers/iommu/Kconfig | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) -- 1.8.3 diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 10cc42b9e541c46..27e25e8e3a9c637 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c @@ -81,7 +81,8 @@ void pe_level_printk(const struct pnv_ioda_pe *pe, const char *level, va_end(args); } -static bool pnv_iommu_bypass_disabled __read_mostly; +static bool pnv_iommu_bypass_disabled __read_mostly = + !IS_ENABLED(CONFIG_IOMMU_DEFAULT_PASSTHROUGH); static bool pci_reset_phbs __read_mostly; static int __init iommu_setup(char *str) diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index a8dd69d175fb3c6..bfbcaa24e283aad 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -78,6 +78,7 @@ config IOMMU_DEBUGFS 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_STRICT help @@ -98,6 +99,7 @@ config IOMMU_DEFAULT_PASSTHROUGH config IOMMU_DEFAULT_LAZY bool "lazy" + depends on !PPC_POWERNV help Support lazy mode, where for every IOMMU DMA unmap operation, the flush operation of IOTLB and the free operation of IOVA are deferred. 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: Zhen Lei 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; From patchwork Thu Jun 13 08:42:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhen Lei X-Patchwork-Id: 166707 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp947434ilk; Thu, 13 Jun 2019 09:11:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsEcic0CwtgtPBaaqTyeOiWBz+LMBs6yFMNJotoCtvUhdMzyjOA3S4T6wLno/xcp3Bc4Co X-Received: by 2002:a62:ae01:: with SMTP id q1mr38629351pff.219.1560442260379; Thu, 13 Jun 2019 09:11:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560442260; cv=none; d=google.com; s=arc-20160816; b=kW6nEzZFxCsdYu65efSYnTegI2jXgSvF1Y6Dkzu0zUFQSaGPSQa3OsZqfbDT+0rH+3 onL7ZCU18kPRvnC/7mVN1JREYxj11u3G76tLDWadQL/kgF2DUEGrZGSi8WRvBKybDrGG YVFC/Fo7wJDRULi1RmSDH+51DbucXTqw4mWTaTB8wS3NLaY1qjBQ3K0GiWsXmLMADT33 F8w77IpM6zYut9Q1yvFrWrW3Pr5Wlzajw/bmOXHKJ8gRp4PQM4Uz4K3H+VBRVzIlwrQf ORCqiXSBTp2rYRN7aV6JardgYNBNpSL419Q5pMQZv6gWZf/fNGE4I6Ahkfgtxp1PlRQt TlWQ== 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=eKEdWt8MLxHsIXuUYZfWT86sHV5rs18RCJ06nZyjvGM=; b=iwNxpyapFWecShnWXCRNWyRgJOuKOz3J3iy3MVi/E+uxD+WsG8Qu04PHzpBVKJigI5 axOKTKAWLhChmgiHgwkNhv8gBbkaMDIUeamD2efoWcE6rVwG+QVEpUXGBjfo9jewF2RZ tuPSxegoPx7j+dnm3sII4sxEcYwd3d3hkDBudUeYkihp9FFhyoXC6tKEnKKmigJITUmk hJXlka9K/G+Aco+SvAXpNeIjpYrfZrKAjNYDVsyQX2IKjpn4UaAuNNqYErPxSwSkyKz0 pnrQHFjqdyUSlMDuXpFK2GmZXulYgqYd2WCQv6kRycuCZbp/97aLjbn8fctKjc7bLCzC w8GQ== 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.10.59; Thu, 13 Jun 2019 09:11:00 -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 S2391321AbfFMQK7 (ORCPT + 24 others); Thu, 13 Jun 2019 12:10:59 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:18145 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731246AbfFMIno (ORCPT ); Thu, 13 Jun 2019 04:43:44 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id E9BFCB3E969C7057F6F3; Thu, 13 Jun 2019 16:43:40 +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:32 +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 6/7] iommu/amd: add support for IOMMU default DMA mode build options Date: Thu, 13 Jun 2019 16:42:39 +0800 Message-ID: <20190613084240.16768-7-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 AMD 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/amd_iommu_init.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 1.8.3 diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index fd297b0e0330d27..70741fd73b07785 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 (INTEL_IOMMU || S390_IOMMU) + default IOMMU_DEFAULT_LAZY if (AMD_IOMMU || 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/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c index 07d84dbab564e4d..b7d5c1757425946 100644 --- a/drivers/iommu/amd_iommu_init.c +++ b/drivers/iommu/amd_iommu_init.c @@ -154,7 +154,7 @@ struct ivmd_header { to handle */ LIST_HEAD(amd_iommu_unity_map); /* a list of required unity mappings we find in ACPI */ -bool amd_iommu_unmap_flush; /* if true, flush on every unmap */ +bool amd_iommu_unmap_flush = IS_ENABLED(CONFIG_IOMMU_DEFAULT_STRICT); /* if true, flush on every unmap */ LIST_HEAD(amd_iommu_list); /* list of all AMD IOMMUs in the system */ From patchwork Thu Jun 13 08:42:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhen Lei X-Patchwork-Id: 166706 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp947220ilk; Thu, 13 Jun 2019 09:10:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWquAPX54P2kTZIjARf8w8EdCS3Tt/hcqiMrXwXUJGChCT3jjmxmqRawZl+9o4Sd4rTCKD X-Received: by 2002:a63:306:: with SMTP id 6mr18313581pgd.263.1560442248651; Thu, 13 Jun 2019 09:10:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560442248; cv=none; d=google.com; s=arc-20160816; b=wNro6Ey9GZB3AfGwvNnqg3OQEu6EHXrHLIw3eKV4U/BgraSpQcfreqZvrCaUlQyWhN o+x5fjW4kxZZ0pJvP41VrGtrgqtAlqEuffZ+/Vd5488iSyjJP7MkNbWlYVu7QTV37vO6 0bgxQaTxHTLYT60oLQ2qT6CJVVuBgJscdeKc2kGD0z8LXhjKwmpvWGj6q2AqXCPeg54k /c5wR7NJzthRYHLEVkn4lYivdutLy5jSKBltrSp1VkXsWgRNsYobs+M/GG3shCcXDHyv MstNvf25riF5IukWlpdCYOV4dxE/b+jfAhx1n+g6iTTVy8Sw0W1E18ifA+ht7q8nKpaZ PDWA== 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=4msoeWJtDr0PJ8r8tNJt4OvTV64iTzPl4ALoFuQFEO0=; b=MfxjiLJirhEugF/23msz3XQDO9EufoV/IkCnouQJ8aemZUIxE8gYgSQ9rxE0cSnxWj shvEMtgT9WwxiHopGLIzK96kv2QN9qQTddOv/AaUJlRhGm4EsCbctRv2XeYim5IJ57Og pcLd4AIV2dcYnJZs57A7ujFjN48lRatmiM6mVOnTQCMgP147A/TqtubAhzDaeaUp+w8T 8LF5Qo72WPUX5G1IM0rzOYtGyhvphLFo5+Apiq1bGoHBUfAVtiM8U6eTBkD+XGBUIDz4 4mkR49tWNyygDH45SaZN7Pg1xIk68qldgDi2X/Rz9nT6MOdmSJrcYgAbT1rq0z9smEe3 QJ8A== 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.10.48; Thu, 13 Jun 2019 09:10:48 -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 S1729962AbfFMQKr (ORCPT + 24 others); Thu, 13 Jun 2019 12:10:47 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:18144 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731247AbfFMInp (ORCPT ); Thu, 13 Jun 2019 04:43:45 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 018BD55A1FCA4A250BE7; Thu, 13 Jun 2019 16:43:41 +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:33 +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 7/7] ia64: hide build option IOMMU_DEFAULT_PASSTHROUGH Date: Thu, 13 Jun 2019 16:42:40 +0800 Message-ID: <20190613084240.16768-8-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 DMA mode PASSTHROUGH is not used on ia64. Signed-off-by: Zhen Lei --- drivers/iommu/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.8.3 diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index 70741fd73b07785..63506f1cad3d149 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -91,7 +91,7 @@ choice config IOMMU_DEFAULT_PASSTHROUGH bool "passthrough" - depends on !S390_IOMMU + depends on (!S390_IOMMU && !IA64) help In this mode, the DMA access through IOMMU without any addresses translation. That means, the wrong or illegal DMA access can not