Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7564684rdb; Wed, 3 Jan 2024 23:44:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IErGokGMsLxrUyxbiX3RVpIb+XlkvQyH2bhtTIdf0Jf3/QDY2CnzbflzpBW0Qcue+DZuxyU X-Received: by 2002:a05:6512:3d05:b0:50e:7b9e:359c with SMTP id d5-20020a0565123d0500b0050e7b9e359cmr130874lfv.29.1704354295769; Wed, 03 Jan 2024 23:44:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704354295; cv=none; d=google.com; s=arc-20160816; b=0WbXr/ZMBlT/PvUgl41LoRv7DR/A3H662CtE5a4Ix51YWfbUmQcppNPD+Sl9IdgGlc mm9ptHRG9go2DOSyEVvaLfdndtKlvAQ60Vd8KEADi3wWb1m9dRRe/MQoI1IC9aLLJym4 n/25ccLlb4w7Ydn+nushnOEnkEuUFjluvr1pHPWfnsohS4qcMDnJ2TNUg8NoKzBQNLAD ZHbstbXx2Oye/XvaCmzEizrq6q/FZnfY+qaeO4JvSzV/lgDhB6LOXsOwJuB1ZS42t1q5 bIZwlEsDO8boR/sN3xWEpNYWJWq28pw9P4ZNEFyQKI+FuHLgISOD6naPNKfQsOGhjBOI 5Ing== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:date:message-id:from :cc:references:to:subject; bh=TKNGaNan1o8OSPjW8vA8kRmzHrA8DBUAVBsByhX0WEM=; fh=7xSRwP8esci1ewKzxe8qvszprHrmFRuolR9/mSJktnw=; b=FfsaFUlta8qQIub/Ah6H8C1l9t514qAkOEi00NSLXpV+t4oV/gDJbvjxYtyD63O89N fzyGqHphJAtIc0zlO68pOgrKgnu5O2gDYLxskYQelotyuQko4IZgq4IKv3ovUZh3vCR4 +Hp0SYcOlSTDx35W4YTDRsnWT4WI4KRmvPMlzVwXEdvl8AOUKYRAMN69b5vsMLE74OUu t5kiP36eer01+5QRYzBy+EO9hCyX8v8doxdpD3zAdlXJULCmk0Y9lym7Vr+2b/U2Gc3E q96SePfBtIJ1Dk9GBP1JioKZyjNVkFrwnjWdLkG+RgJnBtAXxbyqGKlqbvWbRfG+7ug0 kgLA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-16330-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16330-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id mf8-20020a1709071a4800b00a28dfe68ae2si295822ejc.318.2024.01.03.23.44.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 23:44:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-16330-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-16330-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16330-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7E3981F24FD4 for ; Thu, 4 Jan 2024 07:44:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 97F8C208C4; Thu, 4 Jan 2024 07:43:43 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5DD07208A6; Thu, 4 Jan 2024 07:43:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8AxDOs+YZZlq+ABAA--.7171S3; Thu, 04 Jan 2024 15:41:51 +0800 (CST) Received: from [10.130.0.149] (unknown [113.200.148.30]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxPN48YZZlfyoBAA--.2989S3; Thu, 04 Jan 2024 15:41:48 +0800 (CST) Subject: Re: [PATCH bpf-next v1] bpf: Return -ENOTSUPP if callbacks are not allowed in non-JITed programs To: John Fastabend , Eduard Zingerman , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko References: <20231225091830.6094-1-yangtiezhu@loongson.cn> <1179fcf4e4feaf5d9161eb0ec8fb41e4f08511a4.camel@gmail.com> <6594a4c15a677_11e86208cd@john.notmuch> Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org From: Tiezhu Yang Message-ID: <0ea51d9f-7007-b893-0903-d9f76d6f34c9@loongson.cn> Date: Thu, 4 Jan 2024 15:41:48 +0800 User-Agent: Mozilla/5.0 (X11; Linux mips64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <6594a4c15a677_11e86208cd@john.notmuch> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-CM-TRANSID:AQAAf8BxPN48YZZlfyoBAA--.2989S3 X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBj93XoWxJry5KrW7Ar15ZF1Uur4xXwc_yoW8Aw45pF 40kFWqyFWvqa47WasFqFsrua42qw15J3y7W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DU0xZFpf9x07j1tC7UUU UU= On 01/03/2024 08:05 AM, John Fastabend wrote: > Eduard Zingerman wrote: >> On Mon, 2023-12-25 at 17:18 +0800, Tiezhu Yang wrote: >>> If CONFIG_BPF_JIT_ALWAYS_ON is not set and bpf_jit_enable is 0, there >>> exist 6 failed tests. ... >>> Signed-off-by: Tiezhu Yang >>> --- >>> kernel/bpf/verifier.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c >>> index a376eb609c41..1c780a893284 100644 >>> --- a/kernel/bpf/verifier.c >>> +++ b/kernel/bpf/verifier.c >>> @@ -19069,7 +19069,7 @@ static int fixup_call_args(struct bpf_verifier_env *env) >>> * have to be rejected, since interpreter doesn't support them yet. >>> */ >>> verbose(env, "callbacks are not allowed in non-JITed programs\n"); >>> - return -EINVAL; >>> + return -ENOTSUPP; >>> } >>> >>> if (!bpf_pseudo_call(insn)) >> >> I agree with this change, however I think that it should be consistent. >> Quick and non-exhaustive grepping shows that there are 4 places where >> "non-JITed" is used in error messages: in check_map_func_compatibility() >> and in fixup_call_args(). >> All these places currently use -EINVAL and should be updated to -ENOTSUPP, >> if this change gets a green light. > > My preference is to just leave them as is unless its a serious > problem. In this case any userspace has likely already figured > out how to handle these errors so I don't think there is much > value in changing things. I am not quite sure whether to ignore this patch, but the state of this patch is "Changes Requested" [1], I guess I should send v2 as Eduard suggested. [1] https://patchwork.kernel.org/project/netdevbpf/patch/20231225091830.6094-1-yangtiezhu@loongson.cn/ Thanks, Tiezhu