linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Daniel Borkmann <daniel@iogearbox.net>,
	Alexei Starovoitov <ast@kernel.org>,
	Networking <netdev@vger.kernel.org>
Cc: "Linux Next Mailing List" <linux-next@vger.kernel.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Björn Töpel" <bjorn.topel@intel.com>,
	"Andrii Nakryiko" <andriin@fb.com>
Subject: linux-next: manual merge of the bpf-next tree with Linus' tree
Date: Tue, 19 Nov 2019 11:43:33 +1100	[thread overview]
Message-ID: <20191119114333.757f8429@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 3035 bytes --]

Hi all,

Today's linux-next merge of the bpf-next tree got conflicts in:

  include/linux/bpf.h
  kernel/bpf/syscall.c

between commit:

  ff1c08e1f74b ("bpf: Change size to u64 for bpf_map_{area_alloc, charge_init}()")

from Linus' tree and commit:

  fc9702273e2e ("bpf: Add mmap() support for BPF_MAP_TYPE_ARRAY")

from the bpf-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc include/linux/bpf.h
index 464f3f7e0b7a,e913dd5946ae..000000000000
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@@ -688,7 -798,8 +798,8 @@@ int bpf_map_charge_init(struct bpf_map_
  void bpf_map_charge_finish(struct bpf_map_memory *mem);
  void bpf_map_charge_move(struct bpf_map_memory *dst,
  			 struct bpf_map_memory *src);
 -void *bpf_map_area_alloc(size_t size, int numa_node);
 -void *bpf_map_area_mmapable_alloc(size_t size, int numa_node);
 +void *bpf_map_area_alloc(u64 size, int numa_node);
++void *bpf_map_area_mmapable_alloc(u64 size, int numa_node);
  void bpf_map_area_free(void *base);
  void bpf_map_init_from_attr(struct bpf_map *map, union bpf_attr *attr);
  
diff --cc kernel/bpf/syscall.c
index d447b5e343bf,bac3becf9f90..000000000000
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@@ -127,7 -127,7 +127,7 @@@ static struct bpf_map *find_and_alloc_m
  	return map;
  }
  
- void *bpf_map_area_alloc(u64 size, int numa_node)
 -static void *__bpf_map_area_alloc(size_t size, int numa_node, bool mmapable)
++static void *__bpf_map_area_alloc(u64 size, int numa_node, bool mmapable)
  {
  	/* We really just want to fail instead of triggering OOM killer
  	 * under memory pressure, therefore we set __GFP_NORETRY to kmalloc,
@@@ -142,10 -142,8 +142,11 @@@
  	const gfp_t flags = __GFP_NOWARN | __GFP_ZERO;
  	void *area;
  
 +	if (size >= SIZE_MAX)
 +		return NULL;
 +
- 	if (size <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER)) {
+ 	/* kmalloc()'ed memory can't be mmap()'ed */
+ 	if (!mmapable && size <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER)) {
  		area = kmalloc_node(size, GFP_USER | __GFP_NORETRY | flags,
  				    numa_node);
  		if (area != NULL)
@@@ -157,6 -159,16 +162,16 @@@
  					   flags, __builtin_return_address(0));
  }
  
 -void *bpf_map_area_alloc(size_t size, int numa_node)
++void *bpf_map_area_alloc(u64 size, int numa_node)
+ {
+ 	return __bpf_map_area_alloc(size, numa_node, false);
+ }
+ 
 -void *bpf_map_area_mmapable_alloc(size_t size, int numa_node)
++void *bpf_map_area_mmapable_alloc(u64 size, int numa_node)
+ {
+ 	return __bpf_map_area_alloc(size, numa_node, true);
+ }
+ 
  void bpf_map_area_free(void *area)
  {
  	kvfree(area);

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2019-11-19  0:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-19  0:43 Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-01-23 22:44 linux-next: manual merge of the bpf-next tree with Linus' tree Stephen Rothwell
2023-01-23 22:58 ` Stanislav Fomichev
2022-01-24 21:56 Stephen Rothwell
2022-01-24 21:43 Stephen Rothwell
2020-08-24  0:56 Stephen Rothwell
2020-03-31  0:40 Stephen Rothwell
2019-12-15 23:26 Stephen Rothwell
2019-08-08  2:53 Stephen Rothwell
2018-12-21  2:36 Stephen Rothwell
2018-09-24  0:19 Stephen Rothwell
2018-01-15  0:15 Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191119114333.757f8429@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bjorn.topel@intel.com \
    --cc=daniel@iogearbox.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).