Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6864534rwn; Tue, 13 Sep 2022 10:02:43 -0700 (PDT) X-Google-Smtp-Source: AA6agR43VU8mglThXwS4+k+WTtXYqBI46pd49mjkmbx0qW+waPldd8I4elT072Py9h6PklafStM7 X-Received: by 2002:a17:902:e5c9:b0:178:41d1:ef3d with SMTP id u9-20020a170902e5c900b0017841d1ef3dmr6031153plf.151.1663088562609; Tue, 13 Sep 2022 10:02:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663088562; cv=none; d=google.com; s=arc-20160816; b=bzRrnr1W+NX/MFgVEK2buV7ToBnYGByZLIsf1IBbTaNbvkozSD8SpC0NTx1N5Frr9i eyjiSXqVJBYNc7XlAr2hoblJ4BJYhfbmJeORk+ttTg8AnKcxg0xa1B/ky5HNhHmwYP3i Ur8BaMfBtYrZgZNGaK8P7pC7QJOiLGftN5lsliyBdVsba7pZ2szgpqegsQSUwfE+qyEM aN+bvoZXHCp0ORw3SoV2ISbjhC79Gh3cUVu+SMTPP/IjY0ou21bu4fPSZBmx3yiELNN/ kukDIdRCrHexi75a63CigVKnoAUCkGwgSFqE0SWwkFka8Ri5fHh1Yp9OeMk2UXgpgfvS BqHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=VFfo9KuAffBsIYYC3tUi3rUMFIfZsLTOYHpZMe1m4j8=; b=DH4IhG/JFweEaRIyKNqo5guTH3nOtICPPL9kGsWxLgRoXbNp8vP7uSstR9+EMsa9o0 FNVuMxzEc0DogPXrSdaAsAy/UWE30K5B6qIPNdP9yOYg2ZkLN3vk4vw6KxY5ph2OxJ/G OMo28wUuoHDs0LfMh4AuQ9NE0LQc78/b71qS00QcNy8oZrrEY0usl/6kQd4+O8QrQCXM rEOoE7VkfCcP/l3TH4d+HaM3JnLQpp/Zc3EmaWH15IVg+ngZLEUNKb3iBSa6nULMBW42 26bzBUVhUqMOZ9xzxAitbNK4GxVYIFPpnpx5O2CpD9adKJjhpQirzHiCEUoXp4KWxCwD ZwSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h32-20020a635760000000b00434f910a37esi7710958pgm.376.2022.09.13.10.02.28; Tue, 13 Sep 2022 10:02:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231348AbiIMQwZ (ORCPT + 99 others); Tue, 13 Sep 2022 12:52:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230035AbiIMQvv (ORCPT ); Tue, 13 Sep 2022 12:51:51 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D76E9459AF for ; Tue, 13 Sep 2022 08:45:15 -0700 (PDT) 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 32A731063; Tue, 13 Sep 2022 07:15:35 -0700 (PDT) Received: from [10.57.15.170] (unknown [10.57.15.170]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 920CB3F73B; Tue, 13 Sep 2022 07:15:27 -0700 (PDT) Message-ID: <38988c89-ec61-faa1-6b15-2fd3aa51eede@arm.com> Date: Tue, 13 Sep 2022 15:15:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH] iommu/iova: Fix module config properly Content-Language: en-GB To: John Garry , joro@8bytes.org Cc: will@kernel.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Thierry Reding References: <548c2f683ca379aface59639a8f0cccc3a1ac050.1663069227.git.robin.murphy@arm.com> <4740744e-2e12-520d-8598-188b8d2ebd6b@huawei.com> From: Robin Murphy In-Reply-To: <4740744e-2e12-520d-8598-188b8d2ebd6b@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-09-13 14:01, John Garry wrote: > On 13/09/2022 12:47, Robin Murphy wrote: >> IOMMU_IOVA is intended to be an optional library for users to select as >> and when they desire. Since it can be a module now, this means that >> built-in code which has chosen not to select it should not fail to link >> if it happens to have selected as a module by someone else. Replace >> IS_ENABLED() with IS_REACHABLE() to do the right thing. > > Hi Robin, > > Recently you mentioned "I wonder if we couldn't replace the IS_ENABLED() > with IS_REACHABLE() and restore some of the previously-conditional > selects", and pointed me to 84db889e6d82 as an example of when a > conditional select was made unconditional. > > So will you also restore some previously-conditional selects next? I figured I'd leave that up to Thierry (and/or anyone else with a vested interest), but having mulled it over since that previous thread, there's really no excuse for the API itself not to do the right thing either way, so I felt compelled to write up this much. Cheers, Robin. > > To me, it seems that any user of IOVA API selects IOMMU_IOVA always. > > thanks, > John > >> >> CC: Thierry Reding >> Reported-by: John Garry >> Fixes: 15bbdec3931e ("iommu: Make the iova library a module") >> Signed-off-by: Robin Murphy >> --- >> >> Phrased as a fix for the sake of complete honesty, but it seems >> everyone's been making do for years already so by now it's really >> just more of an enhancement. >> >>   include/linux/iova.h | 2 +- >>   1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/include/linux/iova.h b/include/linux/iova.h >> index 8f97a43be834..fe18c3e6a725 100644 >> --- a/include/linux/iova.h >> +++ b/include/linux/iova.h >> @@ -75,7 +75,7 @@ static inline unsigned long iova_pfn(struct >> iova_domain *iovad, dma_addr_t iova) >>       return iova >> iova_shift(iovad); >>   } >> -#if IS_ENABLED(CONFIG_IOMMU_IOVA) >> +#if IS_REACHABLE(CONFIG_IOMMU_IOVA) >>   int iova_cache_get(void); >>   void iova_cache_put(void); >