Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp792754imm; Fri, 31 Aug 2018 13:28:09 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZBzXRRzj/OlfRSgx8qgco3KQU1ZNSTpaEAZhSeD+ibc2SBgqxc28HBqTIlbAednjeTbzdm X-Received: by 2002:a17:902:68:: with SMTP id 95-v6mr16893239pla.248.1535747289253; Fri, 31 Aug 2018 13:28:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535747289; cv=none; d=google.com; s=arc-20160816; b=yVaRc6e3zZIHCJOsww6rnPydgDjFmzjVmDmrPdku9Qy6OPWhtAR4PJJUBOIftIa2hU HfWp2MIPZhayp9G+wtxK9q9hy7PrGO8S2RWV9Sza2jqXH+p3BRGbLUjq2PvAjUUyVuc8 bFQndoVPppL8kgL5uOhhq/Pu4rjfohFGwPx53P4N58wUNYMO9LiFHKYg9WPRyJ9YHio5 xfncI6CNnS14y5rA5wxcsj+QK9OrUtrIBJ4Ik+pYEOL2EAZldFkcgxsLuC1l2Bn0JMP0 YofAADaRkIZ+u7I0ewR1EJG9Y/EfjOGY15+DckjpqXEGzbxvmwfk6Q6xfjJ0hnCjvfks HnQg== 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 :arc-authentication-results; bh=LNWbwQ1xiz3zlVQ6+AjLts6cYDeXgqB3PvKUhOBm/dg=; b=pta3naHvOFItRY2jSD8TAumMCPPFTw2TWLDHaACpsW4LN78Tk5FneuceStx5Mf8dga 4WCr6/212w0ByXkARJ78RqvHzwLEjxcCNSRtlSZCDH50MUX619jaT5U+vFazg4LJD9WK ub5zmBxqwJOCQ5Pv+Q4V+/az/vRdNIeJjowTNRhAZMMGmdMnPWn+7qCJbFl8fFm61KKW x/u2spp+5TJeJ24Jsvwf8luhXtDdGEFnh0jalsfAmaNdkPL9VAY6L5BgNwQKSNFaP2vg y4IbXW7jcyY2eTYCMOgGTsxwmYfMw7h1cEMeddTst2oEV7bmrtGPXvxx84rpkvzgsAGV EcTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="efl/iYfy"; 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 u64-v6si11131122pfd.297.2018.08.31.13.27.54; Fri, 31 Aug 2018 13:28:09 -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="efl/iYfy"; 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 S1727410AbeIAAfb (ORCPT + 99 others); Fri, 31 Aug 2018 20:35:31 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:45138 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727085AbeIAAfa (ORCPT ); Fri, 31 Aug 2018 20:35:30 -0400 Received: by mail-qt0-f196.google.com with SMTP id g44-v6so15919813qtb.12 for ; Fri, 31 Aug 2018 13:26:23 -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=LNWbwQ1xiz3zlVQ6+AjLts6cYDeXgqB3PvKUhOBm/dg=; b=efl/iYfyem0X81bVbSE3S6StfAT/QB5GpyJnGpXgzc3usKqf7SXen/CnVHfcV+6zxV W1B3iZC9uPm7zF3UDCIocmukyizOXiascHby8V+YbjFOKD5XD929YnbaHL8TRISQNm0e p/zcnLbeqHVLofnPysNOpgsUOFQXBJNtwe54dQeF/DY1RV46kIw8B9mV462BEYgQVEiM wmCBpb90/uTE6BCroVW+NrJh2Xwy5sJf45T0kIv066k/zaEdTbfSzHMRYzqxQm1NN+4X F6KIYSGE/UuN3UT2ipNv87nqYgN+nqbgjkTyx2f6l8F4f/3TGA7o+yjF+p/crCTWSG74 0MdQ== 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=LNWbwQ1xiz3zlVQ6+AjLts6cYDeXgqB3PvKUhOBm/dg=; b=YbPyZsMSxY0NbLqvZ/NzmBl//zaH/f5NaFznOgFDP5yct/pQSPxRNXIwb7bUlkSF9c 7k0lTY8chNABpRK4fON9TV1FY0/LyiKuV/IKSFnIti766kqK3LiNaaHg7iI7lMan3vDJ EPWysjj1ebJIao5CMsvNq3gyk38HPbD85AHXElt5RJWefwlOoHAm8Ss3flc3suXRF/8U t2c7zppS3bzbc3xKfyqVXPmenlraeykIh7EoXhwcl8Ss2ksUwZIQqpto0QRHESMWnyEI OXKdh3sFSBM5aa4Qa73VSCg4KasDx5NFbaWBzson9Eg8I5CgzyyWSLq+a4rGsG46GUea 6saA== X-Gm-Message-State: APzg51DPEL6p/SfHvNcZ5+ZDoEujurDYN91Rz2SPpQMBygKNuICpFwP5 nUkjY/GbaJPMrMjxhX1K+1eK+OQVD+niVulfmU4= X-Received: by 2002:a0c:abca:: with SMTP id k10-v6mr16780222qvb.140.1535747183289; Fri, 31 Aug 2018 13:26:23 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:aed:2291:0:0:0:0:0 with HTTP; Fri, 31 Aug 2018 13:26:02 -0700 (PDT) In-Reply-To: References: <20180831170514.24665-1-miguel.ojeda.sandonis@gmail.com> <20180831170514.24665-5-miguel.ojeda.sandonis@gmail.com> From: Miguel Ojeda Date: Fri, 31 Aug 2018 22:26:02 +0200 Message-ID: Subject: Re: [PATCH 5/7] Compiler Attributes: naked was fixed in gcc 4.6 To: Arnd Bergmann Cc: Linus Torvalds , Linux Kernel Mailing List , Eli Friedman , Christopher Li , Kees Cook , Ingo Molnar , Geert Uytterhoeven , gregkh , Masahiro Yamada , Joe Perches , Dominique Martinet , Nick Desaulniers 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, On Fri, Aug 31, 2018 at 9:48 PM, Arnd Bergmann wrote: > On Fri, Aug 31, 2018 at 7:05 PM Miguel Ojeda > wrote: >> >> Commit 9c695203a7dd ("compiler-gcc.h: gcc-4.5 needs noclone >> and noinline on __naked functions") added noinline and noclone >> as a workaround for a gcc 4.5 bug, which was resolved in 4.6.0. >> >> Since now the minimum gcc supported version is 4.6, >> we can clean it up. >> >> See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44290 >> and https://godbolt.org/z/h6NMIL >> > >> diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h >> index 66e1eb8822d9..fdf2fbe6d544 100644 >> --- a/include/linux/compiler-gcc.h >> +++ b/include/linux/compiler-gcc.h >> @@ -77,14 +77,8 @@ >> * to trace naked functions because then mcount is called without >> * stack and frame pointer being set up and there is no chance to >> * restore the lr register to the value before mcount was called. >> - * >> - * The asm() bodies of naked functions often depend on standard calling >> - * conventions, therefore they must be noinline and noclone. >> - * >> - * GCC 4.[56] currently fail to enforce this, so we must do so ourselves. >> - * See GCC PR44290. >> */ >> -#define __naked __attribute__((naked)) noinline __noclone notrace >> +#define __naked __attribute__((naked)) notrace >> > > Good catch. Can this be moved into linux/compiler.h now so we > don't need separate definitions for clang and gcc? Yes, it can! :-) Actually I was writing that to Nick in the other thread about clang, but you beat me to it. Good catch too! Cheers, Miguel