Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp685152pxb; Thu, 25 Feb 2021 12:21:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJyL4HffE+rpL9IFIjoO5JAZBaLfLNyJbVuVlVK8ohUAKErkM/GZUXo94HvThw3ldvtOEXpw X-Received: by 2002:aa7:cf95:: with SMTP id z21mr4787669edx.76.1614284504408; Thu, 25 Feb 2021 12:21:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614284504; cv=none; d=google.com; s=arc-20160816; b=Gmivb4sd4ZCtZtKt9P8oR2VSGOHX4o64H1xfg1OEr+dG82Jmh/QzX21TYO8RpJix8a CtRLbKpeHHphHBpL24g4EQDYHctdLMbdw1UqL0D5SFje27057SXjX00X2q3O3oyMeJuC zEMXCdKgCg7WCMKSBiEzQMOZIaexmbg8Jw2YNpnM5Gj78qVNLd5Brc59Q+z/gwOeudv7 5kXcYnlyP5GZmRw1OJg/ZEtw1xav1+YH33NcHk+kHU5xWsJ5QkoKv+XNZRKutVd7oWhK 9py5wDoTiuF2wRCdHKAuofWiOE9a0MeXVyKlf4bDaZST8RROfeBzZehBJJCxdz2coFdZ fF8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=uf3l7sHJ32C/y/UQZcRKDhDpFFbTipg0C2dcA7hiMTs=; b=wdb1AHba+TbGHHF4YQdsn2pN6xQYKAWjw3lcfgd3C8wy7gMBhg15eSzjjSo/xPUROo Jl7DGV5arNOcuUjRKETi5Seu7oAvzVt2P4fHH3n2zACmBk26Wx/HqEHdOLwbkpRXJjpe x45dxaTn6TBybu2tmm0nwlP7WMdqRXg2b2qBtlwZdN9CJuxiDMgpsoZMMrZvLoNie8f1 JgECaRV4hZXz+p/0BFw68Sl/3z4I5+WDSwXvYIuKzbYxb1JhytWpWlsCa5SrgZpQ3zty sO4PxGU6N0ZOyei0akLV9G8UkoULcFsgXiBnv3M5GfH795nc/glg8iGnZP6pZx1JCvVk k2hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HK0vtCW3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q3si785270eji.445.2021.02.25.12.21.20; Thu, 25 Feb 2021 12:21:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HK0vtCW3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234112AbhBYUUu (ORCPT + 99 others); Thu, 25 Feb 2021 15:20:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:35700 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233958AbhBYUUZ (ORCPT ); Thu, 25 Feb 2021 15:20:25 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E0B5D60235; Thu, 25 Feb 2021 20:18:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614284286; bh=v5oVTZBZwuQMLnpywUM1fAUATe03QvCjA1kY3odwcGc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HK0vtCW3kBuIvp1H3XHNfG5tIR/K3dB+ICpVBWkg85qtBoONVXw8BD6jHd4bmxvVQ 5MAaTrgdo3/UYwL5aiZtqcc/mCObhNztvtuzYKMoD+CXXnP8faul0+cNZ7Loq9kePx uo7isOwcGNziFamNjQmEcgjddlrXvUO3q20ZkLQP6h9RlN+VxfkkxdDgqt/JqOwELC PRTc/n9UTBOS78PMmL2wv6fthZq5ljDIaHku7ObQqrYnPHFGQRdkC/pIzIcF+2ji/u yfJ5ufXLhiASISZdRIssAAjYbIlgm2gR8921RvlT/8CNx4CuyA4k2XvfHe348ptqmv tFrk2NK3wrAiA== Date: Thu, 25 Feb 2021 13:18:01 -0700 From: Nathan Chancellor To: Kees Cook Cc: Andrew Morton , Arnd Bergmann , Masahiro Yamada , Nick Desaulniers , Arnd Bergmann , Miguel Ojeda , Marco Elver , Sami Tolvanen , Arvind Sankar , Randy Dunlap , clang-built-linux@googlegroups.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] linux/compiler-clang.h: define HAVE_BUILTIN_BSWAP* Message-ID: <20210225201801.GA3119@MSI.localdomain> References: <20210225164513.3667778-1-arnd@kernel.org> <202102251203.03762F77@keescook> <20210225120637.8e2a234f192952829fc5f471@linux-foundation.org> <202102251213.5815C9B33@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202102251213.5815C9B33@keescook> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 25, 2021 at 12:14:17PM -0800, Kees Cook wrote: > On Thu, Feb 25, 2021 at 12:06:37PM -0800, Andrew Morton wrote: > > On Thu, 25 Feb 2021 12:03:48 -0800 Kees Cook wrote: > > > > > On Thu, Feb 25, 2021 at 05:45:09PM +0100, Arnd Bergmann wrote: > > > > From: Arnd Bergmann > > > > > > > > Separating compiler-clang.h from compiler-gcc.h inadventently dropped the > > > > definitions of the three HAVE_BUILTIN_BSWAP macros, which requires falling > > > > back to the open-coded version and hoping that the compiler detects it. > > > > > > > > Since all versions of clang support the __builtin_bswap interfaces, > > > > add back the flags and have the headers pick these up automatically. > > > > > > > > This results in a 4% improvement of compilation speed for arm defconfig. > > > > > > > > Fixes: 815f0ddb346c ("include/linux/compiler*.h: make compiler-*.h mutually exclusive") > > > > Signed-off-by: Arnd Bergmann > > > > > > Cc: stable@vger.kernel.org > > > > I figured 4% better compile time isn't significant enough to justify a > > backport. Thoughts? > > It's a trivial change, so I think it's worth it? Indeed. Any wins that we can get with compile time, we should take. Clang is being widely used in production systems now so I feel like with a trivial change plus user visible impact, it should be backported. Not to mention that the generated code in theory should be better because it is the compiler's builtin, rather than a hand rolled one, AND this is technically a regression, given that it worked before compiler.h was split. Cheers, Nathan > > > > > Reviewed-by: Kees Cook > > > > -- > Kees Cook