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