From patchwork Thu May 30 03:48:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 165390 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp413179ili; Wed, 29 May 2019 20:49:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzoD/hPXxp67RoPErTMJTL0TllTW4oVB+4DYjHDfDzuQqYEWAp7dwPcL2ZwpC8DVOMFw8U/ X-Received: by 2002:a65:454c:: with SMTP id x12mr1779545pgr.354.1559188174520; Wed, 29 May 2019 20:49:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559188174; cv=none; d=google.com; s=arc-20160816; b=ofUrywQjodpxEy7VTjzaI+NCHoHl/83Ys2805LBrjGtfK4irQETtdL8RZ+C5pZGA1L YxW1QqIYdB7/KdMwQRNcfMOjyavPE9YhVdSkOuuk4z6F08BvHLaICzTCOJ8EpIpY4/RC dU16UEjhWKe65YOynQnuf0fmM51YAjSam6qskh6EYk41Qh+IiaBRmT6Z4mTnxiEjvAQ9 IIgoAdklH4f3LmhLrdB67k6A/gbV3b9WNVG7+7goJ5ATKUjb/UNCsFcwZlmpgvhOddnE qYi/M/R2FovzDrEgtJKTOWd+XXvGqq9mQzIUsZDqKpI9YfvI5GZWqILpcPplPAVWCu3N 7knA== 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=J0YHMDJUckqY1Zln72eJvrl7aXZg+N2bVe2z9wEe8AE=; b=xMV7TXI/KhlcxPGIj9R/7uxK9FEnQ+lAYe+WES7M2nU5EYKGkbmfPZcoZ3hQBcTFBR YNhT3zWe3JZdnzfk1TZUm9fayYJ/MWHvf/fm6gVcsu7Nwk3JLM7rXPbjha2usNbxTPl+ XfFmZOb0lSLfTk3UE+tYsTSh56FMlDXmeahzGBJYdYI04AF9GbQTKEfu3dHKjsAceNa5 Kcz4NuXUQvH1AS1NVePifp4/giI/+0sqsxJZttEVa56LuR42pxFECGntRdBPORG8z4An WUehnwl1k5/aXwkhsxXR7PyKlTD0T1DK8EWZ1Piz2D3Ro8y1sCmD99RsjmcXgVEduYGN 6CKw== 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 j12si1972675pgp.118.2019.05.29.20.49.34; Wed, 29 May 2019 20:49:34 -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 S2387757AbfE3Dtd (ORCPT + 30 others); Wed, 29 May 2019 23:49:33 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:18051 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387654AbfE3DtZ (ORCPT ); Wed, 29 May 2019 23:49:25 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id DB4C41F0F32B9FF7AF5D; Thu, 30 May 2019 11:49:22 +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:12 +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 1/7] iommu: enhance IOMMU default DMA mode build options Date: Thu, 30 May 2019 11:48:25 +0800 Message-ID: <20190530034831.4184-2-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 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 | 42 +++++++++++++++++++++++++++++++++++------- drivers/iommu/iommu.c | 3 ++- 2 files changed, 37 insertions(+), 8 deletions(-) -- 1.8.3 Reviewed-by: John Garry diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index 83664db5221df02..d6a1a45f80ffbf5 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -75,17 +75,45 @@ 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 IOMMU DMA mode to be chose at build time, to + override the default DMA mode of each ARCHs, removing the need to + pass in kernel parameters through command line. You can still use + ARCHs specific boot options to override this option again. + +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. If unsure, say N here. +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 depends on OF && IOMMU_API diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 67ee6623f9b2a4d..56bce221285b15f 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -43,7 +43,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 May 30 03:48:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 165389 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp413107ili; Wed, 29 May 2019 20:49:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxLpVPNrmEOs+pQN3DDqDxxEVM9JIETdQpuQLH6+b5nvcpfKeo05WAEjj26kzPgstYR7erA X-Received: by 2002:a65:4c07:: with SMTP id u7mr1698817pgq.93.1559188171390; Wed, 29 May 2019 20:49:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559188171; cv=none; d=google.com; s=arc-20160816; b=aVgfOA5E6EQUZAvrmRpJnWZPG6aDPmcSzC1eC40B6IMizh8HdyVuzet2DHZ6zh7zBT DIMHOyjBxOhMtm3TjUNiT9PKmSwmQ428U7IXPwpw1dNwrhDazZZVP721lK3CBDhHpet9 sP3juBtFXvOpuwWXuYYk3WZel1HD74U5mc6iC+xGJSBrqtitWYv4dzNtOqHAj4ByD4a2 6qfyIohd6B02xRshP7V4wPKqPCmwGKPRukOR2wisQh2/dxyGljSXWnX9vD7SyLBu55UW E6BddkSR1p/i44C1htgD3fr4ySosU90OMn5oPBfcwzp8Mgqn7eAtexUd8ugBbRAnDuIr rVbQ== 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=EMwxPwrXT4aGD3UIdIb3MLbbOKmq83JXPzpOBcr7ePM=; b=sPtGISa9PGuP6me9os5M7L9rHSHq59bbkslYW19ig8MjDUjm1iDCOcPE2Ro84mLL4j 3BX06OO0k+ns8J2pbSlNmsoWqJm9LRC4kIXPuNpi5rRUYpEqUX4XNFCbyAY+JSUEOGw1 drV2FaitcN5ZXQRqPeBtlpilqFpdlhTv4dJxycLNOizP6sWu6NJe2T9OYg9hUj0EFP9E vYIOBmDA5szEu2mRziZLPv7rrC+wih49OAJQu0STgjbVO5Nq3S0dAnJe+CpzdkLg/jgo TCWez2aEnf3hQDKXpuo+iw3uQ6CsmRqLcikamBnIKEl6gReSbmlEipIjbfY0AE3UG2c8 YbjA== 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 q23si2157822pfh.28.2019.05.29.20.49.31; Wed, 29 May 2019 20:49:31 -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 S2387720AbfE3Dt3 (ORCPT + 30 others); Wed, 29 May 2019 23:49:29 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:18048 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387647AbfE3DtZ (ORCPT ); Wed, 29 May 2019 23:49:25 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id A67C82750DE3F619EF3C; Thu, 30 May 2019 11:49:22 +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:13 +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 2/7] x86/dma: use IS_ENABLED() to simplify the code Date: Thu, 30 May 2019 11:48:26 +0800 Message-ID: <20190530034831.4184-3-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 This patch removes the ifdefs around CONFIG_IOMMU_DEFAULT_PASSTHROUGH to improve readablity. Signed-off-by: Zhen Lei --- arch/x86/kernel/pci-dma.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) -- 1.8.3 diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index dcd272dbd0a9330..9f2b19c35a060df 100644 --- a/arch/x86/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma.c @@ -43,11 +43,8 @@ * 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 May 30 03:48:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 165388 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp413025ili; Wed, 29 May 2019 20:49:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyKA8GMKH65ZtdMMoDdgwq2HIC11b/bCY8ec9Ui78hIrPnqqcRMFcd7+vz7+f8/Gq0tLa4b X-Received: by 2002:a17:90a:ff11:: with SMTP id ce17mr1537801pjb.128.1559188169100; Wed, 29 May 2019 20:49:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559188169; cv=none; d=google.com; s=arc-20160816; b=TYJvkLxVgJOmHjzNFrhsfbVw8KUF849FmOtUd4sozmY64Bn9ca1y+EeBuR6FH6e3hD Z4JgTeE+dTLlHnLMgnF9YMqVLc+auN3cBumUYaAH2O9R6A9qj20NoZtMZ3MpXZU139Ft CSb1s5SrkpjHr9/R1ZLIK55ItKVn4CS/Ug1hpwdHPUohew9Jmg1/0ehDh4OLttOI1u2g tuS3JS2Ahaij3bNVKirPNWHzFJyarijG4mb8+Ibcn7HCjcfBk9jcQfIi8thncsLcRXIr UFTIjLi32ysNy6n20ikRT5ePkurAfcYk4gs/WLv3wtprrirSQbpV+6MVmdFjujCbMo7m h+dw== 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=2H1W7kgSrb6CxhhToAffNkP/dlG95qPxFBfMDuJcwwM=; b=EV/VfyxmrT9xO5c3lC0A9qpt8Vz2SiUcI9Gpbnj8kvdqe2GR3UI++AKvg8I6y+zlPd aT1PkcvATJI9rLtVk/eJHIJGT1K9fdRzdZCrXkqUjMJMi0b/U1qZAt43Dw3SwjiEGbHc 1LiaC1trlFVgUhqAW0fezHy3jurWsLZM/GOrJoRsdxngSoFkYl/HC2BgvpAy5L8zWkju Ukar4kSSDgs66uKM1tpAy3Ga3dmiKiPy+AvKJAchupLbX7aZ9530QR+QL/UF9e/3Nq/T 65O3wj2Q3VwMvoqDChwuicolwxMPZYpHed3gDt0eh0SuIRH90WJOehjeAcZstmQToTJs tzIA== 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 q23si2157822pfh.28.2019.05.29.20.49.28; Wed, 29 May 2019 20:49:29 -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 S1732257AbfE3Dt2 (ORCPT + 30 others); Wed, 29 May 2019 23:49:28 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:18050 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387653AbfE3DtZ (ORCPT ); Wed, 29 May 2019 23:49:25 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id BDE66C3CFC5D45E96D5B; Thu, 30 May 2019 11:49:22 +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:15 +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 3/7] s390/pci: add support for IOMMU default DMA mode build options Date: Thu, 30 May 2019 11:48:27 +0800 Message-ID: <20190530034831.4184-4-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 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 --- arch/s390/pci/pci_dma.c | 2 +- drivers/iommu/Kconfig | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) -- 1.8.3 Acked-by: Sebastian Ott 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 d6a1a45f80ffbf5..9b48c2fc20e14d3 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 IOMMU DMA mode to be chose at build time, to @@ -87,6 +88,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 May 30 03:48:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 165394 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp413416ili; Wed, 29 May 2019 20:49:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwikJv92OuvOzInkl/ylBV7JOq1he77y5qcZxadmYLcBPdzHXwuh5aKEBU0Zg7nxtJLJQOX X-Received: by 2002:a62:d244:: with SMTP id c65mr1587869pfg.173.1559188190543; Wed, 29 May 2019 20:49:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559188190; cv=none; d=google.com; s=arc-20160816; b=PDbnRHyXXIDZGbvg5gp1Q0UMJgl1B5CJOlsRQmsY+7oexvZRNtkSMW9OBgMeL2QLSe 5VvTk7RWwWy95qpiMqcza0PMd6TDCFHv2iCpqdpj/fhsj2I0L+HZjOlQDPeAJ5/bisWn wZ/jZLMH1o2iSO/jS3ePOz0W3UKIJE7aH/cJhkUGvFdGpt/HNMGklij6COC9jDt7ej/s BK5ENL4+ZFl4EuWROW+SRH1AwFNTKrxDV/H5w+5f9S7afLtcVuZvPDhJ0c3FVh4LI9zt QnCNn1L3M166g72fYk3CaCauoskCDThPk+z17RjJHr++iaVvC7FrZgwWc+vkoeYkd0jM KUmg== 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=7XONKfTAc43NGqae20IqqC+fvcYa+mXypFBXy4pQ5qg=; b=SoSCgR24yURSHA3Rx1EDURys7Au20Do6Ukw73oS0669M3ZoORNpenvyrvsGZ8dNMmJ HV5u5Zz5bg5LXN3XK56wMiuEBSBATK4cXdZZvELq1xQcxowOLGpyTXmH3tEuFcs7RSjm B5oPA6QO6tc9i7kdSoQRR1DhNwkAcnDah+/bsTVlcRXaryiFVlorhrMcL6YjUsxxDSxd FMVkcHvBUxa/TzvjqI0l5hHjH+WoEtVD1EGQ7kIZraE6e0g+4hLo2XF4FJD5c8ZKnRwo 8g5HqJBDgPc7x8ydlxJg+jjBQUtird4d37JZPU9x9du7uymzRoD5DECsMdzBj7SgdRp7 PcLg== 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.50; Wed, 29 May 2019 20:49:50 -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 S1732281AbfE3Dtf (ORCPT + 30 others); Wed, 29 May 2019 23:49:35 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:18049 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387651AbfE3DtZ (ORCPT ); Wed, 29 May 2019 23:49:25 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id B27A09DAB0CAA2FD2FCF; Thu, 30 May 2019 11:49:22 +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:16 +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 4/7] powernv/iommu: add support for IOMMU default DMA mode build options Date: Thu, 30 May 2019 11:48:28 +0800 Message-ID: <20190530034831.4184-5-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 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 126602b4e39972d..40208b9019be890 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c @@ -85,7 +85,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 9b48c2fc20e14d3..b5af859956c4fda 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 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; From patchwork Thu May 30 03:48:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 165393 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp413333ili; Wed, 29 May 2019 20:49:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqwcaX8IdYajVwRr4OJsJxtGU8bkiD7K/UDou41yxKV2T5Ica1FkzLeiyjDYGtnKquHY1Rm3 X-Received: by 2002:a63:6841:: with SMTP id d62mr1753912pgc.17.1559188185372; Wed, 29 May 2019 20:49:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559188185; cv=none; d=google.com; s=arc-20160816; b=oZiOfNrKzxU2RYvjkhacLGtXMwYeAExMItp6LTyoEFnZkSp7VQfRBwXJutRwA9MwzC 2rIdqNAKiknz3pu6LA6KycRv6jB9T/73w9f+rq6k62ecepFOco+JcOj+8o7N99HOehZI X7+FL2+5xDL75Ts/3aCIN3X1pE5362prx6JObTY8ROREr0nCN3liz+TGytbh5MDJANpl Xyd5KuIBLivgt7VveU/wSX7kvK4PzRzzf56hXXn0sNcYC66XpyXpWeKph/+XjpG9sGi7 uXw8FjmvzyRD7QcaMdzwy+J38tPSPtGNd61T2ZSmCfm8PkLseeebWubdpLdQYuzCYe4o aIqw== 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=/hwmLTx5iCv46ZfOHgI+oe2n74rdKHKJa/P1RJ4lpsE=; b=K/GgBvZxGP3NmUNw3EYh8lEWynt84HetjcJ4QJC/1+iPaPmu71vCoS1rfu2FPbtGki HiFUzX35q/ld7IXn+N2NGJ5QlRKoT5U6yfEnvkR/Q/oBNrtF0/LRW/CGlB+RSn3R9I9o eDVp7ntJWPgf0+T40beIJfi8A91BLORs1qSC47MCHE8QytoxsHTbVlLlCKbqzDK3kIfw P1Q7PlVXoqD05RjlELKZgdomOn+1UJf4kd7TzXoYXwBXuajmbkk5k6uzmAuOG3uNjyx9 jkcleNtVD2uAhMehRdtm31tXCw1w221Cg3jW3zo/sl5ZLyPgQIbeBE3dKAItcmMYK3GI jlfg== 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.45; Wed, 29 May 2019 20:49:45 -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 S1733266AbfE3Dto (ORCPT + 30 others); Wed, 29 May 2019 23:49:44 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:53288 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387743AbfE3Dtc (ORCPT ); Wed, 29 May 2019 23:49:32 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id C7C93B2D6DC8094364CD; 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:19 +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 6/7] iommu/amd: add support for IOMMU default DMA mode build options Date: Thu, 30 May 2019 11:48:30 +0800 Message-ID: <20190530034831.4184-7-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 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 | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) -- 1.8.3 diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index af580274b7c5270..f6c030433d38048 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 IOMMU DMA mode to be chose at build time, to diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c index f977df90d2a4912..6b0bfa43f6faa32 100644 --- a/drivers/iommu/amd_iommu_init.c +++ b/drivers/iommu/amd_iommu_init.c @@ -166,7 +166,8 @@ 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 May 30 03:48:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 165392 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp413308ili; Wed, 29 May 2019 20:49:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqzCyZf5eJsXpbLjf40UoregIiXF9SdgJNkqSW9+Y2XDWtvdrUtmrfsI5H+VfR0N90c/9wE6 X-Received: by 2002:a63:d04b:: with SMTP id s11mr1738107pgi.187.1559188182789; Wed, 29 May 2019 20:49:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559188182; cv=none; d=google.com; s=arc-20160816; b=I2UJrwn7+wzRZKBQe0wO94rkaHwDtdgWeYRBl9RPG5+SlNGQ9PKwyo+QSVO3bPNcM7 KUj1iqXdBdo5zuS0RAiYw9oA1Y2yvMOg2xgXHs5WhZYxgGik81tRtS+6RsaXA1gsRrEt qAD4fOtmcqYb1kq9v/kNdj5cjuZl2XbhvD+W4KnSoTwILGqk+9M8AMmVnJPl9mV+SJN7 9lT9L7BxlBewcDmbWBmWVHQf+i79H0/q+zKbafKHONZcPYpwiM307HG/3/7u8oxhQNX+ OBiGtE8kH+UQk0IxJD8EdDX+gyLDKWXMlEZ5m42KOqxd6FdmxSJAW8/Tc05ZJAPm/Q+n jh6Q== 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=tQpOPYl0rcI4D9hbYVnoJPVO3uAp02qLx652X4lVDfg=; b=NeNRq4ohwxUb6jat3kOYkAOAOqXsHpzt3M4uMGgm7+VJrwnDh1t3aRhQ790+rfX0pg Iyr9AeIO+CIFhPNNo27I6ojvmB7OAmB3eeltk2gvDjkQHF5cVv8/vKgSd/ZNyJVA1xXu tjYViiYvuQP35FrRFfSucqqu9LWcPS1uOueZFQ6fM65vJqrFQiubUPa0VljrBrBilbAM FW0deNVLsAHVu13opyhwS729zVGH/Qa9D5HfDK299MYD3MzfI8rSRPOC8+v75xmK0vyW 6LJ0n26MEHLjw4zrlT7A0aHfsUpQSAUx5NPljAZAQfz1xh/37wpGVrZz67Mj+VjckHoV U+Cg== 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.42; Wed, 29 May 2019 20:49: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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732959AbfE3Dtk (ORCPT + 30 others); Wed, 29 May 2019 23:49:40 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:53280 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387710AbfE3Dta (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 BC38EA36FC591233E71A; 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: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 , Hanjun Guo Subject: [PATCH v8 7/7] ia64: hide build option IOMMU_DEFAULT_PASSTHROUGH Date: Thu, 30 May 2019 11:48:31 +0800 Message-ID: <20190530034831.4184-8-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 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 f6c030433d38048..f7400e35628dce4 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -89,7 +89,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