Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1445712imu; Wed, 28 Nov 2018 09:38:04 -0800 (PST) X-Google-Smtp-Source: AFSGD/W4cwovHekuKADgz7c/AxyH9u76hFWRhcKMSZy4wqJ7F78FOls9HjZzwc/1+vGsvOaBH+7W X-Received: by 2002:a17:902:8507:: with SMTP id bj7-v6mr37075096plb.99.1543426684756; Wed, 28 Nov 2018 09:38:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543426684; cv=none; d=google.com; s=arc-20160816; b=O27oSAniq43W74l6xtuQIzTQxJSe9uk4UD/AkZDqATfqDKYZD6f/spN3umr/v8vXz2 XcHRSHEUyyZ4/M2m1/vSvHRFKXb+pO4qzUo3uz9lFSe67q14hmSWbBfvYGSo083495bo eoiX5U/pD435NVlDfRmZ+Iu6p3/7ug/7Tw28eo1yF4bdhQFodoz0QxVyhbKlSNB9Ew0U QYmSW04eId6aAkHA651db317r0YFn+xHwpCdnfIzBcoK9R9JlO06nNMwTUZyc0PzCGY6 P3DuzEO7Dwxayn0VvpkFgmPQY5J9+MwRMwKTANr5GiJNPA5UtVfwnZSGs3JmEA3RrTuf emtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=/QuhxiVq/xxyT4idFm0A4A0PmbM8weVG/FM8Lm7YGUQ=; b=Kb4m7tU1UvIcPOODUVRxnXy/VLazM6j74a+6NnkO9uxAzF081YvpP6l+AqFc6gkdUq cpYdtz5pmB+kIBQv5Bls2FbYSrYoQNufoXY3IzVj92nRTCI+/gcr9uTED2ubySsj8pon 9BMuQdnGIcsy470tZLSFCQAvBvzdeXj8YKTkvmGwgUs6VSx92uoCI+Y3G2xQxeXYNqiO rvGa26cphLrLXVujinQww8yj9DW6xgUULYquw6ZDaSXtfKzEZgOirJAHK50ByGwhUuXK 26J5q4ErjSQlFiVZC23eIvHD1VqhkFtNgFKSv6RSGVf+m8BMqqf8kRBSjI1fhMg5BcRm Qj1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SpNSzciR; 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 n18si8678056pfj.30.2018.11.28.09.37.49; Wed, 28 Nov 2018 09:38:04 -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=@gmail.com header.s=20161025 header.b=SpNSzciR; 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 S1728668AbeK2Ehy (ORCPT + 99 others); Wed, 28 Nov 2018 23:37:54 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:38143 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727867AbeK2Ehy (ORCPT ); Wed, 28 Nov 2018 23:37:54 -0500 Received: by mail-lj1-f195.google.com with SMTP id c19-v6so24208481lja.5 for ; Wed, 28 Nov 2018 09:35:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=/QuhxiVq/xxyT4idFm0A4A0PmbM8weVG/FM8Lm7YGUQ=; b=SpNSzciRmXPQikMvb/KMmsJ9Kkukvlrhw6IvvgXypHOFxl4aXsk8VNpt8vn1EPMQ4O 8MTuCA/0CfVKX7oiv2+OcetGjKoJMnEyUmJyBuULBCcDnwS8eFiCrffWs0OsVV2qyUnX eI20RlTpjE/IiPgubPqIjH+DXDrvs06wGG9wH2CudZ4G3CoayitYJpGzN3kNr1DbPhcG F2rTEOxqGd1c1dEVmdaAR7SPrt3F1TY9lxfvw0CyALHTJAdAH2xbROe0yWYnnUy+3yxt YwXYfoe0r6uTezUNRMkNpEkOFOmTHpE2qm53MsDDFfdZ/Z3w1z+5HaOxq2E3Sd5x/VmT evog== 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:content-transfer-encoding; bh=/QuhxiVq/xxyT4idFm0A4A0PmbM8weVG/FM8Lm7YGUQ=; b=ULc7PESC/xdhAfO2rLuKLbpVlYeYxJALf5fqWItELI6LDMe3TjwF9AN9mt1C0CmiFy Q66uyUJk39n937LA7lfHx4Zvc7gz7mqdj+shBXKL0X/es4+ZnZMHBPgrJWQSyeBZOw94 D1Y6yNizy8BwmJVgJvp2vVeojLj7ecwbLhFP74GIaA5yhbHB17UzWfkyLWcm0hGheSfo aqGMLNt12RWVy/+j61SkD6hLbey8wPJNj7VB+DqO7AUuEuQVDM+bcyCt+Bd/xuG2ToLA iCx2QLpf+PQJ+UtcvkcjANizRJqphIQgeQFwAYjegtxnHf61hkxqd35yRgZSSGlxLDKI OUYw== X-Gm-Message-State: AA+aEWYH3w9Mz8oAqlNsjMe7Xh5nl+Sa0/GqXS2pQ0rJW3U2XQNVZEvy 06OAsAQz9n4OrHUWP8czAJgvKYig0M5+tWcbA3A= X-Received: by 2002:a2e:974a:: with SMTP id f10-v6mr26285522ljj.61.1543426529224; Wed, 28 Nov 2018 09:35:29 -0800 (PST) MIME-Version: 1.0 References: <20181128140852.178260-1-liuxiaozhou@bytedance.com> In-Reply-To: <20181128140852.178260-1-liuxiaozhou@bytedance.com> From: Miguel Ojeda Date: Wed, 28 Nov 2018 18:35:18 +0100 Message-ID: Subject: Re: [PATCH] Compiler Attributes: move kernel-only attributes into __KERNEL__ To: liuxiaozhou@bytedance.com Cc: Nick Desaulniers , Luc Van Oostenryck , Paul Burton , Masahiro Yamada , Arnd Bergmann , linux-kernel , Linus Torvalds , Andrew Morton , Greg KH Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Xiaozhou, On Wed, Nov 28, 2018 at 3:09 PM Xiaozhou Liu wr= ote: > > Attributes such as `__gnu_inline' are meant to be used within the > kernel. When userspace somehow includes > (eg. tools/bpf), compilation errors would be shown: > > "error: unknown type name =E2=80=98__gnu_inline=E2=80=99" > > So just move these things into __KERNEL__ and the behavior is kept > as before. That is not exactly correct -- a3f8a30f3f00 moved some attributes to another file, moving them into __KERNEL__ (in particular,__gnu_inline is). The problem is, instead, that __gnu_inline is not anymore defined outside __KERNEL__, but something else that uses it is (the inline macro definition, if I had to guess). If your problem is fixed by putting __gnu_inline into __KERNEL__ again, it means we can simply move the inline definition inside __KERNEL__ too. That way, we don't pollute userspace users with macro definitions. Having said that, does someone know whether userspace should have access to those attributes (or rather, other code that uses in turn those attributes)? Cheers, Miguel