All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andriin@fb.com>
To: kbuild test robot <lkp@intel.com>
Cc: "kbuild-all@lists.01.org" <kbuild-all@lists.01.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	"hannes@cmpxchg.org" <hannes@cmpxchg.org>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"andrii.nakryiko@gmail.com" <andrii.nakryiko@gmail.com>,
	"bpf@vger.kernel.org" <bpf@vger.kernel.org>
Subject: Re: [linux-next:master 11808/13503] kernel/bpf/syscall.c:154: undefined reference to `vmalloc_user_node_flags'
Date: Sat, 23 Nov 2019 17:37:32 +0000	[thread overview]
Message-ID: <baf09eb1-946b-fe04-6302-006654d594e0@fb.com> (raw)
In-Reply-To: <201911231924.k1adA4Qy%lkp@intel.com>

On 11/23/19 3:44 AM, kbuild test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   b9d3d01405061bb42358fe53f824e894a1922ced
> commit: fc9702273e2edb90400a34b3be76f7b08fa3344b [11808/13503] bpf: Add mmap() support for BPF_MAP_TYPE_ARRAY
> config: arm-randconfig-a001-20191123 (attached as .config)
> compiler: arm-linux-gnueabi-gcc (GCC) 7.4.0
> reproduce:
>          wget https://urldefense.proofpoint.com/v2/url?u=https-3A__raw.githubusercontent.com_intel_lkp-2Dtests_master_sbin_make.cross&d=DwIBAg&c=5VD0RTtNlTh3ycd41b3MUw&r=vxqvl81C2rT6GOGdPyz8iQ&m=OyqPkKr2ayhE9rsjQ3V9TjPHNWGAzMj67odoKch8_YM&s=JuUtGb4L_bH6ANKEMAgVL3zSBnFkOW4jhVP9W3WBHBM&e=  -O ~/bin/make.cross
>          chmod +x ~/bin/make.cross
>          git checkout fc9702273e2edb90400a34b3be76f7b08fa3344b
>          # save the attached .config to linux build tree
>          GCC_VERSION=7.4.0 make.cross ARCH=arm
> 
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>     arm-linux-gnueabi-ld: section .data VMA [0000000000808000,00000000008829bf] overlaps section .ARM.unwind_idx VMA [00000000007d7000,000000000080b8ef]
>     arm-linux-gnueabi-ld: section .ARM.unwind_tab VMA [000000000080b8f0,000000000080febb] overlaps section .data VMA [0000000000808000,00000000008829bf]
>     kernel/bpf/syscall.o: In function `__bpf_map_area_alloc':
>>> kernel/bpf/syscall.c:154: undefined reference to `vmalloc_user_node_flags'
> 

Can't repro this with given config on x86_64. Trying to make make.cross 
work for me still. Any ideas why this is happening? I see that 
__vmalloc_node_flags_caller that we also use if #ifdef'ed as static 
inline in include/linux/vmalloc.h if no CONFIG_MMU is defined. Are we 
missing some config dependency or should I do the same trick as 
__vmalloc_node_flags_caller does?

Also. Daniel, when I tried to build latest bpf-next with this config, I 
got another compilation error, related to your recent patch, you might 
want to take a look as well:

   CC      kernel/tracepoint.o
   CC      kernel/elfcore.o
/data/users/andriin/linux/kernel/bpf/verifier.c: In function 
‘fixup_bpf_calls’:
/data/users/andriin/linux/kernel/bpf/verifier.c:9132:25: error: implicit 
declaration of function ‘bpf_jit_blinding_enabled’; did you mean 
‘bpf_jit_kallsyms_enabled’? [-Werror=implicit-function-declaration]
   bool expect_blinding = bpf_jit_blinding_enabled(prog);
                          ^~~~~~~~~~~~~~~~~~~~~~~~
                          bpf_jit_kallsyms_enabled
   CC      kernel/irq_work.o
   CC      kernel/crash_dump.o

> vim +154 kernel/bpf/syscall.c
> 
>     129	
>     130	static void *__bpf_map_area_alloc(size_t size, int numa_node, bool mmapable)
>     131	{
>     132		/* We really just want to fail instead of triggering OOM killer
>     133		 * under memory pressure, therefore we set __GFP_NORETRY to kmalloc,
>     134		 * which is used for lower order allocation requests.
>     135		 *
>     136		 * It has been observed that higher order allocation requests done by
>     137		 * vmalloc with __GFP_NORETRY being set might fail due to not trying
>     138		 * to reclaim memory from the page cache, thus we set
>     139		 * __GFP_RETRY_MAYFAIL to avoid such situations.
>     140		 */
>     141	
>     142		const gfp_t flags = __GFP_NOWARN | __GFP_ZERO;
>     143		void *area;
>     144	
>     145		/* kmalloc()'ed memory can't be mmap()'ed */
>     146		if (!mmapable && size <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER)) {
>     147			area = kmalloc_node(size, GFP_USER | __GFP_NORETRY | flags,
>     148					    numa_node);
>     149			if (area != NULL)
>     150				return area;
>     151		}
>     152		if (mmapable) {
>     153			BUG_ON(!PAGE_ALIGNED(size));
>   > 154			return vmalloc_user_node_flags(size, numa_node, GFP_KERNEL |
>     155						       __GFP_RETRY_MAYFAIL | flags);
>     156		}
>     157		return __vmalloc_node_flags_caller(size, numa_node,
>     158						   GFP_KERNEL | __GFP_RETRY_MAYFAIL |
>     159						   flags, __builtin_return_address(0));
>     160	}
>     161	
> 
> ---
> 0-DAY kernel test infrastructure                 Open Source Technology Center
> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.01.org_hyperkitty_list_kbuild-2Dall-40lists.01.org&d=DwIBAg&c=5VD0RTtNlTh3ycd41b3MUw&r=vxqvl81C2rT6GOGdPyz8iQ&m=OyqPkKr2ayhE9rsjQ3V9TjPHNWGAzMj67odoKch8_YM&s=zQax2z98Tn-V1wcH0rtwmJ0iA9DpFhqbVNzexx7wOWw&e=  Intel Corporation
> 


WARNING: multiple messages have this Message-ID (diff)
From: Andrii Nakryiko <andriin@fb.com>
To: kbuild-all@lists.01.org
Subject: Re: [linux-next:master 11808/13503] kernel/bpf/syscall.c:154: undefined reference to `vmalloc_user_node_flags'
Date: Sat, 23 Nov 2019 17:37:32 +0000	[thread overview]
Message-ID: <baf09eb1-946b-fe04-6302-006654d594e0@fb.com> (raw)
In-Reply-To: <201911231924.k1adA4Qy%lkp@intel.com>

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

