Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp260785ybi; Wed, 29 May 2019 20:52:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqywmNPqnweVJocQxVMVbNxBJy79Isg2ZVbXuNfGQEBfkxAmtqYXXWkH6d1QPaVqdh8w0aWG X-Received: by 2002:a62:4dc5:: with SMTP id a188mr1670644pfb.8.1559188371370; Wed, 29 May 2019 20:52:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559188371; cv=none; d=google.com; s=arc-20160816; b=TaDIO4b26hj284lPhjC7EE4jPzD7PqXD0sRkUCyz2U8IciWstLtkugJ05SE5E+4wZc UfG/KotNKa361GcD7JmEz64LwPQBnVUwwxksVTm2RHJMor8dwwqTmA/zuta6Zk2TXcAd GkqeI2w/MiOA1/+OXEvSV2+f8fRhlQucoEBlxX8pyM1vrwfM3EwIvXJLj/tprRDQlZ1J HYpheYLlsDS/s6agsS2KZvS+HEuzps/3VfOjLSVOIH2ilbWoSKGUVwu95Jtja/urXhw3 A24RRm4wE0n4ZGphPppQzIa/ybMCI+HCJvdp6ynkCTyAlUrk5jpLqugKYkRnQRgbL5cr EtaA== 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 i2si2003773pgl.282.2019.05.29.20.52.35; Wed, 29 May 2019 20:52:51 -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 S1732786AbfE3Dt1 (ORCPT + 99 others); Wed, 29 May 2019 23:49:27 -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 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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(-) 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 -- 1.8.3