From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.zytor.com (terminus.zytor.com [198.137.202.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3D0531DDB8 for ; Sun, 21 Dec 2025 23:44:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.136 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766360693; cv=none; b=TMvscVEvrvIlCAhklFT2Me6/XOpmO01Nl7tYEGiI6AT/1cHrSt10Mm56ohRuSS7b3cQPSG/VgBx5ILOZLvcTceW5DxEK3Y+nyW/N8m7zVycxhc3vd+7KStgBACFMPTUDfChupFjp7+rTEaZ3BuR15xe4s4Bzn1PUeJnCJ/YsYt4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766360693; c=relaxed/simple; bh=OaijYtS+mpu3mr+zP6Tkt1i4t71Qo9y7ZYsIYbFFyas=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=KPJ+IecEP6kXOGj8HpCnJyU2wPFt07fMOYb3VAEZpf3bv2yK/aVU2DUSXcXrpghLTh6TLuQhxgKAgamlw1aLteGWH2yRXl3CxBr5IhXOJZNzKipwCeERe6mCHrn6WXujfOnHIYTO7xiCIUDKiS+ZJrEYIs9ZzangEIgR4pmAP6c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com; spf=pass smtp.mailfrom=zytor.com; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b=DFfOE5ub; arc=none smtp.client-ip=198.137.202.136 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zytor.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="DFfOE5ub" Received: from ehlo.thunderbird.net (c-76-133-66-138.hsd1.ca.comcast.net [76.133.66.138]) (authenticated bits=0) by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 5BLNiDnE3319764 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Sun, 21 Dec 2025 15:44:14 -0800 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 5BLNiDnE3319764 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2025112201; t=1766360654; bh=L8mpW+FXR2PJ0bRhh8khuvGdeeeFA2gZvARYQS7qqDU=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=DFfOE5ubNBgLw4pzMtrnOQ4cWL/e9+P/PLzJG/zyH+AYLFfMwiFdiSVeiNWx0ars7 +g1DgQ/n99gecpLUjzmwfslk18jYuuskkVyqTOIicR8WAkw+1okdp/vX5om3pUoE5J +fJ5JFYpvPVj2oi4j5ddR64IM+qcyEfurZl2s5i3jyznb/AQi0WZSRrYMoG4vNTFfe x7TjliyuIboqJunNl5YeK4ZtBPgiTHH6hAw0DH70CmIgkT8pVBuxFGEQPW4qiw6798 FZS0vYjXvPEf/VjSWjPOEjSoFsSzdZ2cHthTbVTP7BjEUchKcPso0fbx7fO/gdgF3N hgGmTatzcPyTg== Date: Sun, 21 Dec 2025 15:44:13 -0800 From: "H. Peter Anvin" To: Linus Torvalds , Eric Dumazet CC: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Uros Bizjak , x86@kernel.org, linux-kernel , Eric Dumazet Subject: Re: [PATCH 2/2] x86/irqflags: Use ASM_OUTPUT_RM in native_save_fl() User-Agent: K-9 Mail for Android In-Reply-To: References: <20251219112007.2827302-1-edumazet@google.com> <20251219112007.2827302-3-edumazet@google.com> <05B06AD6-0AB2-4E37-A71D-0D917070FF0F@zytor.com> Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On December 21, 2025 3:20:43 PM PST, Linus Torvalds wrote: >On Sun, 21 Dec 2025 at 13:47, Eric Dumazet wrote: >> >> Unfortunately I was told it was not better, some clang versions had >> bugs with it=2E > >The whole "builtin is worse than inline asm" is actually a thing even >when not actively buggy=2E We've had things like that a few times >before=2E > >It's why we have out own variable_ffs() implementation, for example, >and do things like > > #define ffs(x) (__builtin_constant_p(x) ? __builtin_ffs(x) : variable_= ffs(x)) > >because __builtin_ffs() generates pointlessly silly code on at least >some compiler versions: > > https://gcc=2Egnu=2Eorg/bugzilla/show_bug=2Ecgi?id=3D106471 > >So then just using inline asm gets us at least reliable results, and >we can - and do - tweak it for specific known configs=2E > > Linus Sigh=2E It's just disappointing to see this kind of stuff=2E