On 11/23/19 3:44 AM, kbuild test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   b9d3d01405061bb42358fe53f824e894a1922ced
> commit: fc9702273e2edb90400a34b3be76f7b08fa3344b [11808/13503] bpf: Add mmap() support for BPF_MAP_TYPE_ARRAY
> config: arm-randconfig-a001-20191123 (attached as .config)
> compiler: arm-linux-gnueabi-gcc (GCC) 7.4.0
> reproduce:
>          wget https://urldefense.proofpoint.com/v2/url?u=https-3A__raw.githubusercontent.com_intel_lkp-2Dtests_master_sbin_make.cross&d=DwIBAg&c=5VD0RTtNlTh3ycd41b3MUw&r=vxqvl81C2rT6GOGdPyz8iQ&m=OyqPkKr2ayhE9rsjQ3V9TjPHNWGAzMj67odoKch8_YM&s=JuUtGb4L_bH6ANKEMAgVL3zSBnFkOW4jhVP9W3WBHBM&e=  -O ~/bin/make.cross
>          chmod +x ~/bin/make.cross
>          git checkout fc9702273e2edb90400a34b3be76f7b08fa3344b
>          # save the attached .config to linux build tree
>          GCC_VERSION=7.4.0 make.cross ARCH=arm
> 
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>     arm-linux-gnueabi-ld: section .data VMA [0000000000808000,00000000008829bf] overlaps section .ARM.unwind_idx VMA [00000000007d7000,000000000080b8ef]
>     arm-linux-gnueabi-ld: section .ARM.unwind_tab VMA [000000000080b8f0,000000000080febb] overlaps section .data VMA [0000000000808000,00000000008829bf]
>     kernel/bpf/syscall.o: In function `__bpf_map_area_alloc':
>>> kernel/bpf/syscall.c:154: undefined reference to `vmalloc_user_node_flags'
> 

