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.5 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=unavailable 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 162C2C49361 for ; Fri, 18 Jun 2021 01:54:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E76AF613AA for ; Fri, 18 Jun 2021 01:54:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233563AbhFRB4J (ORCPT ); Thu, 17 Jun 2021 21:56:09 -0400 Received: from mga09.intel.com ([134.134.136.24]:33130 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230137AbhFRB4I (ORCPT ); Thu, 17 Jun 2021 21:56:08 -0400 IronPort-SDR: KYoHLS4KXRrwb2NU1pQmwg4vKP9r8C06glvOoCflgGR8spICw+K2oIUbkqtQRitJym6ZAbd3kl IbRqV5oNh4KA== X-IronPort-AV: E=McAfee;i="6200,9189,10018"; a="206433565" X-IronPort-AV: E=Sophos;i="5.83,281,1616482800"; d="scan'208";a="206433565" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jun 2021 18:53:59 -0700 IronPort-SDR: M+7j3e8w7yg2eVqLS5rDHawbsDeYbC4twNz64FToCwPMeSFGvwl1+C7/OBU26n4Mmu2kNQruxh Qt87RSrquZzw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,281,1616482800"; d="scan'208";a="472613025" Received: from allen-box.sh.intel.com (HELO [10.239.159.118]) ([10.239.159.118]) by fmsmga004.fm.intel.com with ESMTP; 17 Jun 2021 18:53:56 -0700 Cc: baolu.lu@linux.intel.com, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, linuxarm@huawei.com, thunder.leizhen@huawei.com, chenxiang66@hisilicon.com, linux-doc@vger.kernel.org Subject: Re: [PATCH v13 6/6] iommu: Remove mode argument from iommu_set_dma_strict() To: John Garry , joro@8bytes.org, will@kernel.org, dwmw2@infradead.org, robin.murphy@arm.com, corbet@lwn.net References: <1623841437-211832-1-git-send-email-john.garry@huawei.com> <1623841437-211832-7-git-send-email-john.garry@huawei.com> From: Lu Baolu Message-ID: Date: Fri, 18 Jun 2021 09:52:29 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/17/21 3:41 PM, John Garry wrote: > >>> @@ -349,10 +349,9 @@ static int __init iommu_dma_setup(char *str) >>>   } >>>   early_param("iommu.strict", iommu_dma_setup); >>> -void iommu_set_dma_strict(bool strict) >>> +void iommu_set_dma_strict(void) >>>   { >>> -    if (strict || !(iommu_cmd_line & IOMMU_CMD_LINE_STRICT)) >>> -        iommu_dma_strict = strict; >>> +    iommu_dma_strict = true; >> >> Sorry, I still can't get how iommu.strict kernel option works. >> >> static int __init iommu_dma_setup(char *str) >> { >>          int ret = kstrtobool(str, &iommu_dma_strict); >> >>          if (!ret) >>                  iommu_cmd_line |= IOMMU_CMD_LINE_STRICT; >>          return ret; >> } >> early_param("iommu.strict", iommu_dma_setup); >> >> The bit IOMMU_CMD_LINE_STRICT is only set, but not used anywhere. > > It is used in patch 2/6: > > +    pr_info("DMA domain TLB invalidation policy: %s mode %s\n", > +        iommu_dma_strict ? "strict" : "lazy", > +        (iommu_cmd_line & IOMMU_CMD_LINE_STRICT) ? > +            "(set via kernel command line)" : ""); > >> Hence, >> I am wondering how could it work? A bug or I missed anything? > > It is really just used for informative purpose now. I am clear now. Thanks! Best regards, baolu 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.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 AF4A9C2B9F4 for ; Fri, 18 Jun 2021 01:54:05 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 5F485613B4 for ; Fri, 18 Jun 2021 01:54:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F485613B4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.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 smtp1.osuosl.org (Postfix) with ESMTP id 32A2A83CF9; Fri, 18 Jun 2021 01:54:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ynbf-MuScHde; Fri, 18 Jun 2021 01:54:03 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id 1116583CF8; Fri, 18 Jun 2021 01:54:03 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id DC0F9C000D; Fri, 18 Jun 2021 01:54:02 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 578A0C000B for ; Fri, 18 Jun 2021 01:54:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 52B5740569 for ; Fri, 18 Jun 2021 01:54:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sU-tPagjm0Ph for ; Fri, 18 Jun 2021 01:54:00 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by smtp4.osuosl.org (Postfix) with ESMTPS id 2C25A40563 for ; Fri, 18 Jun 2021 01:54:00 +0000 (UTC) IronPort-SDR: yboPfwQ8yw1lhQiIHxWJfHHWxCn8ykFs8WKoSjysp/wNWmaYiioawtVGUfRCfwWIuLJq/cIE2y Bk+Uk6w/wVLA== X-IronPort-AV: E=McAfee;i="6200,9189,10018"; a="206298942" X-IronPort-AV: E=Sophos;i="5.83,281,1616482800"; d="scan'208";a="206298942" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jun 2021 18:53:59 -0700 IronPort-SDR: M+7j3e8w7yg2eVqLS5rDHawbsDeYbC4twNz64FToCwPMeSFGvwl1+C7/OBU26n4Mmu2kNQruxh Qt87RSrquZzw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,281,1616482800"; d="scan'208";a="472613025" Received: from allen-box.sh.intel.com (HELO [10.239.159.118]) ([10.239.159.118]) by fmsmga004.fm.intel.com with ESMTP; 17 Jun 2021 18:53:56 -0700 Subject: Re: [PATCH v13 6/6] iommu: Remove mode argument from iommu_set_dma_strict() To: John Garry , joro@8bytes.org, will@kernel.org, dwmw2@infradead.org, robin.murphy@arm.com, corbet@lwn.net References: <1623841437-211832-1-git-send-email-john.garry@huawei.com> <1623841437-211832-7-git-send-email-john.garry@huawei.com> From: Lu Baolu Message-ID: Date: Fri, 18 Jun 2021 09:52:29 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Cc: linux-doc@vger.kernel.org, linuxarm@huawei.com, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org 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" T24gNi8xNy8yMSAzOjQxIFBNLCBKb2huIEdhcnJ5IHdyb3RlOgo+IAo+Pj4gQEAgLTM0OSwxMCAr MzQ5LDkgQEAgc3RhdGljIGludCBfX2luaXQgaW9tbXVfZG1hX3NldHVwKGNoYXIgKnN0cikKPj4+ IMKgIH0KPj4+IMKgIGVhcmx5X3BhcmFtKCJpb21tdS5zdHJpY3QiLCBpb21tdV9kbWFfc2V0dXAp Owo+Pj4gLXZvaWQgaW9tbXVfc2V0X2RtYV9zdHJpY3QoYm9vbCBzdHJpY3QpCj4+PiArdm9pZCBp b21tdV9zZXRfZG1hX3N0cmljdCh2b2lkK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