Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1028411iob; Fri, 13 May 2022 20:13:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVRvi35XhQR5+YSShd3gbDv4yMYuDsVVsM0S0xqHCXx3bEAXMtbIUF0mFnRui4cuNCEAMB X-Received: by 2002:a5d:64a3:0:b0:20c:5a27:ef12 with SMTP id m3-20020a5d64a3000000b0020c5a27ef12mr6095808wrp.58.1652497991042; Fri, 13 May 2022 20:13:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652497991; cv=none; d=google.com; s=arc-20160816; b=q+8bCJdCKZ4EfsEAvZQCLpr5cKBenvtZbBSPQPF/Vnllf695oC8BcmRNsocQhyC1KQ SUYRL2Gv5zPDVcrZCN3TY50mWfC8hT9cEt79/K+IkX7kSXVtJAcoOl6Uo0/TafHEGZIk uYhjPVSXbCIJ3Pz3Qao6LZOSRihnJsYw0Jh5fFQQLuYRe3wqbpXVRC1/frFgScTVrM13 srVPLEENyePD3i+dcHUKOCKhq/woVFQhQIF4kFM4pFvRhu2LWzDPZYHlkN5VCupvO25K ufsplbuGBiXQhM9Py+q+B6xQdYGljQzEfc0Duqg5yP5Wgc2an5OF7wPdpQa7icsWgSax xsxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=kqE02dzRDRl7y2hgIY6W5nVbBS7sf7V+wbQ6b8v+gJ4=; b=cAlZBZH2wHzUD2UHpGQb0PJ7UPuHTSQ/kcLf4FHW74C5F7sY2/b46Ma6ZZaEFF3P+b b2tSipBxnoBrca5MOM/uPtx9vCNx+rwJK3cr/GEhgyo0crqNz8U/mzqUmlC6PUsYBIfz 4e4XFO678mtfehobRV5U3tb6QFXl3DChp7ea3C+a6GyA/+SYrbetX5FczTkt3R/TquHT 08sMT96p2bXMW1Qzww2hdK6kWM5NWZciZIzklh+J9EaQhK9khJ2TsakOBkLujaqPfhid ZmROceUbKOTgJuBDMp3/X6EL1SNTueH2oTJNRGLcN6inDdVVIdJv+gr2ep0RkIQuNSb4 kDnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=vhAiG6Ib; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id a2-20020adffac2000000b0020aec40aeb8si3378270wrs.325.2022.05.13.20.13.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 20:13:11 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=vhAiG6Ib; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5EFA43D3E3B; Fri, 13 May 2022 16:53:01 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344132AbiEKP67 (ORCPT + 99 others); Wed, 11 May 2022 11:58:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239167AbiEKP66 (ORCPT ); Wed, 11 May 2022 11:58:58 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F4EC1505CF; Wed, 11 May 2022 08:58:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=kqE02dzRDRl7y2hgIY6W5nVbBS7sf7V+wbQ6b8v+gJ4=; b=vhAiG6IbQmevUMxUAN1yhan8tW TQZT32pMZ4EJw3FKFbL+aCbeAGhRfWxCJg6N+4E/ZAACkM36RAO5ZV2H8/HfToxP8RmDsuBlLSkhJ oCP639Pt/VSPnuGF81eSGXaoP+0o9afSBYunOzV8NoeJ6Cum9FWEjLn9Xmf4V8WJgJMr5h5ZlkDmz JgBi8mwBumCFkp9OvSpl/gfS65rtNCOdVvdaWNfJkx/nKpYy6fWhmhCa2Oa7bXg2WmzULLyAgLLM4 gD4UdRK+5WNOyk4efWNgM1Pyu9SQTIiDiYukoMcyhGxDI5Lcu60Qt7O2dRJ9dkjt+vjI1BOZsJTnb VrKvxQxg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1noojg-007gQb-4R; Wed, 11 May 2022 15:58:48 +0000 Date: Wed, 11 May 2022 08:58:48 -0700 From: Luis Chamberlain To: ast@kernel.org, daniel@iogearbox.net Cc: songliubraving@fb.com, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] bpf.h: fix clang compiler warning with unpriv_ebpf_notify() Message-ID: References: <20220509203623.3856965-1-mcgrof@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220509203623.3856965-1-mcgrof@kernel.org> Sender: Luis Chamberlain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 09, 2022 at 01:36:23PM -0700, Luis Chamberlain wrote: > The recent commit "bpf: Move BPF sysctls from kernel/sysctl.c to BPF core" > triggered 0-day to issue an email for what seems to have been an old > clang warning. So this issue should have existed before as well, from > what I can tell. The issue is that clang expects a forward declaration > for routines declared as weak while gcc does not. > > This can be reproduced with 0-day's x86_64-randconfig-c007 > https://download.01.org/0day-ci/archive/20220424/202204240008.JDntM9cU-lkp@intel.com/config > > And using: > > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64 SHELL=/bin/bash kernel/bpf/syscall.o > Compiler will be installed in /home/mcgrof/0day > make --keep-going HOSTCC=/home/mcgrof/0day/clang/bin/clang CC=/home/mcgrof/0day/clang/bin/clang LD=/home/mcgrof/0day/clang/bin/ld.lld HOSTLD=/home/mcgrof/0day/clang/bin/ld.lld AR=llvm-ar NM=llvm-nm STRIP=llvm-strip OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump OBJSIZE=llvm-size READELF=llvm-readelf HOSTCXX=clang++ HOSTAR=llvm-ar CROSS_COMPILE=x86_64-linux-gnu- --jobs=24 W=1 ARCH=x86_64 SHELL=/bin/bash kernel/bpf/syscall.o > DESCEND objtool > CALL scripts/atomic/check-atomics.sh > CALL scripts/checksyscalls.sh > CC kernel/bpf/syscall.o > kernel/bpf/syscall.c:4944:13: warning: no previous prototype for function 'unpriv_ebpf_notify' [-Wmissing-prototypes] > void __weak unpriv_ebpf_notify(int new_state) > ^ > kernel/bpf/syscall.c:4944:1: note: declare 'static' if the function is not intended to be used outside of this translation unit > void __weak unpriv_ebpf_notify(int new_state) > ^ > static > > Fixes: 2900005ea287 ("bpf: Move BPF sysctls from kernel/sysctl.c to BPF core") > Signed-off-by: Luis Chamberlain > --- > > Daniel, > > Given what we did fore 2900005ea287 ("bpf: Move BPF sysctls from > kernel/sysctl.c to BPF core") where I had pulled pr/bpf-sysctl a > while ago into sysctl-next and then merged the patch in question, > should I just safely carry this patch onto sysctl-next? Let me know > how you'd like to proceed. > > Also, it wasn't clear if putting this forward declaration on > bpf.h was your ideal preference. After testing this on sysctl-testing without issues going to move this to sysctl-next now. Luis