Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1890072imu; Fri, 14 Dec 2018 02:18:28 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xq6FEmpJtv8L5cNy46glOBKijCDvu0txSCip+vatiOS82ahR38LPhHEe4jO5kK6PdMebEb X-Received: by 2002:a17:902:bf03:: with SMTP id bi3mr2319784plb.83.1544782708280; Fri, 14 Dec 2018 02:18:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544782708; cv=none; d=google.com; s=arc-20160816; b=T45cxaEUfEDxPcA1JVn1TU0XQJFydI1f/noLTTAojoTNgHQsLzCqm72yH1JkPDvXme Wq0rekYJsEN496BRf49QlE/gJm8u2SSu0KdaAFT1Qx32CqmIQ1Uqsqe9V3fzW9hRgq9d Ut0hwo+4nkWZVlZLXQtsiYQqrIK1F5Q4vzU8E84PZO3fUiwGA9cuj2xxr6/5xm0aLK83 OfWqjZTbRl9JHwvdW7AF5WhSvqGMHsdliI8fVVg53rjih2FVkvItA0fFo/nUkqgIlTSw UZUHqR02peM9GrjG4AkVh23fwHpVf1ZWnqBvlgCGGXCYTGmTcqj9ukcvWEa+gJX+PG3y CaFg== 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 :in-reply-to:references:mime-version:dkim-signature; bh=AQQEISGn2DpIR2KD0vFUnYb6s7qpg8qti7n1ddSLkP4=; b=JJWmdBRQi8A77Hupr/TaP1x6m1DSEscC5TjLa+Yc2PzEgEVA6z0lhMjX/J3b3dMyhe cie8OS3owhr6UkLdDKw7saPZI9bX66iqg/4nV1umJ6qrIKgcG1HdleBp/he7kP7TYQKr amDwpl39U7/76/Or5vh6ii7BYoU01Ao0unELUwqfXogo2zHrEtX6fwtizHfYOKRkpmiV sDt8Z+GAqXd4obTzhdgw/GHVeZTcq5bYQePy8Vywx0cYccr1J+JIITytRlC4XFi+w45+ jKdp18vE9QXPA2GIkcRDvX3YCB26LiK2f9E+SHbPW5Bu8e+GxOmcKRSZOHyO3uojBLUr 7crQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=L95r1pTY; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n1si3723247pgh.172.2018.12.14.02.18.13; Fri, 14 Dec 2018 02:18:28 -0800 (PST) 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=@bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=L95r1pTY; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729574AbeLNKR0 (ORCPT + 99 others); Fri, 14 Dec 2018 05:17:26 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:38868 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729076AbeLNKR0 (ORCPT ); Fri, 14 Dec 2018 05:17:26 -0500 Received: by mail-qt1-f196.google.com with SMTP id p17so5566247qtl.5 for ; Fri, 14 Dec 2018 02:17:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AQQEISGn2DpIR2KD0vFUnYb6s7qpg8qti7n1ddSLkP4=; b=L95r1pTY/83+z0nTJFPLWP6vDevKqkJoGUO531DxzB5ki4ln7KusDTcr2+dFDOchQ3 MFppyV6SpzmrEDKQrash9HLCB8CCvo6PHqPfu+AizcAbOrm2FNvh3pM08/Ya9nYp55Re g3YFKxWvVS4ksRaaH/frLNP8ThPteeaSoNFT2FSj7MbCIAbFXsDZnKbOAR8yM8eNYBsa FGwdJKauJkzxZQz8+I3uNczi6//xuUciRi3Zcrp3K6sNZ2/3tSpVjwlfCANIRFJXe1UR LaHoJORINAVhT5XhaBYF0Y9khilNsZCoRjiEsVS7nolYh667uArdSR2s6iwrGFp66E1u cIJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AQQEISGn2DpIR2KD0vFUnYb6s7qpg8qti7n1ddSLkP4=; b=sb5ESNFqcvrix+Nya8Aag+Xqky5EcfXL/QCw/eFDDLsBiFCO86wJHjwPbYGQcTblHZ b2NMEDA9plj3eXmqmM34ZvGZg6cpUIqOJfch1fqq316+IRo2sqJT7Pv/G1KPhtl/SqF9 /z7Bt2MnfLj8dn8BOOKQ2Q3we9gkRP+XYUD++Bfej539Pkne2DVYFzOjZlIysYjYyu9T 7WQvF6WKy7hpwpTHla8QH8GHIlF9Hv5Diu1mFcDQqEWrUSlLInWfDxNh/j//VnyqrMDp 59cvKx9c90KkoBJWXYaP5r7Z/TTRGgJw83E0lVns3u270Uh0M6d64L0L6V8O9gmIbPJE qvtw== X-Gm-Message-State: AA+aEWazDrxTAhx2wTYhmwhrTFviz5WvQLMJKpGIQtSSgWROJ8wj91fe KHICdeXUm25xcjQ+wFJyl/UcQK1EcDacSvKsdGe8/A== X-Received: by 2002:aed:3ae4:: with SMTP id o91mr2122994qte.251.1544782645295; Fri, 14 Dec 2018 02:17:25 -0800 (PST) MIME-Version: 1.0 References: <20181209032715.3466040-1-liuxiaozhou@bytedance.com> In-Reply-To: From: =?UTF-8?B?5YiY5pmT6Iif?= Date: Fri, 14 Dec 2018 18:17:14 +0800 Message-ID: Subject: Re: [PATCH v2] Compiler Attributes: don't pollute userspace with macro definitions To: Miguel Ojeda Cc: Greg KH , Nick Desaulniers , Masahiro Yamada , Luc Van Oostenryck , Paul Burton , Arnd Bergmann , linux-kernel , Linus Torvalds 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 Miguel, On Thu, Dec 13, 2018 at 10:59:10PM +0100, Miguel Ojeda wrote: > I wonder if we can/should simply move them into the __KERNEL__ && > !__ASSEMBLY__ block that is above, instead. It would be simpler to > read, and there aren't apparently dependencies to those outside it > that go after the block. Yes, this is also more accurate. I will send a v3. > I took a look at where the macros were at each "step", and, on one > hand, compiler-gcc.h was (and is) included entirely inside it, which > is from where most of the macros come originally from. On the other > hand, not all do: __must_check (the generic version, not the one in > -gcc.h) and noinline_for_stack were defined in __KERNEL__ (only) > before commit 815f0ddb346c ("include/linux/compiler*.h: make > compiler-*.h mutually exclusive"). But anyway using those two in > assembly does not make sense, right? > > What do you think? A simple grep shows no assembly are using those macros. Pretty sure it is safe to do it this way. Thanks, Xiaozhou