Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4339473imu; Mon, 28 Jan 2019 23:10:36 -0800 (PST) X-Google-Smtp-Source: ALg8bN5GCi2sL+P7jQWOl/9Z5ZZ35GvT+2cm0V+Dr/KCFfSgtF9i/C2hLFmkYR4Jesi8p9kfSnNw X-Received: by 2002:a63:5621:: with SMTP id k33mr22901677pgb.395.1548745836619; Mon, 28 Jan 2019 23:10:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548745836; cv=none; d=google.com; s=arc-20160816; b=thMyNrgJnb7m50CcLJoGHiBiBaQfAuFCEY/Bc8mwHsmw8ccP1MbFVkeXYDsFRaIURF lbZBkAPM9khcfm0xdUMPoAkoMovvuhIlr88Zc/j3gKUwwN4E8ucsvvo+mSC0d6sgXyYq DdVUMby5j6F17bmCI4+fQAT1d3G7IimnaoHJ7B9kWHaCWTYGuFBps531cD40IxQ7K8j0 sU5XIhLCg1sFCnxnUItMhf/UuZALPLO38oAczcIacboXkaODswspksOUgZRdssqdKRpb 6396yLXijQPrCkI2a/kZ4PqVw+m3zBU+g16px2MgRuDJse6yhNTMIbtYoMcgtPgTs/u5 lQhA== 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=HnPr78Z6Tsbuc0oWNtnDSNjoERejteU0nTTrHWFce8c=; b=HAMFtHkHRAzfFgUH39pWE1kEsaoZRN3/M5eqXiK4fLEN/nfbvxReEwxse38pbxcU89 3MmMdU/EWI6t4vbh7Kh+r9glyCnItz2qYAr/tEZwztopOikrtoATeT+09cyv5wnTwabB lXtJVZDVwP9Q/5WWSldRC4FQhtFWJinozyMqS22H99xZiXdhBjsECOWFxSo1RvKhRTjp bJ8h9annaqlclJRQpMGGbIdggtH6bl8Ll5DZ8RcksQWldIAEOSRBrtSGMYaTKUgImazt +zgMKTXoYv3iXNZ6+YtDZOPltrbjn0iNSn6mrDB/7Ot8F+7FdIOOx1nqgI9E8Txx502s l1gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=seZcaraZ; 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 n34si5331049pld.381.2019.01.28.23.10.21; Mon, 28 Jan 2019 23:10:36 -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=seZcaraZ; 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 S1727048AbfA2HIH (ORCPT + 99 others); Tue, 29 Jan 2019 02:08:07 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:37355 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725536AbfA2HIG (ORCPT ); Tue, 29 Jan 2019 02:08:06 -0500 Received: by mail-qt1-f196.google.com with SMTP id t33so21175454qtt.4; Mon, 28 Jan 2019 23:08:05 -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; bh=HnPr78Z6Tsbuc0oWNtnDSNjoERejteU0nTTrHWFce8c=; b=seZcaraZA6eM78HPD70+7jYMj48mePTre8O/mQQ7RMGjTFFe4ayBXMZJ47Dz0igBeQ dwa1UnGx3SjrJeX+rWaklNa3EbgSl23+i+iTMCl6iZq3w7GRKI422tnhxlcArQMKfQpW re7S1wRJqmSa0hvwpbEOe2UdbsQEttmK8zlI++eQmhIblrPZBHEmH5TBaQtC5dDwGgQa 5KV01uub5IMOkqfTu4JtqmydZfG0th34jQz63o0s8JU9vBxsCoYyTqf5FKVde4uAr4xr Fi0u/Kxnhbp78W/NAPVpGnUZdJ7+7KkIRhszYcIjywkcVOZURU83BpNyKnOhR79GeWV5 NRuQ== 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=HnPr78Z6Tsbuc0oWNtnDSNjoERejteU0nTTrHWFce8c=; b=MmfkTBMGhtv3iwnZX4S0LIlcd1dLeNPLxKJ8xexjiU4CPgi/m3CNvdICMUaGG5m+Ae 5xjg/MT5ZWWIxlsYImqV2ucgjfGnTgWiOjXDrnF77kqMM4UBPraH4cmdFckfvkJREkdB +6q8cOmVqk9rGD+ALDVg/sHOvsCOsNc5jGnwPJizvoOf9aO+ySHJhkhVztyUrDVo/qsv dIFpNzGEonc5JS9kXhDjTxS0kh446XJTKltItUwk6GMEVqf1T4Dwqu5/H4+uxHweJu3R iyomGDb2RtE0qSVVTg6Ve9gm/vYSmNul2Um/8hDkzu2WW9iSxzh+FRYcbYpV0PWqr8cz Q3hQ== X-Gm-Message-State: AJcUukcUzzb8blWPVc0KBhG1xmGnR5jUNOrvRvEkzJZeEo0gpJXza90c OkKaJL5wf6u3ArDgrL1/rh7Nfk2SgrdgwxaMMPA= X-Received: by 2002:ac8:3312:: with SMTP id t18mr24740566qta.225.1548745685551; Mon, 28 Jan 2019 23:08:05 -0800 (PST) MIME-Version: 1.0 References: <6349.1548741865@turing-police.cc.vt.edu> In-Reply-To: <6349.1548741865@turing-police.cc.vt.edu> From: Song Liu Date: Mon, 28 Jan 2019 23:07:54 -0800 Message-ID: Subject: Re: [PATCH] include/linux/bpf.h - fix missing prototype warnings... To: Valdis Kletnieks Cc: Alexei Starovoitov , Daniel Borkmann , Networking , open list 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 On Mon, Jan 28, 2019 at 10:05 PM 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 Acked-by: Song Liu > > 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); > + > #ifdef CONFIG_BPF_SYSCALL > DECLARE_PER_CPU(int, bpf_prog_active); > >