From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-172.mta0.migadu.com (out-172.mta0.migadu.com [91.218.175.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91D3E21B191 for ; Wed, 1 Jul 2026 02:59:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782874794; cv=none; b=U0kXBxo1e3BKYX/8JJkn7JGhJa7zKZxOKp2nHm9YC85i3O3eZsi5q2cUa/rrUGvYmIHlSgIHyp0abN6sMBc8qifxX7IeuGM3XEW2UizHH5yaoImYn3fPlHSUTOL9ba0Mz+5bNeVL3uikZfeC6uMwJPm+ET/nF1OH7EoW9VGsHHQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782874794; c=relaxed/simple; bh=5P83V6vWgCImeuynuBzSptrpGhtSREd+l0Jf7NPHkdU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=D8xVjZAJjY4EtE4tEWqwv1MWl7oQtf5HpZB2XlAZnB8ssOs/L8jpszNG+fIrQm30MYpyzV1d2w/RgD8IYSKPs1MTaI3Ps204/SFdYwHI/06YQsATvmwh27BjY1cZEgvgQXNH3Ly9OVFL9rzmUYAwjmljzRFEkq+KJnv8SE4OgEY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=gMvHvSMV; arc=none smtp.client-ip=91.218.175.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="gMvHvSMV" Message-ID: <18678d0c-f878-4d7b-bf7e-ffca4967dec5@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1782874790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yIRhfH8+QW0w2xHkvd0rrvEbPs85DF8cJWcE4hy3pGU=; b=gMvHvSMVqV1rHUalg0OUAEOBUdoh823uJP1FBuzITK7d4DZRrsOdr/9k/m3eplcH7TM4bz XqQTHIE8GaZmdZdFqgkR/QtCLt/Ed/ifR/Ta1tbGSYIEGTq68aY7ugPyVDbcxeWQgtL6l4 YEoCC17J9W2KMxldSMAOE7tFhxcWrLc= Date: Wed, 1 Jul 2026 10:59:40 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [RFC PATCH bpf 0/6] bpf: Disallow interpreter fallback for interpreter-unsupported insns Content-Language: en-US To: Alexei Starovoitov , bpf@vger.kernel.org Cc: Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Eduard Zingerman , Kumar Kartikeya Dwivedi , Martin KaFai Lau , Song Liu , Yonghong Song , Jiri Olsa , Emil Tsalapatis , Andrew Morton , Shuah Khan , Puranjay Mohan , Anton Protopopov , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org References: <20260626154330.33619-1-leon.hwang@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Leon Hwang In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 1/7/26 07:12, Alexei Starovoitov wrote: > On Fri Jun 26, 2026 at 8:43 AM PDT, Leon Hwang wrote: [...] > > I don't think we need such fallback in patch [3]. Do you mean we can add the internal BPF_ADDR_PERCPU insn support to the interpreter? See my reply in "PROBLEM: BPF interpreter fallback after JIT compilation of BPF_ADDR_PERCPU leads to kernel panic" thread [1]. [1] https://lore.kernel.org/bpf/90c32de0-feac-4e63-9757-2a1d115be08c@linux.dev/ > > And approach taken by this set also doesn't scale, since it splits > the verifier/JIT logic into core.c which will be hard to keep consistent. > I think we need another bit like jit_requested in prog like 'must_jit' > that the verifier set for addr_space_cast, kfuncs and the rest. > > Then the core.c change will be: > diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c > index 649cce41e13f..5126a43c1b81 100644 > --- a/kernel/bpf/core.c > +++ b/kernel/bpf/core.c > @@ -2620,7 +2620,7 @@ struct bpf_prog *__bpf_prog_select_runtime(struct bpf_verifier_env *env, struct > goto finalize; > > if (IS_ENABLED(CONFIG_BPF_JIT_ALWAYS_ON) || > - bpf_prog_has_kfunc_call(fp)) > + fp->must_jit) > jit_needed = true; > Got it. Will follow your suggestion. Thanks, Leon