Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp628850lql; Mon, 11 Mar 2024 12:24:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVdkb1gbtzn0tlh81LI08lhhW+Dyo0Ud9ulLEDhoV18Yl6ovzEo25E0z2A1LVq8CltHszPcKurKIybO1rume4KltrU7Z66Y3ZcQ8EhJ0A== X-Google-Smtp-Source: AGHT+IEDNVZ+m00VWE+uql2hGHDtxao6LXEW3Aed2f6uS6ghKbuUTghTB3p6Vl9AlX8tPRnk5atv X-Received: by 2002:a17:90b:1201:b0:29b:c1af:ffca with SMTP id gl1-20020a17090b120100b0029bc1afffcamr5309752pjb.31.1710185096291; Mon, 11 Mar 2024 12:24:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710185096; cv=pass; d=google.com; s=arc-20160816; b=08foSYBuKw2Qmn84dy3fJ7pIi+lrDHT63HM6dyzQnZzuI+bfRxwca9pPnZbc3d1Yh5 3TmFUwIXreU5b/n2KZxi/hWIN1YRMoJzKsbKqJxt+gOOLBWw2ZrNbbvEe43tt+g7erkz I0ZuwPC2zMbA/5H5rqHQC9xKIpVGB0SPPlamTrR08LonC0ZCZxWgHGsbPLupZ5YhyrqP EuTaDqBPOkGFEALSvAb85ufr7/EgySqVOXc9WBkNQ16K3YgYE4nhSP29g3ApCP+2eDQn bgDWD/T8DvgC2Dn8gEvrF4AeEPWDyJwLs8+0of5jo/DoH4LJUiGldXPdG4VCCedIgdJu P9bg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=PPemlJM4Xz0k98wRrCIdoRJ/9LZG6WhrdONiHPBnMmw=; fh=IeEaGaPXKGcjOYfobN0IzZhTaVHtw7hg7FRl5MrBvMo=; b=Iy/kTigYrbDvNtv0pz2WC3NnzwSIvZwJG9s3TydwSUwBu7sxxpA7ii3xvmpkTApRmq PwYN4MA39XHBGEzSsr8nWSWKPnehr/90Ay4VILt3NCJ29D6GWTDnReUNqZ22JKGECm6P NKawhAieX9d+2dt5egyXSp+GMdMpsBqI2ffZ1SczBQGinrt0Kw9YR8d2G3FnoMHNJsjF O8jc8UUtMDDp7GfYD8qQax/zEdQkupHcsQO3k/oPUebJZ4Rf+2cC7L1D4OMDj0rpigfV v6XZtsaGI6JHg3YMSWso1/s1rmYI0ztz0Pyz23pbOXE+HWTB95KGP+PCQCjsCaqiJ8V7 Jpgg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=pxbuNjla; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-99466-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99466-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id lt15-20020a17090b354f00b0029c0479de99si2471330pjb.83.2024.03.11.12.24.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 12:24:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-99466-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=pxbuNjla; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-99466-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99466-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id EC9632813B1 for ; Mon, 11 Mar 2024 19:24:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 244C355E72; Mon, 11 Mar 2024 19:24:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="pxbuNjla" Received: from mail-il1-f174.google.com (mail-il1-f174.google.com [209.85.166.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6195C54BFE for ; Mon, 11 Mar 2024 19:24:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710185078; cv=none; b=TIIjb64S7v+UO2l+F+gCKma37crLBeyl0PkDpINyLjS0UGPQ9KR0Gi9gYUlldDEvEmeoLDbvW1c5kCqnwvngBzoaGP1pTAAetOdPYcjwvVUikMgLI9Ab2ehpWWxgArRoZkgd4Asray8/85i1fCiXxEN9gG30/vk4iwnuNU1fcg4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710185078; c=relaxed/simple; bh=DgLWHcwduAxqjCigbUNUqTye02EDECmbNSNBeiAjWj8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=PoMh343jWjCFNF7jJfLdGkNS+ipgI2fN0lDe/FfDxwIVCopFhE2QRffBxxI1BqXbMVny49nCTdwZ+ZBc76Dje9RxhcPRwBxooTmRHW3n/x/Qrm5VJRreikTOl1ZvRmuN2ilW03IfKQ2BQ5F30I3foNufDBGsVJtM28zKQ1MouNs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=pxbuNjla; arc=none smtp.client-ip=209.85.166.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-il1-f174.google.com with SMTP id e9e14a558f8ab-366248b78d9so17625ab.1 for ; Mon, 11 Mar 2024 12:24:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1710185075; x=1710789875; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=PPemlJM4Xz0k98wRrCIdoRJ/9LZG6WhrdONiHPBnMmw=; b=pxbuNjlaOnceYNWJHoUQQzhYjMPi130X9DGE9v72HGo8G2ovCj3Eyq640WR1ZIe1+A sYD4B9u6vxyLeIErXplk896HlLVI0sUgi/QVDCoq6VME612+J5pLJnEEIcXhokFK+P2U Nma8U98Prf+9nxVDUbGe8P0FGuAlfqC1HoT/LAUrRZD/rkskb07d49yHbfE9G0v4inZz IIC7Ija2Cak7EeP3EL+xMrpHrpdG+J9Q+QkUCsAlt14OGsMVngNp4UrGF+ogSRWbUTcR G17E/qzGa3/MDWceOIjZSJH04GccTuicpN3sMVxBhhiDsxWbf8Hw5tEdngiZ/qRCubZP iW1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710185075; x=1710789875; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PPemlJM4Xz0k98wRrCIdoRJ/9LZG6WhrdONiHPBnMmw=; b=oNMBUnYK0t/A1Ss8b470AuW47xS6CGtvGlqVVQBlPHLSXAc0IzlLTq0IYlAdQTlmc/ qG04ZA2H9f5jDXx6zqGGSvKM+P1BTrEdDc+XAtKi0rGMG1ongHvHfXS5ouAsrvZwQZk7 KBWZZ0/YxK2Nx7FsCXvBluvl91/qorxKAi/yrc6eqMdB0E946uGLcpsFV0Vn+INGhhnz huQgIScNbfOnFaeAB4tH5e5mjEJWpYTEIBUIPrD1UHj/iRv8sCfjd9rQ/qILc3G3KD8S IvTRSBegFcVNCEEV6I5jHMjA7cqNkDlpRzyYD9KAyNig2FB5Lpyuy7RECcjZ+Vd4p1MQ 1fnQ== X-Forwarded-Encrypted: i=1; AJvYcCVL4widH+X6t1TF+ahG8wG66HP0QrNM/SiOnJGpLU45OK2iZ5ObXFOsZlA1tYvc90kN+/zzeFscMqkqoHBNtoBOdXI1+FeCb3BUrmRT X-Gm-Message-State: AOJu0YxBoiWK5b3Qlnv5yh9Mvdd1v1IXqjAUnALcpioPy8hN+4DaGURZ YWz05+NXYDEm2EAD20xHHWSQxdYh40/sCgcfB2AwGImzwPasGNq1FCP3l//MhG/IBa75s2XQsST W71f657jnPYmdcsQJimwT4tAfqFqRXHFET/ZP X-Received: by 2002:a05:6e02:1a43:b0:366:27e0:3425 with SMTP id u3-20020a056e021a4300b0036627e03425mr10947ilv.19.1710185075344; Mon, 11 Mar 2024 12:24:35 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240310020509.647319-1-irogers@google.com> <20240310020509.647319-13-irogers@google.com> <1ab20914-b6d2-fe39-7b14-c1ccebaa34f6@arm.com> In-Reply-To: <1ab20914-b6d2-fe39-7b14-c1ccebaa34f6@arm.com> From: Ian Rogers Date: Mon, 11 Mar 2024 12:24:24 -0700 Message-ID: Subject: Re: [PATCH v1 12/13] tools headers: Sync compiler.h headers To: James Clark Cc: Arnd Bergmann , Andrii Nakryiko , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Adrian Hunter , Paolo Bonzini , Shuah Khan , Kees Cook , "Gustavo A. R. Silva" , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Andrew Morton , Liam Howlett , Miguel Ojeda , Will Deacon , Mark Brown , David Laight , "Michael S. Tsirkin" , Shunsuke Mie , Yafang Shao , Kui-Feng Lee , Nick Forrington , Leo Yan , German Gomez , Rob Herring , John Garry , Sean Christopherson , Anup Patel , Fuad Tabba , Andrew Jones , Chao Peng , Haibo Xu , Peter Xu , Vishal Annapurve , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-hardening@vger.kernel.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 11, 2024 at 9:34=E2=80=AFAM James Clark w= rote: > > > > On 10/03/2024 02:05, Ian Rogers wrote: > > compiler.h - synced from include/linux/compiler.h, guards were > > added to definitions to avoid redefinition of macros > > in libc. ftrace, CONFIG_OBJTOOL and kentry logic was removed as > > redundant. > > > > Hi Ian, > > This commit breaks the Arm build (and cross compilation for Arm on x86): > > $ make ARCH=3Darm64 CROSS_COMPILE=3Daarch64-linux-gnu- > > Something like this, but I won't paste the whole output because it's huge= : > > tools/include/linux/ring_buffer.h: In function =E2=80=98ring_buffer_read_= head=E2=80=99: > > tools/include/asm/../../arch/arm64/include/asm/barrier.h:72:35: error: > =E2=80=98__u8_alias_t=E2=80=99 undeclared (first use in this function) > 72 | : "=3Dr" (*(__u8_alias_t *)__u.__c) > \ > | ^~~~~~~~~~~~ > tools/include/linux/ring_buffer.h:59:16: note: in expansion of macro > =E2=80=98smp_load_acquire=E2=80=99 > 59 | return smp_load_acquire(&base->data_head); > | ^~~~~~~~~~~~~~~~ Sorry for this James, I was rushing. I'll address the issues in v2 but the one you highlight above doesn't look like a fun/simple issue to resolve :-( Tbh, I'm not sure how much value tools/include has in its current set up. It is weird the include order in perf prefers tools/include/linux over tools/include/uapi. Current tools/include seems to be trying to do a few different things: 1) provide headers like list.h so programs in tools can have linux style lists, etc. 2) stuff that (1) drags in .. do we really want the asm barrier code from arm? A sane user space program would be better using stdatomic.h, plus that'd give the user space program an ability to get compiled on to weirder targets like wasm. Plus we end up with weird type conflicts like bool coming from linux/types.h rather than stdbool.h. 3) copies of kernel uapi headers that may be more up-to-date that those in your system, thereby exposing constants that things like libbpf depend upon. 4) headers with the same name as and that resemble kernel headers but are really a reimplementation, like tools/include/linux/string.h 5) headers we have just so we can use shell scripts to scrape constants for beautifying things in perf trace For (1) and (2) it seems a separate library would be cleaner than having the code in tools/include. (3) feels like a legit use-case, so we should hold onto tools/include/uapi, but do we want the asm directories? (4) sounds like it should be in a library, perhaps with (1) and (2). (5) feels like the headers should be alongside the shell scripts to avoid polluting tools/include. Not that I propose fixing any of this here. Thanks, Ian > Thanks > James