From patchwork Sun Apr 7 12:41:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 161919 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp2603681jan; Sun, 7 Apr 2019 05:48:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqxEGNbejv7A/9n63P/t7RhtKh+NN5HlGHaHyWOiyQTYNvT8QZGIbluNO5CzPW2PGVgWofgn X-Received: by 2002:a63:c505:: with SMTP id f5mr23129292pgd.87.1554641304841; Sun, 07 Apr 2019 05:48:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554641304; cv=none; d=google.com; s=arc-20160816; b=lrxi8iw1Ri0YeBWmwn1JcN1XiUbdwA/K1uqqHd7ssMOMJu517bPj61DOyhwwKPOLyI 7dIDObM9iqwmpQNWRUNK0C8Vpo8xDh+Y4/ClC4bx1Bv/fJ2sDBUc0SwsVg6eqesCj9EO Sv6EsUrRwt6waGuXzopRQstxwj5Vi5yKwP9a1bwFfgd7dtf00yrkohIcc0MXW8jxnSBW JMUxRUEkUeZKVqCTnGDE9rABYrtCDy3HLVET+uiLyh79V3ipl2J+Fq6BHyhfkYCLNUbl PxoKdIec8PYASnWlLYkakdZgcZUsDeSLOYtEGLZXBt/4BiATSL6U2AS/dK1Ts+xJZEvj 36zg== 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=q/3ub53QeDcqt+BiZYI+GNZcR/ofgqTRPsnrTYJ5OBk=; b=MAMES5o7rHD/BqOcoJyD21Vk1WLzM9nTIXluw2KLsFLMY1r/Jo+s8AkEAi3d+M4C0k nFnIVdugNrbxlJ4ETiCyPLxjHK7xjLKrfMxnydM15dwAKXUpA75qHzueCdutqsm69ESJ D/LSuDyT5klcDrc9gV/AyBtDFfOznz1O7rQm2exTFEQGWVEIWNnDmyim1ZnictrmVekj mQTc4uOrz5+FpjfsqQHaiacs0epbAgDsnj8SKAj7rnH9Yq7NGaxOpKzQ7+QyY/uScOyJ P7+cvjwIXTbcX3ZdBpNLGlzyyuf0mg6MkssKA0MIR7beP3Ml8zLZuC5XmiltqAFeNNeh gx5A== 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 y24si23127670plr.255.2019.04.07.05.48.24; Sun, 07 Apr 2019 05:48:24 -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 S1726670AbfDGMsX (ORCPT + 31 others); Sun, 7 Apr 2019 08:48:23 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:5697 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726629AbfDGMsT (ORCPT ); Sun, 7 Apr 2019 08:48:19 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id EC456AAB0EF168CC75A7; Sun, 7 Apr 2019 20:48:15 +0800 (CST) Received: from HGHY1l002753561.china.huawei.com (10.177.23.164) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.408.0; Sun, 7 Apr 2019 20:48:06 +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 v4 5/6] powernv/iommu: use common boot option iommu.dma_mode Date: Sun, 7 Apr 2019 20:41:46 +0800 Message-ID: <20190407124147.13576-6-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.19.2.windows.1 In-Reply-To: <20190407124147.13576-1-thunder.leizhen@huawei.com> References: <20190407124147.13576-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.23.164] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org iommu=nobypass can be replaced with iommu.dma_mode=strict. Signed-off-by: Zhen Lei --- Documentation/admin-guide/kernel-parameters.txt | 2 -- arch/powerpc/platforms/powernv/pci-ioda.c | 23 +---------------------- drivers/iommu/Kconfig | 1 + 3 files changed, 2 insertions(+), 24 deletions(-) -- 1.8.3 diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index a2df11945b33fc9..f88a8bff3c0caa0 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -1789,8 +1789,6 @@ soft pt [x86] nopt [x86] - nobypass [PPC/POWERNV] - Disable IOMMU bypass, using IOMMU for PCI devices. iommu.dma_mode= [ARM64] Configure default dma mode. if unset, use the diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 3ead4c237ed0ec9..be0234c170316bc 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c @@ -85,29 +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 pci_reset_phbs __read_mostly; -static int __init iommu_setup(char *str) -{ - if (!str) - return -EINVAL; - - while (*str) { - if (!strncmp(str, "nobypass", 8)) { - pnv_iommu_bypass_disabled = true; - pr_info("PowerNV: IOMMU bypass window disabled.\n"); - break; - } - str += strcspn(str, ","); - if (*str == ',') - str++; - } - - return 0; -} -early_param("iommu", iommu_setup); - static int __init pci_reset_phbs_setup(char *str) { pci_reset_phbs = true; @@ -2456,7 +2435,7 @@ static long pnv_pci_ioda2_setup_default_config(struct pnv_ioda_pe *pe) return rc; } - if (!pnv_iommu_bypass_disabled) + if (IOMMU_DMA_MODE_IS_PASSTHROUGH()) pnv_pci_ioda2_set_bypass(pe, true); return 0; diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index d88dc44d60d88ea..b053eeaa82ebca8 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -77,6 +77,7 @@ config IOMMU_DEBUGFS choice prompt "IOMMU dma mode" depends on IOMMU_API + default IOMMU_DMA_MODE_PASSTHROUGH if (PPC_POWERNV && PCI) default IOMMU_DMA_MODE_LAZY if S390_IOMMU default IOMMU_DMA_MODE_STRICT help