From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 574BAC10F0E for ; Mon, 8 Apr 2019 01:15:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 23FFC20857 for ; Mon, 8 Apr 2019 01:15:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726497AbfDHBPX (ORCPT ); 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