Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2411746yba; Sun, 7 Apr 2019 18:16:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqykLbqIJF4zxf+R0qXmImeMxdh98v1wv96EbvOrR5QtmZ6gd30oNSfHPCQOJWgeCQDejV7Y X-Received: by 2002:a63:550d:: with SMTP id j13mr25415116pgb.18.1554686172886; Sun, 07 Apr 2019 18:16:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554686172; cv=none; d=google.com; s=arc-20160816; b=ChZCl4kk5lsAvaCLLyXnrhvJyPMyZMCzUfsf10SCYAtVqucfpY6U2QvDGBIQla526J DE+UzlFku1Z/OsesHzihUxKZrogr38x1UgIk9S66vD15gZ+S5KaAnC5PcjfmRVZWkMwU DUXxo5ZPCzx38yw+JwTx1hRgPBp9pRc11uXTneNXQzpj20XS8zNGUW9bPLrFn8U37gnO 01ZI3Zmhv45P/SgE4UIfuphfZMM77FdUNWR7+EPgvhMYDH5IiJyEKFoMD0q1mDrNHPMw cmmxpYIuryaCLyQzLm8RfG5mysmccCyPMyQ6IP128gzDv+SjmS6xy2eTf4S9zT1men+z o3RA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject; bh=5jirkDc36l2JUc8GbXXIPzSFtD1SP/YSHGUox+D/TsM=; b=VUaVbUeuVBdW6hcjTHrj8UZaDB1mj1iVXMk2LldPlgYQYLp4/VWvVM/JvyBnkHolKv 8P0o3EZZw3F1R0UYQ7pR51VeMdm25YMzCDsnaf9G0gGcdJJ+OW7RL3vbPZNGo2+JkL69 ueaL3kP42zrUA/d9cLb6NxTuSCogHdXqgC3dUe0stMorAV7dtJyOcLJ0WYFxV6/LVe30 1TRFoEElCmvPCZ3eT5dIGe6bNzB1+3XTkMXRRiFljXeCu5msEhdEnRFexvy0CtHHiJou MOhu+OoY2dUEb763rv2zQKsBJ/H50Ve+o2Ijis0wJuTX2R3sbk0GZE6mYzUigkQ++Z1b nNeg== 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 y2si25059405pfn.57.2019.04.07.18.15.57; Sun, 07 Apr 2019 18:16:12 -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 S1726492AbfDHBPX (ORCPT + 99 others); Sun, 7 Apr 2019 21:15:23 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:6701 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726349AbfDHBPX (ORCPT ); Sun, 7 Apr 2019 21:15:23 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 9C74596D1F36357E5063; Mon, 8 Apr 2019 09:15:20 +0800 (CST) Received: from [127.0.0.1] (10.177.223.23) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.408.0; Mon, 8 Apr 2019 09:15:09 +0800 Subject: Re: [PATCH v4 0/6] normalize IOMMU dma mode boot options To: Zhen Lei , 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 References: <20190407124147.13576-1-thunder.leizhen@huawei.com> From: Hanjun Guo Message-ID: Date: Mon, 8 Apr 2019 09:14:42 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20190407124147.13576-1-thunder.leizhen@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.223.23] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Zhen, On 2019/4/7 20:41, Zhen Lei wrote: > As Robin Murphy's suggestion: > "It's also not necessarily obvious to the user how this interacts with > IOMMU_DEFAULT_PASSTHROUGH, so if we really do go down this route, maybe it > would be better to refactor the whole lot into a single selection of something > like IOMMU_DEFAULT_MODE anyway." > > In this version, I tried to normalize the IOMMU dma mode boot options for all > ARCHs. When IOMMU is enabled, there are 3 dma modes: paasthrough(bypass), > lazy(mapping but defer the IOTLB invalidation), strict. But currently each > ARCHs defined their private boot options, different with each other. For > example, to enable/disable "passthrough", ARM64 use iommu.passthrough=1/0, > X86 use iommu=pt/nopt, PPC/POWERNV use iommu=nobypass. > > > Zhen Lei (6): > iommu: use iommu.dma_mode to replace iommu.passthrough and > iommu.strict > iommu: keep dma mode build options consistent with cmdline options > iommu: add iommu_default_dma_mode_get() helper > s390/pci: use common boot option iommu.dma_mode > powernv/iommu: use common boot option iommu.dma_mode > x86/iommu: use common boot option iommu.dma_mode This will break systems using boot options as now, and I think this is unacceptable. If you want to do so, just introduce iommu.dma_mode on top of those iommu boot options with dma mode boot options unchanged, and iommu.dma_mode is for all archs but compatible with them. Thanks Hanjun