From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754050AbdFVWuy (ORCPT ); Thu, 22 Jun 2017 18:50:54 -0400 Received: from terminus.zytor.com ([65.50.211.136]:54959 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753841AbdFVWuw (ORCPT ); Thu, 22 Jun 2017 18:50:52 -0400 Subject: Re: [PATCH 5/7] x86, boot, LLVM: Use regparm=0 for memcpy and memset To: Peter Zijlstra , Michael Davidson Cc: Michal Marek , Thomas Gleixner , Ingo Molnar , Herbert Xu , "David S. Miller" , Shaohua Li , Alexander Potapenko , Dmitry Vyukov , Matthias Kaehlcke , x86@kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, linux-raid@vger.kernel.org References: <20170317001520.85223-1-md@google.com> <20170317001520.85223-6-md@google.com> <20170317120855.zwqame63yvy5afhg@hirez.programming.kicks-ass.net> From: "H. Peter Anvin" Message-ID: Date: Thu, 22 Jun 2017 15:38:19 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <20170317120855.zwqame63yvy5afhg@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/17/17 05:08, Peter Zijlstra wrote: > On Thu, Mar 16, 2017 at 05:15:18PM -0700, Michael Davidson wrote: >> Use the standard regparm=0 calling convention for memcpy and >> memset when building with clang. >> >> This is a work around for a long standing clang bug >> (see https://llvm.org/bugs/show_bug.cgi?id=3997) where >> clang always uses the standard regparm=0 calling convention >> for any implcit calls to memcpy and memset that it generates >> (eg for structure assignments and initialization) even if an >> alternate calling convention such as regparm=3 has been specified. > > Seriously, fix LLVM already. > Yes, this is a real stinker, in no small part because once clang is fixed to DTRT then this is actually broken... -hpa