Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1938330imm; Mon, 3 Sep 2018 13:36:08 -0700 (PDT) X-Google-Smtp-Source: ANB0VdawgrufWJoNTbPkCQJi0F1t/zgSFmGimaK5AFAvbIK9LQlT7Pqh+R0j5GUQCdTFEysvh1IE X-Received: by 2002:a62:3184:: with SMTP id x126-v6mr31083326pfx.49.1536006968743; Mon, 03 Sep 2018 13:36:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536006968; cv=none; d=google.com; s=arc-20160816; b=zh3eVXfzzo8A02/hrkzOwPh2gbE2di75nZV99eGtJWl5Z9zrGDZsEQ0QAZXnnjkfzg hyxPpzzmKxeR+VdoxbeZSMks2IudyCmSDIiUFXW8lznk2pj5R36qEuYlUU/sW6SVmcnm lvHeYUKcKb7/CKjTAKgo4VVoCYrsG/HHNdFPGoV3tdiSgN1m+gbPc3Cf43wo2QCSPiyA XDJd9mgYMVy0RG0srKcyp2jVEOe74/Dl+ZCRFR/Yp5v6oTwkj8enItUt6yMX7WuPTfoT bMPsOb5GSUuWl8U90lGl435Nzo3l3sdEXwgVbuy7Bt+LRe4vUB/voTUNLEyaflLN+txw bUXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=+B+9bm1THTOeBY7olqboSx+3ofE8Jtp1C0MIwvpUxT4=; b=RLkZ23IW91wgzQ0q0CZcqH3EUcJaVNPCEtsTkL3uYWi+pBCOuDMukHr4qZ8JR0AbkP wkxocdUlgxr2FIQMbEGNvdqY0WmkgrT/5fTPrhbjUcsFEIrmsW1Or/xGIw24/TABumBk At0It87/B6UyAa520IQjfsbpAmlfeaLocUoqV+H4am3PWc0L9LjAcJ5BpyAvZSsmhyKy E4EfAJ3PXbuOW7DWEOMFczz/7AschqRqkhpwFv2QLnXrpSo/SbECXuuaxCG/hYrknBZp +OhI30a9piorFmmqSN6N8aIIRqPUy8mcCE8cVb6eRDi41JgJM/S6GAGAgTGJJlnDU4Og F33Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hNVNqqKG; 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 l13-v6si18317217pgr.291.2018.09.03.13.35.54; Mon, 03 Sep 2018 13:36:08 -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=hNVNqqKG; 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 S1729040AbeIDAzs (ORCPT + 99 others); Mon, 3 Sep 2018 20:55:48 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:35901 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728627AbeIDAzr (ORCPT ); Mon, 3 Sep 2018 20:55:47 -0400 Received: by mail-wr1-f68.google.com with SMTP id m27-v6so1780964wrf.3; Mon, 03 Sep 2018 13:33:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+B+9bm1THTOeBY7olqboSx+3ofE8Jtp1C0MIwvpUxT4=; b=hNVNqqKGEpV7IIiybj5escRX0NUAk2HKivO21i7TVFypVICPGLMOgDgnITakCxT0nE TThZFKdJk+OjIeO1aJE0a6xzWIU1HSSuRqoX13KDMyecRXHxbVomImJg6Z0vaW9FXhcz K+oHj4vuQOCCYYr7lMGWnHy8FP3tC4oO2wngJ2dLzwGUOCO5zT/d936/1eeLrRXhy1e4 Wfmqp00oLO2Wo/oCfIzLNEaLQFeeQbevlxwPkjIud0jAdyjFxuF/O1d+kbEFgfvcLW1c //LCMJzoSS42IIE0qElLlxUkJ9sRHNy5HZ/kfMcDBgQP9YILRadbBDdU/tt9e5YfCnRw nWEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+B+9bm1THTOeBY7olqboSx+3ofE8Jtp1C0MIwvpUxT4=; b=XMq21c7S+jArKixdjlQvyROR313pX2BdqfrHudgtl4Oi7dBxfsNl2fSnwVsZCxp7KQ 0zRud/M4u13of5ALiEw2lutqL69ktarqbOuLXcHVA/lSYlNcoMOSAnaJ/FkjwvNhc2ru HnP4rqEfI92D76AR343DCEspo4uG4K3nQq+ktiMGpxQ3xG0wyK27Z0huJdRZayq0kxRd ZIR7kn2T5p1csCTLrBxubohIDw6vRKdt6JKI8UYfbpiZTBKGZkH8khD+68ESvisdTnQq KYxVXx7Vsj3Qpa6XLoS9MFXqTqNbUJvfUlEnqXbuWxyY63MxSHMZnp+GzdFGOprMLWUJ WHGA== X-Gm-Message-State: APzg51DIA5P6IMtNbYhfGhffEZHxCpy60mWQtHWbz7acFGfJc3R8Dz0I lAAc5rfeqdB/sqBXtoRgklE= X-Received: by 2002:a5d:5450:: with SMTP id w16-v6mr21575181wrv.4.1536006835354; Mon, 03 Sep 2018 13:33:55 -0700 (PDT) Received: from localhost.localdomain (62.83.35.8.dyn.user.ono.com. [62.83.35.8]) by smtp.gmail.com with ESMTPSA id 132-v6sm12354870wmd.13.2018.09.03.13.33.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Sep 2018 13:33:54 -0700 (PDT) From: Miguel Ojeda To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, Miguel Ojeda , Rasmus Villemoes , Luc Van Oostenryck , Eli Friedman , Christopher Li , Kees Cook , Ingo Molnar , Geert Uytterhoeven , Greg Kroah-Hartman , Masahiro Yamada , Joe Perches , Dominique Martinet , Nick Desaulniers , linux-sparse@vger.kernel.org Subject: [PATCH 06/12] Compiler Attributes: naked can be shared Date: Mon, 3 Sep 2018 22:33:10 +0200 Message-Id: <20180903203316.16183-7-miguel.ojeda.sandonis@gmail.com> In-Reply-To: <20180903203316.16183-1-miguel.ojeda.sandonis@gmail.com> References: <20180903203316.16183-1-miguel.ojeda.sandonis@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The naked attribute is supported by at least gcc >= 4.6 (for ARM, which is the only current user), gcc >= 8 (for x86), clang >= 3.1 and icc >= 13. See https://godbolt.org/z/350Dyc Therefore, move it out of compiler-gcc.h so that the definition is shared by all compilers. Cc: Rasmus Villemoes Cc: Luc Van Oostenryck Cc: Eli Friedman Cc: Christopher Li Cc: Kees Cook Cc: Ingo Molnar Cc: Geert Uytterhoeven Cc: Greg Kroah-Hartman Cc: Masahiro Yamada Cc: Joe Perches Cc: Dominique Martinet Cc: Nick Desaulniers Cc: Linus Torvalds Cc: linux-sparse@vger.kernel.org Suggested-by: Arnd Bergmann Signed-off-by: Miguel Ojeda --- include/linux/compiler-gcc.h | 8 -------- include/linux/compiler_types.h | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 4cd5e9264bce..3b32bbfa5a49 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -72,14 +72,6 @@ #define __noretpoline __attribute__((__indirect_branch__("keep"))) #endif -/* - * it doesn't make sense on ARM (currently the only user of __naked) - * 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. - */ -#define __naked __attribute__((__naked__)) notrace - #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) #define __compiletime_object_size(obj) __builtin_object_size(obj, 0) diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h index 759b3fea9216..f182f2ef3227 100644 --- a/include/linux/compiler_types.h +++ b/include/linux/compiler_types.h @@ -223,6 +223,14 @@ struct ftrace_likely_data { #define notrace __attribute__((__no_instrument_function__)) #endif +/* + * it doesn't make sense on ARM (currently the only user of __naked) + * 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. + */ +#define __naked __attribute__((__naked__)) notrace + #define __compiler_offsetof(a, b) __builtin_offsetof(a, b) /* -- 2.17.1