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=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 EF3F5C48BE5 for ; Tue, 15 Jun 2021 08:25:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B503261424 for ; Tue, 15 Jun 2021 08:25:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230490AbhFOI1X (ORCPT ); Tue, 15 Jun 2021 04:27:23 -0400 Received: from foss.arm.com ([217.140.110.172]:56602 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230190AbhFOI1V (ORCPT ); Tue, 15 Jun 2021 04:27:21 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7C362D6E; Tue, 15 Jun 2021 01:25:17 -0700 (PDT) Received: from [10.57.9.136] (unknown [10.57.9.136]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EF4AC3F694; Tue, 15 Jun 2021 01:25:15 -0700 (PDT) Subject: Re: [PATCH v12 3/5] iommu/vt-d: Add support for IOMMU default DMA mode build options To: Lu Baolu , John Garry , joro@8bytes.org, will@kernel.org, dwmw2@infradead.org Cc: linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, linuxarm@huawei.com, thunder.leizhen@huawei.com, chenxiang66@hisilicon.com References: <1623414043-40745-1-git-send-email-john.garry@huawei.com> <1623414043-40745-4-git-send-email-john.garry@huawei.com> <03675e2f-c3a6-ce33-ef96-f9ae544b2d13@huawei.com> <824db374-dc82-a9ea-b162-2f51e70ef999@linux.intel.com> From: Robin Murphy Message-ID: Date: Tue, 15 Jun 2021 09:25:10 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <824db374-dc82-a9ea-b162-2f51e70ef999@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-06-15 08:26, Lu Baolu wrote: > Hi John, > > On 6/14/21 4:03 PM, John Garry wrote: >> On 12/06/2021 03:14, Lu Baolu wrote: >>> On 2021/6/11 20:20, John Garry wrote: >>>> diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig >>>> index 2a71347611d4..4467353f981b 100644 >>>> --- a/drivers/iommu/Kconfig >>>> +++ b/drivers/iommu/Kconfig >>>> @@ -94,6 +94,7 @@ choice >>>>       prompt "IOMMU default DMA mode" >>>>       depends on IOMMU_DMA >>>> +    default IOMMU_DEFAULT_LAZY if INTEL_IOMMU >>>>       default IOMMU_DEFAULT_STRICT >>> >>> If two default values are different. Which one will be overridden? >> >> If I understand your question correctly, I think you are asking if >> both are set: >> CONFIG_IOMMU_DEFAULT_LAZY=y >> CONFIG_IOMMU_DEFAULT_STRICT=y >> >> If this happens, then make defconfig complains about both being set, >> and selects the 2nd, whatever that is. > > On x86, Intel or AMD, this will be > >     prompt "IOMMU default DMA mode" >       depends on IOMMU_DMA >       default IOMMU_DEFAULT_LAZY >       default IOMMU_DEFAULT_STRICT > > which will be default, LAZY or STRICT? Will it cause complains? See Documentation/kbuild/kconfig-language.rst: A config option can have any number of default values. If multiple default values are visible, only the first defined one is active. Robin. 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=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 B7DC3C48BE8 for ; Tue, 15 Jun 2021 08:25:23 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5D0D26100B for ; Tue, 15 Jun 2021 08:25:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D0D26100B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 269424026E; Tue, 15 Jun 2021 08:25:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 16qExGwSF3zj; Tue, 15 Jun 2021 08:25:22 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id 17D5940025; Tue, 15 Jun 2021 08:25:22 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id C7480C000D; Tue, 15 Jun 2021 08:25:21 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 138A2C000B for ; Tue, 15 Jun 2021 08:25:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id E73F340106 for ; Tue, 15 Jun 2021 08:25:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EWcstfTtxsct for ; Tue, 15 Jun 2021 08:25:19 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp2.osuosl.org (Postfix) with ESMTP id E3B7B40025 for ; Tue, 15 Jun 2021 08:25:18 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7C362D6E; Tue, 15 Jun 2021 01:25:17 -0700 (PDT) Received: from [10.57.9.136] (unknown [10.57.9.136]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EF4AC3F694; Tue, 15 Jun 2021 01:25:15 -0700 (PDT) Subject: Re: [PATCH v12 3/5] iommu/vt-d: Add support for IOMMU default DMA mode build options To: Lu Baolu , John Garry , joro@8bytes.org, will@kernel.org, dwmw2@infradead.org References: <1623414043-40745-1-git-send-email-john.garry@huawei.com> <1623414043-40745-4-git-send-email-john.garry@huawei.com> <03675e2f-c3a6-ce33-ef96-f9ae544b2d13@huawei.com> <824db374-dc82-a9ea-b162-2f51e70ef999@linux.intel.com> From: Robin Murphy Message-ID: Date: Tue, 15 Jun 2021 09:25:10 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <824db374-dc82-a9ea-b162-2f51e70ef999@linux.intel.com> Content-Language: en-GB Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linuxarm@huawei.com X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: base64 Content-Type: text/plain; charset="utf-8"; Format="flowed" Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" T24gMjAyMS0wNi0xNSAwODoyNiwgTHUgQmFvbHUgd3JvdGU6Cj4gSGkgSm9obiwKPiAKPiBPbiA2 LzE0LzIxIDQ6MDMgUE0sIEpvaG4gR2Fycnkgd3JvdGU6Cj4+IE9uIDEyLzA2LzIwMjEgMDM6MTQs IEx1IEJhb2x1IHdyb3RlOgo+Pj4gT24gMjAyMS82LzExIDIwOjIwLCBKb2huIEdhcnJ5IHdyb3Rl Ogo+Pj4+IGRpZmYgLS1naXQgYS9kcml2ZXJzL2lvbW11L0tjb25maWcgYi9kcml2ZXJzL2lvbW11 L0tjb25maWcKPj4+PiBpbmRleCAyYTcxMzQ3NjExZDQuLjQ0NjczNTNmOTgxYiAxMDA2NDQKPj4+ PiAtLS0gYS9kcml2ZXJzL2lvbW11L0tjb25maWcKPj4+PiArKysgYi9kcml2ZXJzL2lvbW11L0tj b25maWcKPj4+PiBAQCAtOTQsNiArOTQsNyBAQCBjaG9pY2UKPj4+PiDCoMKgwqDCoMKgIHByb21w dCAiSU9NTVUgZGVmYXVsdCBETUEgbW9kZSIKPj4+PiDCoMKgwqDCoMKgIGRlcGVuZHMgb24gSU9N TVVfRE1BCj4+Pj4gK8KgwqDCoCBkZWZhdWx0IElPTU1VX0RFRkFVTFRfTEFaWSBpZiBJTlRFTF9J T01NVQo+Pj4+IMKgwqDCoMKgwqAgZGVmYXVsdCBJT01NVV9ERUZBVUxUX1NUUklDVAo+Pj4KPj4+ IElmIHR3byBkZWZhdWx0IHZ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