Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4918566imm; Tue, 11 Sep 2018 21:19:52 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ6vR6qH/7RgtCHiDOAJA5mJNdkPLpoIC5TkrdDNXgS09kBgT9yS6kHP4MT1CIPqSKmmjLu X-Received: by 2002:a17:902:304:: with SMTP id 4-v6mr30759755pld.39.1536725992033; Tue, 11 Sep 2018 21:19:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536725992; cv=none; d=google.com; s=arc-20160816; b=HOzrL8CJ+z0A9ZSZg76LXBLWJ5G++puCFVpZ1Z4Tbs/FBDG+UOgaQCh28kndoKb7zi JFXEyDne+74swcNuFVQIVleULxZACDBU2AcRAAfDIrMRtznUGJXNqQ6eNUqiJuA6oEuZ 2zqtwI8nuOga1pxQECvBx+dl+gx1eEfrVajQGDxODXAc8tgunN4ovA/nk9RTzZAzYVsr 23La2gJDLgZaNmcBomkq4yW8ocR05WZwnaJDGD2LxfEhXySHm3COYWWNKVdrOzxyPreG df6k2aEje6s/IcUsEJxmbayMbNrr2Dr7ZsBHTyWb3vgylkjoxu8ztBxWrUTkhcSaH0Vq wrqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=T7GeEr43YbtSGx67w8rL7Oth9A/SWaWTbgP3UxdVuAU=; b=i7+9EQYxSlEQuc5RuXXYbK1Gs54N+Kg8IDGqaHE/NiqSjePsw2wCxZEnlCC11/b8tO gmTSSOxuuAeNe+bSzPJs+/apUzADx/L0Rf5lxAHQa3JnGKDHSwC/ep0p1cjx0/mrh6DE IeMFU92SoT9LmkY+/63qVPAx71DD4hEEYP+EmExUPgQRVmgH77EPq86XPioNkT0pygPT li/s8FEC6AGjfJqNw5gYQoPRHYaEtj/Se77xVor3iMnwNniQ9Rjd564hi2rtrEkfQ342 dFMy+X3XJ23fhj8ZjLkpZpRgys3kbsQApIdKQESYv32NPLL2j28McubkDCJxYHgBAjJo EbFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=asoBjp8Q; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v11-v6si22978604pfk.165.2018.09.11.21.19.34; Tue, 11 Sep 2018 21:19:52 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=asoBjp8Q; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726075AbeILJWG (ORCPT + 99 others); Wed, 12 Sep 2018 05:22:06 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:36882 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725737AbeILJWG (ORCPT ); Wed, 12 Sep 2018 05:22:06 -0400 Received: by mail-qt0-f194.google.com with SMTP id n6-v6so569576qtl.4 for ; Tue, 11 Sep 2018 21:19:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=T7GeEr43YbtSGx67w8rL7Oth9A/SWaWTbgP3UxdVuAU=; b=asoBjp8QMoyY6jvcE5naBqH169o7hy00hFcdHqISG5DJLInnahy6+uWQrGbn9sCu8a cJxjoBB6bqML9+KxXVa00UUN0kW3zvWWNV/rqvEI/OfVom86K9+Hz7vtElz56O+BwmiS Qx2KGSO7p5qAseSUtEY6j7eXtO21a47qZD7tzqB+GL/IZT9NsGyx1zYd5HLzy9Sev1L0 AX++rMfyZxUDf0YLPzr8cZ08nubnl3HmjOG0WXA9j9XC6gyXcuyXukHsBsbKKthPxCLG rZKq/E5KKStiK3Dqbt5v0sJdUjAt3pf1aRXZ8PrZOsjZiRNrnFpuryA1pknBc2Q3tKEA s5ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=T7GeEr43YbtSGx67w8rL7Oth9A/SWaWTbgP3UxdVuAU=; b=UiMaPH88gDtFlz0qra+LTgZj0EcnTJRPy0Bye5ZEjw3xL0uqbVk0ee+OIeZoZBjc4v LdSFkK3I8ImGZ3bgbZvWZK4i53ZfK5nt6KnSz0mdlNBkK9rAUkhWQwrDSQiw7OTpcEnQ jxaLrdZzStBNa8ikCCIr1QtRxx53Rhm9Wv2JAzYeWyKc2J+P5u1Wd4Cf1keVxmXKN+IT SJN66AYB5WWQJ/7WkXn2Jn5vkqJHDT88FWTHlQFPhJCixGus+1DKlyUuSmhPM6oIRzvY joM8dQABGgBLUsGdqPU6D74vM9IH508h0KjtgPo2LSyuOfMY5etmy/NU6VDUcxewLXUg 4XIw== X-Gm-Message-State: APzg51CEKpfSsJv7FSDAs7OP84hdVePymkMfbA/LWNV8Ct56c8of5j7R NyfEIjnfAMIShi5AbncsYDfYgFy2D0/OqSvKROU= X-Received: by 2002:ac8:304a:: with SMTP id g10-v6mr10526qte.136.1536725969248; Tue, 11 Sep 2018 21:19:29 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac8:7494:0:0:0:0:0 with HTTP; Tue, 11 Sep 2018 21:19:08 -0700 (PDT) In-Reply-To: References: <20180910060455.20409-1-stefan@agner.ch> From: Miguel Ojeda Date: Wed, 12 Sep 2018 06:19:08 +0200 Message-ID: Subject: Re: [PATCH] include/linux/compiler-clang.h: define __naked To: Arnd Bergmann Cc: Stefan Agner , Linus Torvalds , Nick Desaulniers , Andrew Morton , Kees Cook , Thomas Gleixner , Ingo Molnar , Andrey Ryabinin , Will Deacon , Rasmus Villemoes , David Woodhouse , Paul Lawrence , Linux ARM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, Nick, Stefan, On Mon, Sep 10, 2018 at 2:14 PM, Arnd Bergmann wrote: > On Mon, Sep 10, 2018 at 8:05 AM Stefan Agner wrote: >> >> ARM32 arch code uses the __naked attribute. This has previously been >> defined in include/linux/compiler-gcc.h, which is no longer included >> for Clang. Define __naked for Clang. Conservatively add all attributes >> previously used (and supported by Clang). >> >> This fixes compile errors when building ARM32 using Clang: >> arch/arm/mach-exynos/mcpm-exynos.c:193:13: error: variable has incomplete type 'void' >> static void __naked exynos_pm_power_up_setup(unsigned int affinity_level) >> ^ >> >> Fixes: 815f0ddb346c ("include/linux/compiler*.h: make compiler-*.h mutually exclusive") >> Signed-off-by: Stefan Agner > >> +/* >> + * ARM32 is currently the only user of __naked supported by Clang. Follow >> + * gcc: Do not trace naked functions and make sure they don't get inlined. >> + */ >> +#define __naked __attribute__((naked)) noinline notrace >> + > > Please see patches 5 and 6 of the series that Miguel posted: > > https://lore.kernel.org/lkml/20180908212459.19736-6-miguel.ojeda.sandonis@gmail.com/ > > I suppose we want the patch to fix clang build as soon as possible though, > and follow up with the cleanup for the next merge window, right? Not sure what the plans of Linus et. al. are, if they have any; but that would be a safe bet. In case they want to speed this up and put the entire series into v4.19 (instead of the two patches), I have done a binary & objdump diff between -rc2 and v4 (based on -rc2) on all object files (with UTS_RELEASE fixed to avoid some differences). In a x86_64 tinyconfig with gcc 7.3, the differences I found are: $ ./compare.py linux-rc2 linux-v4 [2018-09-12 06:16:39,483] [INFO] [arch/x86/boot/compressed/piggy.o] Binary diff (use 'bash -c "cmp linux-rc2/arch/x86/boot/compressed/piggy.o linux-v4/arch/x86/boot/compressed/piggy.o"' to replicate) [2018-09-12 06:16:39,606] [INFO] [arch/x86/boot/header.o] Binary diff (use 'bash -c "cmp linux-rc2/arch/x86/boot/header.o linux-v4/arch/x86/boot/header.o"' to replicate) [2018-09-12 06:16:39,659] [INFO] [arch/x86/boot/version.o] Binary diff (use 'bash -c "cmp linux-rc2/arch/x86/boot/version.o linux-v4/arch/x86/boot/version.o"' to replicate) [2018-09-12 06:16:40,483] [INFO] [init/version.o] Binary diff (use 'bash -c "cmp linux-rc2/init/version.o linux-v4/init/version.o"' to replicate) I will do a bigger one tomorrow or so and see if there are any important differences. Regardless of what we do, I will send the __naked patches separately as well (requested by Nick on GitHub). Cheers, Miguel