From patchwork Mon Nov 25 23:41:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 11261227 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 23D15138C for ; Mon, 25 Nov 2019 23:41:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E63382071A for ; Mon, 25 Nov 2019 23:41:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="Cs9WEX27" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E63382071A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3F4B36B02B2; Mon, 25 Nov 2019 18:41:10 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 3A2E86B02B3; Mon, 25 Nov 2019 18:41:10 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 291A66B02B4; Mon, 25 Nov 2019 18:41:10 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0125.hostedemail.com [216.40.44.125]) by kanga.kvack.org (Postfix) with ESMTP id 15B576B02B2 for ; Mon, 25 Nov 2019 18:41:10 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id BDA464DCA for ; Mon, 25 Nov 2019 23:41:09 +0000 (UTC) X-FDA: 76196423058.21.sack84_272b9a3b1391a X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,jhubbard@nvidia.com,:andriin@fb.com:daniel@iogearbox.net:songliubraving@fb.com:john.fastabend@gmail.com:hannes@cmpxchg.org:linux-next@vger.kernel.org:bpf@vger.kernel.org:netdev@vger.kernel.org::linux-kernel@vger.kernel.org:jhubbard@nvidia.com:lkp@intel.com,RULES_HIT:30012:30054:30060:30064,0,RBL:216.228.121.143:@nvidia.com:.lbl8.mailshell.net-62.18.0.100 64.10.201.10,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ft,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: sack84_272b9a3b1391a X-Filterd-Recvd-Size: 4626 Received: from hqemgate14.nvidia.com (hqemgate14.nvidia.com [216.228.121.143]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Mon, 25 Nov 2019 23:41:08 +0000 (UTC) Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 25 Nov 2019 15:41:11 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 25 Nov 2019 15:41:07 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 25 Nov 2019 15:41:07 -0800 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 25 Nov 2019 23:41:07 +0000 Received: from rnnvemgw01.nvidia.com (10.128.109.123) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Mon, 25 Nov 2019 23:41:07 +0000 Received: from blueforge.nvidia.com (Not Verified[10.110.48.28]) by rnnvemgw01.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Mon, 25 Nov 2019 15:41:06 -0800 From: John Hubbard To: Andrii Nakryiko CC: Daniel Borkmann , Song Liu , John Fastabend , Johannes Weiner , Linux Next Mailing List , , , , LKML , John Hubbard , kbuild test robot Subject: [PATCH] bpf: fix a no-mmu build failure by providing a stub allocator Date: Mon, 25 Nov 2019 15:41:03 -0800 Message-ID: <20191125234103.1699950-2-jhubbard@nvidia.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191125234103.1699950-1-jhubbard@nvidia.com> References: <20191125234103.1699950-1-jhubbard@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1574725271; bh=ItfxI3SukozgOar1TIJJylL1lPIEpmSk6jTqYlDCsZk=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:X-NVConfidentiality: Content-Transfer-Encoding:Content-Type; b=Cs9WEX27uK0N4VcEYIkXiSBDA6hmo4F10v1wLtg1J6+zbzvxborzChuEepH54npgq 9IciI4WgskIYaqBZlxv04ol708B/ePBEw0gF3TSAVsBgECQlSMpS2gUgf05gXipznY 3aV6jj7DjMFKdNI3sQqbw7e3221mlZuDxy1f1t0+r4n/ZHB2d1FDLTqD/m6YHE+zE1 I25Hr+zLIbQ3z+mmZjRqb80Ci2IcfUUc3ImzIoFSdc9bzAqdMN+nNHL+uxunsu5+Ah i+dxGw22LGjJfWbFZTnSNdIRYn6GrknQF91B6wV/lKTfGqzl8Be+lTW/WzSomfCwne bqwoj9JH1TCqg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Commit fc9702273e2e ("bpf: Add mmap() support for BPF_MAP_TYPE_ARRAY") added code that calls vmalloc_user_node_flags() and therefore requires mm/vmalloc.c. However, that file is not built for the !CONFIG_MMU case. This leads to a build failure when using ARM with the config provided by at least one particular kbuild test robot report [1]. [1] https://lore/kernel.org/r/201911251639.UWS3hE3Y%lkp@intel.com Fix the build by providing a stub function for __bpf_map_area_alloc(). Fixes: fc9702273e2e ("bpf: Add mmap() support for BPF_MAP_TYPE_ARRAY") Reported-by: kbuild test robot Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: Song Liu Cc: John Fastabend Cc: Johannes Weiner Signed-off-by: John Hubbard --- kernel/bpf/syscall.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index e3461ec59570..cb3e13ee4123 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -128,6 +128,7 @@ static struct bpf_map *find_and_alloc_map(union bpf_attr *attr) return map; } +#ifdef CONFIG_MMU static void *__bpf_map_area_alloc(u64 size, int numa_node, bool mmapable) { /* We really just want to fail instead of triggering OOM killer @@ -162,6 +163,12 @@ static void *__bpf_map_area_alloc(u64 size, int numa_node, bool mmapable) GFP_KERNEL | __GFP_RETRY_MAYFAIL | flags, __builtin_return_address(0)); } +#else /* CONFIG_MMU */ +static void *__bpf_map_area_alloc(u64 size, int numa_node, bool mmapable) +{ + return NULL; +} +#endif /* !CONFIG_MMU */ void *bpf_map_area_alloc(u64 size, int numa_node) {