Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6913723imu; Thu, 31 Jan 2019 01:39:31 -0800 (PST) X-Google-Smtp-Source: ALg8bN5YnCh/rgPsOR8EsUEFEalN3qe8EvqTgVO4jP2LdOOgPvlHDiWyeXjKn9EzjSrE+gSOK6w2 X-Received: by 2002:a63:cf02:: with SMTP id j2mr31267411pgg.113.1548927571345; Thu, 31 Jan 2019 01:39:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548927571; cv=none; d=google.com; s=arc-20160816; b=OCBDFcpVNUpStJ3rXVx7HjwK2hWk8hfvWXY9fBBFPKrcIiClUefrQiRJnwAf7dQHih kHCdwVWGrDnWaRcvOXldrt+Goc2ihC90+C9F7DwgNEgOLS5zZh1cW7W6lkImwK1wsbCc +rwVbUMYaNOh4crl5Gp1KRrcP2KefhrgOGFSii2akj0t+DIx1WPe8QDsbl+W9GCI9v6V ZmGLubcanikDakrKdVRjSppTeFFNMQE31Sg/OyZ8uw1niakUPVpKAO5o8OVTfxQ1MpzU h7+SbGSS37b9KQF5jmCWpdbnLgkOuDxyOdt6q6L3AQNutXVar8zODiAPxXmwYQkUwH5S uDhw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=cXN417Kx/jqLTLPY+nPNWPNIEjWSmstnB34dkZaYrnc=; b=BWZP1FFszIY8KmrGDEq+R+QDd9fGYSEDhj2bHzMJXKpYwORQKASC5SSiLPZ0kSmF4r kXnHvq8jgF3VDETWxYTQ0FgWYr0JZE+/RwIFUzkkPRMZx39ROteQp931XKG6LWMn2Uie G2k+B8u5R2k5aKHP68l+SyhWLHfOv0cjdFkmWNWf9I23FdI9YHtZyp8gte+L8kPFxLy+ hs7pmZotfSYREJ7NroWe81mzcKIJPVRvOR7+1huceDgA3NCTUPSzT5z9euZciyYo0lO5 NXwMGn5WhviVR2AGE4tYYmIHNRTfnUTFJUotZJLY4CCGgkmqFhwu2qXsT3aRgsdzjUPs KJXw== ARC-Authentication-Results: i=1; mx.google.com; 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 b6si3925862pgm.216.2019.01.31.01.39.15; Thu, 31 Jan 2019 01:39:31 -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; 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 S1730857AbfAaJjK (ORCPT + 99 others); Thu, 31 Jan 2019 04:39:10 -0500 Received: from www62.your-server.de ([213.133.104.62]:43784 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725963AbfAaJjJ (ORCPT ); Thu, 31 Jan 2019 04:39:09 -0500 Received: from [78.46.172.2] (helo=sslproxy05.your-server.de) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1gp8oJ-00014f-Rd; Thu, 31 Jan 2019 10:39:03 +0100 Received: from [178.197.249.18] (helo=linux.home) by sslproxy05.your-server.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1gp8oJ-000SMa-KZ; Thu, 31 Jan 2019 10:39:03 +0100 Subject: Re: [PATCH] include/linux/bpf.h - fix missing prototype warnings... To: valdis.kletnieks@vt.edu, Alexei Starovoitov Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <6349.1548741865@turing-police.cc.vt.edu> From: Daniel Borkmann Message-ID: <5ff21ff7-fd7e-5e90-86a6-d06f9ab4fa3d@iogearbox.net> Date: Thu, 31 Jan 2019 10:39:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <6349.1548741865@turing-police.cc.vt.edu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.100.2/25345/Thu Jan 31 07:13:04 2019) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/29/2019 07:04 AM, valdis.kletnieks@vt.edu wrote: > Compiling with W=1 generates warnings: > > CC kernel/bpf/core.o > kernel/bpf/core.c:721:12: warning: no previous prototype for ?bpf_jit_alloc_exec_limit? [-Wmissing-prototypes] > 721 | u64 __weak bpf_jit_alloc_exec_limit(void) > | ^~~~~~~~~~~~~~~~~~~~~~~~ > kernel/bpf/core.c:757:14: warning: no previous prototype for ?bpf_jit_alloc_exec? [-Wmissing-prototypes] > 757 | void *__weak bpf_jit_alloc_exec(unsigned long size) > | ^~~~~~~~~~~~~~~~~~ > kernel/bpf/core.c:762:13: warning: no previous prototype for ?bpf_jit_free_exec? [-Wmissing-prototypes] > 762 | void __weak bpf_jit_free_exec(void *addr) > | ^~~~~~~~~~~~~~~~~ > > All three are weak functions that archs can override, although none do so > currently. Provide prototypes for when a new arch provides its own. > > Signed-off-by: Valdis Kletnieks Applied all 3 to bpf-next, thanks Valdis! > diff --git a/include/linux/bpf.h b/include/linux/bpf.h > index 3851529062ec..99e55313123f 100644 > --- a/include/linux/bpf.h > +++ b/include/linux/bpf.h > @@ -472,6 +472,10 @@ _out: \ > #define BPF_PROG_RUN_ARRAY_CHECK(array, ctx, func) \ > __BPF_PROG_RUN_ARRAY(array, ctx, func, true) > > +u64 __weak bpf_jit_alloc_exec_limit(void); > +void *__weak bpf_jit_alloc_exec(unsigned long size); > +void __weak bpf_jit_free_exec(void *addr); > + (I moved these to include/linux/filter.h while applying where we have all the other prototypes from JIT core already.) > #ifdef CONFIG_BPF_SYSCALL > DECLARE_PER_CPU(int, bpf_prog_active); > >