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 955CEC2B9F4 for ; Thu, 17 Jun 2021 07:47:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6ACEE613BF for ; Thu, 17 Jun 2021 07:47:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229901AbhFQHtu (ORCPT ); Thu, 17 Jun 2021 03:49:50 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:3259 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229515AbhFQHtq (ORCPT ); Thu, 17 Jun 2021 03:49:46 -0400 Received: from fraeml704-chm.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4G5DRj6q8Rz6L7kw; Thu, 17 Jun 2021 15:37:53 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml704-chm.china.huawei.com (10.206.15.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Thu, 17 Jun 2021 09:47:36 +0200 Received: from [10.47.95.81] (10.47.95.81) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 17 Jun 2021 08:47:36 +0100 Subject: Re: [PATCH v13 6/6] iommu: Remove mode argument from iommu_set_dma_strict() To: Lu Baolu , , , , , CC: , , , , , References: <1623841437-211832-1-git-send-email-john.garry@huawei.com> <1623841437-211832-7-git-send-email-john.garry@huawei.com> From: John Garry Message-ID: Date: Thu, 17 Jun 2021 08:41:24 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.47.95.81] X-ClientProxiedBy: lhreml743-chm.china.huawei.com (10.201.108.193) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> @@ -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. Thanks, john