Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4948498ybb; Tue, 24 Mar 2020 08:12:34 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvMGcsJiPN6vhJuX/uf/H4z3JLmj204UKtBPcxVSbBidqQ+8AprTumhOrEORKRPj4xlO6xq X-Received: by 2002:a9d:769a:: with SMTP id j26mr21331992otl.143.1585062754437; Tue, 24 Mar 2020 08:12:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585062754; cv=none; d=google.com; s=arc-20160816; b=JnKG/vFwVd0wVfiZOhB2OfzoZrs7ybK6AyjRXsg2pgFxA5E1H96FiiMWCTVTPBuGIq L/yRdMX7Dpl2m31BCg6LvIuImjFShz8EAdqfx7Drxwo1brXazOgcjnn49inHUd5x3boR 1REMC3xYYl7hyso4370cYIrhqinl87HrNc7nq3MizWSe2yaFOAcSNIYVjxDgAwPTXIar 9OqhMFa85llKeQGEcAWU8dJ6q4Z6ZpOz1362cdgehDo28GNcRMqX+lYxceWTXra/KMIe J4P5AQIX1kvyCm80PjT3fvTspD3aDH6yi0mqvT1FnSj+yB2P387EbtBHzkMRtfiE020t JXuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=I8uPVupr3c0WvBj8c6Gmv9c9F5W6+72PCcAusqly6ao=; b=IGHFYuC1Djj8AsFeQnL1/Bpbbt1H/tXJSaqXjYMR4mxryyFxuHb2LmsXBNiO+fCt9J L9nrCRR2XM+0VXt6a69gwE0CyFIigiuoMMiPgE8fM/Uf07anQiF/NStf4CGKtrZbe1cA LqyBc93whd+KupfNUHwyFiyA05bwbWBDsP1rFV1vnOSKB+t7Pfqkx5o0ZJxVdyj3pp5T trytVSB+d/JQFOnAA3tm03yU/ywlZ7fBbZP+D+hZUMiAqA7TJYqZAGfIDyqxdT1AC1WR Bw4rS5naSg9i+pNk9Dzlr7bzFLLgqeaMX9+05xP5OqR46SD2itUAvHOqns9Lj7kRisWT iorQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a8si8829252oto.299.2020.03.24.08.12.19; Tue, 24 Mar 2020 08:12:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727815AbgCXPJ5 (ORCPT + 99 others); Tue, 24 Mar 2020 11:09:57 -0400 Received: from smtprelay0082.hostedemail.com ([216.40.44.82]:60456 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727567AbgCXPJ4 (ORCPT ); Tue, 24 Mar 2020 11:09:56 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay06.hostedemail.com (Postfix) with ESMTP id 3CCFD18027F92; Tue, 24 Mar 2020 15:09:56 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:966:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2559:2562:2693:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3871:3874:4321:4385:5007:7903:8603:8660:10004:10400:10848:11658:11914:12297:12555:12740:12760:12895:12986:13069:13148:13230:13311:13357:13439:14181:14659:14721:21080:21627:21966:30012:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: rifle75_567c803e6e424 X-Filterd-Recvd-Size: 1914 Received: from XPS-9350.home (unknown [47.151.136.130]) (Authenticated sender: joe@perches.com) by omf15.hostedemail.com (Postfix) with ESMTPA; Tue, 24 Mar 2020 15:09:54 +0000 (UTC) Message-ID: <7a87a9b971caefa847c412608c98c0a2e1835904.camel@perches.com> Subject: Re: [PATCH v2] x86: Alias memset to __builtin_memset. From: Joe Perches To: Clement Courbet Cc: Nathan Chancellor , Kees Cook , Nick Desaulniers , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Date: Tue, 24 Mar 2020 08:08:04 -0700 In-Reply-To: <20200324140742.71850-1-courbet@google.com> References: <20200323114207.222412-1-courbet@google.com> <20200324140742.71850-1-courbet@google.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.34.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2020-03-24 at 15:07 +0100, Clement Courbet wrote: > Recent compilers know the meaning of builtins (`memset`, > `memcpy`, ...) and can replace calls by inline code when > deemed better. For example, `memset(p, 0, 4)` will be lowered > to a four-byte zero store. > > When using -ffreestanding (this is the case e.g. building on > clang), these optimizations are disabled. This means that **all** > memsets, including those with small, constant sizes, will result > in an actual call to memset. [] > In terms of code size, this grows the clang-built kernel a > bit (+0.022%): > 440285512 vmlinux.clang.after > 440383608 vmlinux.clang.before This shows the kernel getting smaller not larger. Is this still reversed or is this correct?