Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3086622imm; Mon, 10 Sep 2018 10:47:49 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaeFy2eZtKqm7uVqBmBFMXZungicrakxp1HsXPvxJqt8plF6S2X4fEo4k6C1PV1PlacHPxr X-Received: by 2002:a63:6283:: with SMTP id w125-v6mr23216699pgb.83.1536601669551; Mon, 10 Sep 2018 10:47:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536601669; cv=none; d=google.com; s=arc-20160816; b=q8W0xz1nelgALIDEC4itCBPD+It+jPZkFp2GrawN+E0FfygjtH2Kk3aN/+AcCvjz/0 uskBTzP74PxMUKZd6fq8IoZ/ZjmMfBm0F4QXLPSNLr0eVu5HXa0t5WlJ0evNMVNnS3Xz pk8RDnNkuUEgC5mzLwBW+zEM2h8tRFAxDDx7TgitsbnAMjDoiLQBMtdnEEz8iPOFtMK6 00A1PU4xGOfiOQRRCSK1Nh/iFlsV4egKsOr48agdQoCD4EcAz/qhETbROz7J72JT9HVL 10Cc1izKETmwKiZwkOlDZWyS0u+EBkmNnPCzwTJGRoklhpKvBNzODRvOCydhBMmsSDdX JYyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=0ZWp9KqgbQjuOfzRPLcdogaqdPH6Fd/f5vgZjN9g17s=; b=H7U27/PpPUJPsCLh5KpZC+h+q9EAwr5W/nJ7hBvD3qchgHf+/guJ0QlJLJ6SHuWVN8 ijbYaLoh8jfhRHy7mIpZRSBhoUEwhJQxQjOFTJPft3hCRLDtZ6uVd5B6FkkdrDw8urRB /Lzw+HiZfdFEmRd81ELxpfoV9B5+QIkeXdDp7yOK2hVp6VCfghbKNrA8iGlUW7wH4RWo mRYV+w5Jc38jk1w73m3NyPBcrUWY3FMjnVsHdXO5fc3LYF4jQlRSj2d42XQlXgiRNjhj TAQnfYsYDzPf3sjZ6RXUTt+9PXNRRrRnNnW+GHnFxvmK3Fiq+L9dLqa2HgMyBAMg9jZo kpIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=niYr6EJW; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b98-v6si5262593plb.38.2018.09.10.10.47.24; Mon, 10 Sep 2018 10:47:49 -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=@agner.ch header.s=dkim header.b=niYr6EJW; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728820AbeIJWkt (ORCPT + 99 others); Mon, 10 Sep 2018 18:40:49 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:54458 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726906AbeIJWkt (ORCPT ); Mon, 10 Sep 2018 18:40:49 -0400 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 82F475C0414; Mon, 10 Sep 2018 19:45:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1536601533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0ZWp9KqgbQjuOfzRPLcdogaqdPH6Fd/f5vgZjN9g17s=; b=niYr6EJWOmRdMezY+sIUyxPnftn1R6svpVZ2mH6eO/P8koTkhL548ASOk9VUrpvTvVrQ9O iJPNpc4f1IWjZL+4d9KipYfBl3ZJIyft4xe1WDMrqs4pswsWwp1tX7fgtgX8C53zsiqWoA THIL3j6lRjSXIAsgesVV9CFIJHWKbQk= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Mon, 10 Sep 2018 10:45:33 -0700 From: Stefan Agner To: Miguel Ojeda Cc: Linus Torvalds , linux-kernel@vger.kernel.org, Rasmus Villemoes , Luc Van Oostenryck , Eli Friedman , Christopher Li , Kees Cook , Ingo Molnar , Geert Uytterhoeven , Arnd Bergmann , Greg Kroah-Hartman , Masahiro Yamada , Joe Perches , Dominique Martinet , Nick Desaulniers , linux-sparse@vger.kernel.org, linux-kernel-owner@vger.kernel.org Subject: Re: [PATCH v4 05/13] Compiler Attributes: naked was fixed in gcc 4.6 In-Reply-To: <20180908212459.19736-6-miguel.ojeda.sandonis@gmail.com> References: <20180908212459.19736-1-miguel.ojeda.sandonis@gmail.com> <20180908212459.19736-6-miguel.ojeda.sandonis@gmail.com> Message-ID: X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/1.3.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 08.09.2018 14:24, 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 > > Cc: Rasmus Villemoes > Cc: Luc Van Oostenryck > Cc: Eli Friedman > Cc: Christopher Li > Cc: Kees Cook > Cc: Ingo Molnar > Cc: Geert Uytterhoeven > Cc: Arnd Bergmann > 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 > Signed-off-by: Miguel Ojeda > --- > include/linux/compiler-gcc.h | 8 +------- > 1 file changed, 1 insertion(+), 7 deletions(-) > > diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h > index 76f4907ef707..4cd5e9264bce 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. I think this is also no longer required since GCC 4.6 and newer only have the new mcount interface: https://lore.kernel.org/lkml/20180826214022.4889-1-stefan@agner.ch/T/#u That said, I am not sure whether it is a good idea to enable tracing for naked functions even with the mcount interface. -- Stefan > - * > - * 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 > > #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)