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: "Leizhen \(ThunderTown\)" 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