Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754714AbdCPPXP (ORCPT ); Thu, 16 Mar 2017 11:23:15 -0400 Received: from mail-ua0-f180.google.com ([209.85.217.180]:35931 "EHLO mail-ua0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752997AbdCPPVz (ORCPT ); Thu, 16 Mar 2017 11:21:55 -0400 MIME-Version: 1.0 In-Reply-To: <20170316074601.GA23914@gmail.com> References: <20170315214821.127170-1-md@google.com> <20170315214821.127170-2-md@google.com> <20170316074601.GA23914@gmail.com> From: Michael Davidson Date: Thu, 16 Mar 2017 08:21:35 -0700 Message-ID: Subject: Re: [PATCH 2/2] x86, boot: Use regparm=0 for memcpy and memset when using clang To: Ingo Molnar Cc: "H . Peter Anvin" , Thomas Gleixner , Ingo Molnar , Alexander Potapenko , Dmitry Vyukov , x86@kernel.org, LKML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1060 Lines: 25 On Thu, Mar 16, 2017 at 12:46 AM, Ingo Molnar wrote: > > I don't think we want to add such ugly workarounds for clang bugs in a piecemail > wise manner. If this was the _only_ workaround required to have a working kernel > built with clang then maybe, but there's no way to tell from this submission. > Apologies for the lack of context. This change, and the #undef of mem* in x86/boot/string.c are actually the only patches that are absolutely needed to get an x86_64 kernel to build and boot successfully with clang provided that you also arrange for clang be invoked with the -no-integrated-as option. In practice it is also necessary to disable a few more clang warnings to make the build tolerable. I will send out a more complete set of patches later today which deal with those other issues. As far as the specific issue of this particular clang bug is concerned I did also consider adding a configuration option to simply not build the real mode boot code at all but that looked like it would require much more extensive surgery.