Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp4926462imc; Mon, 25 Feb 2019 13:47:58 -0800 (PST) X-Google-Smtp-Source: AHgI3IZoCj5L943YnUe2c73wtbSH0yX3jk4R1zmvVayV7X693o1a86UnDGsJBtJSfMNq7XApcAlb X-Received: by 2002:a17:902:822:: with SMTP id 31mr22524088plk.290.1551131278633; Mon, 25 Feb 2019 13:47:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551131278; cv=none; d=google.com; s=arc-20160816; b=i+IsecGYo0raoa5RRYnWh2OSV/DtobTTyENr4w0Oh1deotvvBAA05lZ57wgYxJ/r1h T3Nme0Q1FZTHT+64j/ugABq3JEMr2Hymt+9f7cz4RxSoVRafKelLAniN9WvJ4TUlowjZ SJTXaeJ5kodMLmIh/IjNE4zPcYB18t00r9Sry5OU89DGV5zWhPni6Tj0i7U+Kd60erbP +y5wCuKZdSaqPp5+qUO4XRBgU65B4NcJAJeJ5BixIq6fd8r8LHjpSuZBEt/1TbaoJHAw YVtLSRLeSRhD3yIRJ5CFcrkFjocyuUNwoizfZiMkkdHTRjbKLmfE7KT+6Hm7m0/JiohS yu4A== 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=AZJK9lMK5Aesr8WlQ77radWWQssP9dl4cxxRFFaqNbA=; b=cZdKFSXp1WTTPHpV0/kqQmsaJF58MkgPbHGG/IUsMSE7e9+6UbOH5kTmkE/YNOP+br FlunQxxGbQwl+xTwzPd2j2ZfykPZSRbkUoc8Q0GZKqzMAn4ld6e9+SZ6cTsmJT7ufyJQ sFyJqXRN3uqJJ2TF20BCxTINvgv+mTT0xj1Pu7MKo+PUJgS8b6xhPO0QwWbHtOq8aYMa y4HV0ouTeY+OqCmCBY4ckVUSdMhDUkuaZ/v2qutuUJue0pnPXJYbv26iSnRcD+2VWxd7 lJP7gQJoqGt37XnTBqKBJFGJ8YqoiiYbwXMuh7Zj8X+ezNhjsXUCliACJMMIpct0lM73 SVtA== 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 cc9si11758944plb.59.2019.02.25.13.47.43; Mon, 25 Feb 2019 13:47:58 -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 S1731965AbfBYV3F (ORCPT + 99 others); Mon, 25 Feb 2019 16:29:05 -0500 Received: from www62.your-server.de ([213.133.104.62]:46878 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730948AbfBYV3C (ORCPT ); Mon, 25 Feb 2019 16:29:02 -0500 Received: from [88.198.220.130] (helo=sslproxy01.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 1gyNo4-00075x-5j; Mon, 25 Feb 2019 22:29:00 +0100 Received: from [178.197.249.32] (helo=linux.home) by sslproxy01.your-server.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1gyNo3-0005kC-RN; Mon, 25 Feb 2019 22:28:59 +0100 Subject: Re: [PATCH v2] bpf: test_bpf: turn of preemption in function __run_once To: Anders Roxell , ast@kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann References: <20190222084652.1326-1-anders.roxell@linaro.org> From: Daniel Borkmann Message-ID: <31dccc3f-3355-31b6-87c1-81d9ff35515b@iogearbox.net> Date: Mon, 25 Feb 2019 22:28:58 +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: <20190222084652.1326-1-anders.roxell@linaro.org> 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/25371/Mon Feb 25 11:48:47 2019) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/22/2019 09:46 AM, Anders Roxell wrote: > When running BPF test suite the following splat occurs: > > [ 415.930950] test_bpf: #0 TAX jited:0 > [ 415.931067] BUG: assuming atomic context at lib/test_bpf.c:6674 > [ 415.946169] in_atomic(): 0, irqs_disabled(): 0, pid: 11556, name: modprobe > [ 415.953176] INFO: lockdep is turned off. > [ 415.957207] CPU: 1 PID: 11556 Comm: modprobe Tainted: G W 5.0.0-rc7-next-20190220 #1 > [ 415.966328] Hardware name: HiKey Development Board (DT) > [ 415.971592] Call trace: > [ 415.974069] dump_backtrace+0x0/0x160 > [ 415.977761] show_stack+0x24/0x30 > [ 415.981104] dump_stack+0xc8/0x114 > [ 415.984534] __cant_sleep+0xf0/0x108 > [ 415.988145] test_bpf_init+0x5e0/0x1000 [test_bpf] > [ 415.992971] do_one_initcall+0x90/0x428 > [ 415.996837] do_init_module+0x60/0x1e4 > [ 416.000614] load_module+0x1de0/0x1f50 > [ 416.004391] __se_sys_finit_module+0xc8/0xe0 > [ 416.008691] __arm64_sys_finit_module+0x24/0x30 > [ 416.013255] el0_svc_common+0x78/0x130 > [ 416.017031] el0_svc_handler+0x38/0x78 > [ 416.020806] el0_svc+0x8/0xc > > Rework so that preemption is disabled when we loop over function > 'BPF_PROG_RUN(...)'. > Commit 568f196756ad ("bpf: check that BPF programs run with preemption disabled") > highlighted the issue. (Technically not an issue in the test suite itself, but good to have same guarantees everywhere in BPF_PROG_RUN().) > Suggested-by: Arnd Bergmann > Signed-off-by: Anders Roxell Applied, thanks!