Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp5189497rwb; Tue, 6 Sep 2022 21:19:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR4NmnTLIpGG55SRLnh2n7yOqCVqHNr/HLKkLxMcteIu27n1X+iJw6a2hhSXj6Tee7vUEQ8l X-Received: by 2002:a17:907:a043:b0:76f:f5a3:1bac with SMTP id gz3-20020a170907a04300b0076ff5a31bacmr1001951ejc.452.1662524347628; Tue, 06 Sep 2022 21:19:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662524347; cv=none; d=google.com; s=arc-20160816; b=MyFRuNn0JT3lkEtpRFo+UyDsueaVi7MeepLipyJDQKJaX2YbpW0+Ic2BJNdh+dxFx+ NsWip2M5LrCh0XUbAeR+dIL2kU4tu2jkq9wd6J1RkZBHi9UY4+Y/oQ1VoWBZLZ8BF9qD DWfCoYTiuOjYRJjFjiUXM+dc5hD3r6YCBuk/47JcgvCXhvkIABmi3SZVQEXo8+z6r2E4 91g8GoHPXBOKBzyeDk+TMVL6gV6m/Eif/tPdxrPaD+3JxojCj3y2Ho5ItmSwMH1K3PMX v3l5iBKxGKFIaQ3+Puzu6dEL+AI8tNHDyATo8OpwB0xkdTGYoO6DBC6Q4RKAfT63yXDX iguQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=oF8uyun+ouCeH4rU0Sgny6nXLM0tjw0TQ71zarK9tig=; b=XXIHYmJjMOMJRtn6BdkrQTuBzYaV+5fKgggsimX4M+WFI4bNep70yiTNRMkYB/6Qpp C/XZ7TXbkVNiAm8Ek94fMbRvPY0jsig/E+g8CqwaV/7t908L3E2js9yMrmskdm0Kuzx1 wiMIOat6HiOPowxUHFPtstx6Nf5GOTDMDl5+RplfvgH9w5iNa6Erh1koGZpH84nLTFqn 6SHQm7F63L+ROHAKIxUA0MjiwramPkUJVBSRX12C3Cxx5YXQhmy58biBfqo36ac9hwcY Ty9izVLC+89dgthtXdo4kQVBDPpU27WR+5uD8vPTEQCFwOIlmbmwOASJcQVxDlcTAMuI gfQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=I66wrZ08; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hz1-20020a1709072ce100b0073155c0e7cesi11055728ejc.677.2022.09.06.21.18.42; Tue, 06 Sep 2022 21:19:07 -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; dkim=pass header.i=@alien8.de header.s=dkim header.b=I66wrZ08; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229585AbiIGEG5 (ORCPT + 99 others); Wed, 7 Sep 2022 00:06:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbiIGEGz (ORCPT ); Wed, 7 Sep 2022 00:06:55 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F21397D792 for ; Tue, 6 Sep 2022 21:06:54 -0700 (PDT) Received: from nazgul.tnic (unknown [84.201.196.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 6786E1EC068F; Wed, 7 Sep 2022 06:06:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1662523609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=oF8uyun+ouCeH4rU0Sgny6nXLM0tjw0TQ71zarK9tig=; b=I66wrZ08yscrWobgTr7tjuBmYVub0sMgs1pmnJ2jRbXAi7RAAscCJHcTwJKc5ZcMnGu1VR 8+rc3rFQ9+g2ra5WsruBdluAyQ/YcsIGwA9+G89xQZiLoWl3bEZ8vR6O4QFMht8Z1yScjM clZ7EIynTYl84Kq+6QPYN9ZbsnKgW+A= Date: Wed, 7 Sep 2022 06:06:58 +0200 From: Borislav Petkov To: Vincent MAILHOL Cc: Nick Desaulniers , Thomas Gleixner , Ingo Molnar , x86@kernel.org, Peter Zijlstra , Dave Hansen , "H . Peter Anvin" , Nathan Chancellor , Tom Rix , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, David Howells , Jan Beulich , Christophe Jaillet , Joe Perches , Josh Poimboeuf Subject: Re: [PATCH v5 2/2] x86/asm/bitops: __ffs,ffz: use __builtin_ctzl to evaluate constant expressions Message-ID: References: <20220812114438.1574-1-mailhol.vincent@wanadoo.fr> <20220812114438.1574-3-mailhol.vincent@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, 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 Sat, Aug 27, 2022 at 06:32:05AM +0900, Vincent MAILHOL wrote: > Agree that this is only the surface. But, my patch series is about > constant folding, not about the text of *ffs(). Here, I just *move* > the existing text, I did not modify anything. > Can we agree that this is a separate topic? Sure we can. But then you can't start your commit message with: "__ffs(x) is equivalent to (unsigned long)__builtin_ctzl(x) and ffz(x) is equivalent to (unsigned long)__builtin_ctzl(~x)." which will bring unenlightened readers like me into the very same mess. So at least mention that there's a difference between the kernel implementation using hw insns which are well defined on some machines and what the glibc API does. So that at least people are aware that there's something dangerous to be cautious about. Ok? Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette