Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1032308imm; Sat, 8 Sep 2018 14:26:52 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZKp5KdqnGcoKgCW38VeIheT39onYPbbZeKnmePj1v1oA6XzgxFAcH5G3UncJ8Z9kBtam26 X-Received: by 2002:a17:902:848d:: with SMTP id c13-v6mr14635855plo.194.1536442012736; Sat, 08 Sep 2018 14:26:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536442012; cv=none; d=google.com; s=arc-20160816; b=urHYk8MaKZ4HFRal1Tzr+M9fXyO4rGGH2bvR3l28zz6ckfN+sMKU5cP+uAvvZ1bOz4 D9t0DDhPULUVSIVcA4RfV6cJyWWrZJytdgOe5I23+WZHyEonu9Y6uCWiWQLDR4uLyR8m 7+Jm7Faejt5L7w32XliupZCc9uswA4wWv9o/ibqWsz9g/dkGIKfr3F7Q9Gqy7YUdNFXS zbhCkA+NHPT7aAX096HzvbWmNm+8TnPIPU0XsbDwkRBmym7eW41c+FIPVXEnZxAgKDUi KYnD2T+mW8of9nNM6TMnj3yOdNm6OpH5cFZ69yuDr2dEn7NBLulFzb6gahMteBrYyFgA +R/A== 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; bh=oAXPr8ETaa7/32NYIRLN7FQZn0P9Pjw91VuXQcuTRrQ=; b=yp+93ik9itiWm+Tqdp0tJWFLvzxwPfHgedChiipIdoHFjbCzkBuI8ael6Zige9yJiy nqZzv/YaBhC/UhNxysw8cs/SFxdC8FIN4kMkOkb9gQkOLm0007QUvVA3yop5t8+NOCov 1XzRsQE9LDm6AmmQk8igBt3dJDSAE+C6+N7wjFpWD/d4tjLMWDldQOjzs5FPSMIbwzZW Mj9QQLFuGsRkI2YHEpT7JdaMnyF/46lU2OxrL5I1R4l1cbZGWVXcVX3Cwj6OtrHTMrAx U25l7cSH27ARRCFEiEIYbNQ7fEGR0/1yEUPQumJz95a70Cl4w4vyTvuN9ao18deOjbRr 8OEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kWpv5uCp; 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 bg5-v6si11603993plb.368.2018.09.08.14.26.35; Sat, 08 Sep 2018 14:26: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=kWpv5uCp; 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 S1727998AbeIICM3 (ORCPT + 99 others); Sat, 8 Sep 2018 22:12:29 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36177 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727675AbeIICM2 (ORCPT ); Sat, 8 Sep 2018 22:12:28 -0400 Received: by mail-wm0-f65.google.com with SMTP id j192-v6so17780952wmj.1; Sat, 08 Sep 2018 14:25:20 -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=oAXPr8ETaa7/32NYIRLN7FQZn0P9Pjw91VuXQcuTRrQ=; b=kWpv5uCpl5l9YTuof4H7BS+m9yPduJZ0jSBabZj2zObW2y3kY5GLjTfPM4j1zhVMKI LHoWmHMVKGFS+XNQsDVWFp+DwsX2RehOkDqJAI21wX+ovdCbJiTrMmsLM+jBO51TcfJF hVEBXwFEIrueDIDKWAuKiLuKiBH6YFyQWqjCibKyS9xs5oY9KBlrZ+abd68szdfHS/bR uKgK0vgqznPpqi6anQV3GUfOd849d739uraLVxcHk6TEl07I2L7yZfb6UgyWXMR0cL5t RqAoiGF2JSI1TuiAQP9Nq9hBEcEIxXE/k+ol1aZ+56bBr2DCc3OUlnyQ/dYeJ78348tz 6hlQ== 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=oAXPr8ETaa7/32NYIRLN7FQZn0P9Pjw91VuXQcuTRrQ=; b=IeNKOUGkuOgdBwxxxwZvUl7wFgQ+Oe59ZF2FaJMJwLWWsejcehR/6ywCIbrNC0stLT +i7j8fcM73tN3UUWgLYP4gA1n1IHv/4IcrXihPNFpmXYhK3zb4gIZRudvRLEGdXBYnOZ czs90K/3EnS+JVrUawAzNFfoNkieDERxcCeqxPe931cxN3TKubjKNbQ+2Q2BVMpgzUc7 N3hKp2JenbOJyAtNZI5Ze3NxwGGXXmxDDaxuUh9SC0oG4aZqkpdimccsm/sAM3qj7D9J gBfkUuqOWAMTr4On0HG52l1r+/U6vtENpfjT8IQeepW6XwabaxVmPgk5gPc7pWTH4xUo 2Afw== X-Gm-Message-State: APzg51ADWp1BNuvlmd3/9Ml2AeNqrPrKezoRT5CFF82/wCg0ZFGmidPX QfINJ5BkMTN7XqQBTELL5cs= X-Received: by 2002:a1c:c7c3:: with SMTP id x186-v6mr8763653wmf.109.1536441919498; Sat, 08 Sep 2018 14:25:19 -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 u40-v6sm17340786wrc.43.2018.09.08.14.25.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Sep 2018 14:25:18 -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 v4 06/13] Compiler Attributes: naked can be shared Date: Sat, 8 Sep 2018 23:24:52 +0200 Message-Id: <20180908212459.19736-7-miguel.ojeda.sandonis@gmail.com> In-Reply-To: <20180908212459.19736-1-miguel.ojeda.sandonis@gmail.com> References: <20180908212459.19736-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 83475515bc39..5ff9cda893f4 100644 --- a/include/linux/compiler_types.h +++ b/include/linux/compiler_types.h @@ -224,6 +224,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