Can't repro this with given config on x86_64. Trying to make make.cross 
work for me still. Any ideas why this is happening? I see that 
__vmalloc_node_flags_caller that we also use if #ifdef'ed as static 
inline in include/linux/vmalloc.h if no CONFIG_MMU is defined. Are we 
missing some config dependency or should I do the same trick as 
__vmalloc_node_flags_caller does?

Also. Daniel, when I tried to build latest bpf-next with this config, I 
got another compilation error, related to your recent patch, you might 
want to take a look as well:

   CC      kernel/tracepoint.o
   CC      kernel/elfcore.o
/data/users/andriin/linux/kernel/bpf/verifier.c: In function 
‘fixup_bpf_calls’:
/data/users/andriin/linux/kernel/bpf/verifier.c:9132:25: error: implicit 
declaration of function ‘bpf_jit_blinding_enabled’; did you mean 
‘bpf_jit_kallsyms_enabled’? [-Werror=implicit-function-declaration]
   bool expect_blinding = bpf_jit_blinding_enabled(prog);
                          ^~~~~~~~~~~~~~~~~~~~~~~~
                          bpf_jit_kallsyms_enabled
   CC      kernel/irq_work.o
   CC      kernel/crash_dump.o

> vim +154 kernel/bpf/syscall.c
> 
>     129	
>     130	static void *__bpf_map_area_alloc(size_t size, int numa_node, bool mmapable)
>     131	{
>     132		/* We really just want to fail instead of triggering OOM killer
>     133		 * under memory pressure, therefore we set __GFP_NORETRY to kmalloc,
>     134		 * which is used for lower order allocation requests.
>     135		 *
>     136		 * It has been observed that higher order allocation requests done by
>     137		 * vmalloc with __GFP_NORETRY being set might fail due to not trying
>     138		 * to reclaim memory from the page cache, thus we set
>     139		 * __GFP_RETRY_MAYFAIL to avoid such situations.
>     140		 */
>     141	
>     142		const gfp_t flags = __GFP_NOWARN | __GFP_ZERO;
>     143		void *area;
>     144	
>     145		/* kmalloc()'ed memory can't be mmap()'ed */
>     146		if (!mmapable && size <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER)) {
>     147			area = kmalloc_node(size, GFP_USER | __GFP_NORETRY | flags,
>     148					    numa_node);
>     149			if (area != NULL)
>     150				return area;
>     151		}
>     152		if (mmapable) {
>     153			BUG_ON(!PAGE_ALIGNED(size));
>   > 154			return vmalloc_user_node_flags(size, numa_node, GFP_KERNEL |
>     155						       __GFP_RETRY_MAYFAIL | flags);
>     156		}
>     157		return __vmalloc_node_flags_caller(size, numa_node,
>     158						   GFP_KERNEL | __GFP_RETRY_MAYFAIL |
>     159						   flags, __builtin_return_address(0));
>     160	}
>     161	
> 
> ---
> 0-DAY kernel test infrastructure                 Open Source Technology Center
> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.01.org_hyperkitty_list_kbuild-2Dall-40lists.01.org&d=DwIBAg&c=5VD0RTtNlTh3ycd41b3MUw&r=vxqvl81C2rT6GOGdPyz8iQ&m=OyqPkKr2ayhE9rsjQ3V9TjPHNWGAzMj67odoKch8_YM&s=zQax2z98Tn-V1wcH0rtwmJ0iA9DpFhqbVNzexx7wOWw&e=  Intel Corporation
> 

  reply	other threads:[~2019-11-23 17:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-23 11:44 [linux-next:master 11808/13503] kernel/bpf/syscall.c:154: undefined reference to `vmalloc_user_node_flags' kbuild test robot
2019-11-23 17:37 ` Andrii Nakryiko [this message]
2019-11-23 17:37   ` Andrii Nakryiko
2019-11-25  7:42   ` Rong Chen
2019-11-25 17:53     ` [kbuild-all] " Andrii Nakryiko

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=baf09eb1-946b-fe04-6302-006654d594e0@fb.com \
    --to=andriin@fb.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=hannes@cmpxchg.org \
    --cc=kbuild-all@lists.01.org \
    --cc=lkp@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.