From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-171.mta1.migadu.com (out-171.mta1.migadu.com [95.215.58.171]) (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 D66FF1F8AC5 for ; Fri, 20 Feb 2026 15:34:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771601694; cv=none; b=dHOJm/5ZUISapMuSM2JfjjdYcm0XInH+kB8X9WDwcHKM7tjJ/2usnO6DlfKg+CLzryysc7qVkgQAmCw0Ce9ZnIOhs0+kfRkokrl2u41/ow7/JchCtrgydXNyZtwYf7HO5IHyRW/eKDPG6ddNv+bcXzjzi5VCP9u46YijkAxjTI4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771601694; c=relaxed/simple; bh=pI1O8R9NQmElqnZf7f9jqAr1JKxcuC8TjAmVVLVErWE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Jx6sAL0T0btwGvu7Cnfok8uycgrN0kSVx7avrvt7s+5SGqH2ALJJf3Rh2hHsBLsfAQVTT3s7L2QNBTV7U2Ft4m6HePHff1w15Co1sUvm1p6XAV0QJrNmUkRBwd/gWnkVCa4VravFOrqeRL3L4RLQrqFKZ3L5Dqw6FUCf+QgxU0c= 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=pq1jHNkx; arc=none smtp.client-ip=95.215.58.171 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="pq1jHNkx" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1771601679; 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=Z943trj5fRXyCPYj1ZkF6pjisLAiil83x3fUBjHtWMM=; b=pq1jHNkxADK2dq95ZhyKT83WWsDHhuAU9Tk7GgkqH3T9xhFYuhT/xltBiGx4vnSB6psZG9 mIcOrCU5w+8U9+VIJBy/0AT2mJIzS9OqpoZ7YzjSqS+5FgjD7J4hZ7u7S2FD6sYgP4+qEX ir5KmvMrEex2xcOtCALbiOVA35HY59Q= Date: Fri, 20 Feb 2026 23:34:22 +0800 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH bpf-next v2 1/6] bpf: Introduce 64-bit bitops kfuncs To: Alexei Starovoitov Cc: bpf , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Puranjay Mohan , Xu Kuohai , Catalin Marinas , Will Deacon , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , X86 ML , "H . Peter Anvin" , Shuah Khan , Peilin Ye , Luis Gerhorst , Viktor Malik , linux-arm-kernel , LKML , Network Development , "open list:KERNEL SELFTEST FRAMEWORK" , kernel-patches-bot@fb.com References: <20260219142933.13904-1-leon.hwang@linux.dev> <20260219142933.13904-2-leon.hwang@linux.dev> Content-Language: en-US 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: 8bit X-Migadu-Flow: FLOW_OUT On 2026/2/20 01:50, Alexei Starovoitov wrote: > On Thu, Feb 19, 2026 at 6:30 AM Leon Hwang wrote: >> >> >> +static bool bpf_kfunc_is_fastcall(struct bpf_verifier_env *env, u32 func_id, u32 flags) >> +{ >> + if (!(flags & KF_FASTCALL)) >> + return false; >> + >> + if (!env->prog->jit_requested) >> + return true; >> + >> + if (func_id == special_kfunc_list[KF_bpf_clz64]) >> + return bpf_jit_inlines_kfunc_call(bpf_clz64); >> + if (func_id == special_kfunc_list[KF_bpf_ctz64]) >> + return bpf_jit_inlines_kfunc_call(bpf_ctz64); >> + if (func_id == special_kfunc_list[KF_bpf_ffs64]) >> + return bpf_jit_inlines_kfunc_call(bpf_ffs64); >> + if (func_id == special_kfunc_list[KF_bpf_fls64]) >> + return bpf_jit_inlines_kfunc_call(bpf_fls64); >> + if (func_id == special_kfunc_list[KF_bpf_bitrev64]) >> + return bpf_jit_inlines_kfunc_call(bpf_bitrev64); >> + if (func_id == special_kfunc_list[KF_bpf_popcnt64]) >> + return bpf_jit_inlines_kfunc_call(bpf_popcnt64); >> + if (func_id == special_kfunc_list[KF_bpf_rol64]) >> + return bpf_jit_inlines_kfunc_call(bpf_rol64); >> + if (func_id == special_kfunc_list[KF_bpf_ror64]) >> + return bpf_jit_inlines_kfunc_call(bpf_ror64); > > This is too ugly. Find a way to do it differently. Agreed. I'd like to introduce a new flag KF_JIT_MAY_INLINE to indicate the kfunc will be inlined by JIT backends if possible. As for those kfuncs w/ KF_FASTCALL w/o KF_JIT_MAY_INLINE, they are fastcall always. Thanks, Leon