From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr2-f1.google.com (mail-wr2-f1.google.com [74.125.225.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA9041DA0E1 for ; Sat, 1 Aug 2026 18:34:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.225.65 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785609290; cv=none; b=j7DGGNFD+2vP1rI8l9AmzdW2/OyTnFZ2XuHYwcmgbg/Rz9nFoLR0f58y/tecJlrehxwAxBhtgTsisO5pRanGpwV00M5YbSYv+PQbpuLFT5V/bijIlePJycLN2b/fU7xgJKT+rj0sJOOyBcg3SC3H4m9KQRcGNYXtH42f6ny5bZY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785609290; c=relaxed/simple; bh=RPPeB+uzBNWIy1SVKz3NsXb93pretH2jSyOBaj/hQGU=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=o3TUToLm6fOLFpsRIacymPTvDGRfnTZb5IxK5iQa5LNV0jpbaJQeLgeoHa/HLM/KY5UQrw9LnCaC4YYSkAiSBAM+Pr2slc8ySFpcc1cLTWQMfuoJENcb5g4/hbY+41GevtPmeuHzSg/1eTDLJ3urd6CJNICebciwg2TCtnQCcH4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=rizhOUE1; arc=none smtp.client-ip=74.125.225.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rizhOUE1" Received: by mail-wr2-f1.google.com with SMTP id ffacd0b85a97d-47fcb9d4b33so1050961f8f.0 for ; Sat, 01 Aug 2026 11:34:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785609287; x=1786214087; darn=vger.kernel.org; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-type:content-transfer-encoding:mime-version:from:to:cc :subject:date:message-id:reply-to:content-type; bh=nSvM9cc6VvavWB+KiyrrP05uMve1IQtkth4wsZ7Q1Yw=; b=rizhOUE1JA7UBgEg0v1s1zLQcd8jq+ynHkT8z3+88JcyRxEn1Xvf8gEtU46VwPQcp3 +Q77VEWhQ861IOMsYp+dwnVt0jVHoYW3yhAS1wzxYiv4fGGbtupn4sM4vvYk9sUH4X6N YVleWi4ta3ZmrmpR951nOdpenJVt9pcJduFAr7VC2nf+WO0hG3jPfmOHVRqiMsJgdzmO JxipRg73aMdVyk91dV8s83wTMPSuDKwx+vQOvN5NH3MG395X/oeSX1uieQnj+HLbcn0W 5VPe9xyuo/cHjp+S4pOiyyTwPaXBJbvOMAy9tdRixrIPmuEg+Esv3NWkRGM3Ntbpl9Mt YSsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785609287; x=1786214087; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-type:content-transfer-encoding:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=nSvM9cc6VvavWB+KiyrrP05uMve1IQtkth4wsZ7Q1Yw=; b=LsQ0KGxlVnebDAp1fs/0WvYblfJQnetMfB9x887/VZZo145XV6OS8CfRQ7xn5g0Xhm 9ocH+fjxnZB2y6PQlz7of4A6yYO5ze9nK5bPBPccQ3/UtMdQ5GOVbPHwbDvMvt2wnwcm 6InN1IgHrFF+akSg6pxoNJ9TnioY7DgXOz0+v3z4sNOR5/Y9JYzG0yHvAmpB2cB+87qh tHnRW1uCjkOkZLRwk9Hmwj84IsSKYTP17G6Va/XjFbgblKX7qFCIn8J61Sy9V6IKpSha ISvO2hbNORhz8Ti2J8YeXn5ms6CmqNXzJG4UjfVVRidCQIP7JXkrI7Wp+W9BQr2ih3TC NO6A== X-Forwarded-Encrypted: i=1; AHgh+RocAOa+hzzRIbmg07k5S+TFLW1SOtoXpC3fOIe+PvElJ6ZMFhurL/E561pr0teSum1TU8QL3ZWS+mzjd3A=@vger.kernel.org X-Gm-Message-State: AOJu0YyTjz0kq31aXvJbWwrZ86ozy1aJ+N1TgF9yB4gFVVh0XTfuiBbO SlZ8A2OOvD3ndIUjoP9PNEGC1Z3O4i5ENHWQc1PjfCykgkilxwR6p2AzcbBnam9U X-Gm-Gg: AR+sD12DcunIp6AopIq4iORf45/eFsGQNxPwirzEDeSb+SSibBUvJFDB1obpTK+8Y9J PJZ1jMfusK1kLgy7g0ZAvx/n2S/QfK4tVCSeBSak+i70XvehioUh4iVGg6dXDZKG1o5OSWaWO8c 4/djS4qKREBvxFFtYJDI8iRf7IBBtLxR2zXbqF3DzpZuXzWV1tM1teXjdln71WmvMKYRm5cEqH1 RInf15sHYEFFktYB5pXTgAdymiu1NNnmTDjrmAftGxDRkBQHakr9b7s04U7as0OJGaLc9FQ4uhC mWWWyWNdLE2NkYyASGMXvlEcOa0dzOOvoyH43zf8KgghgfkCcHsnaAAkMBDzJkV6JxZmXVErgWk NocKuslSFXhWyrPgYT0WD82bykDuTHCF5OGoYpufNruUPGmJWSqy+MEEwQCuIXeQcHt5mZ5fb+k xd75w35rvNA3T5lFEHa/YZCeS0KR7N+BjFZuk9Jo9VkjJuJ4+kmGloAIO8xAUzxdcyJMqzapaMj VF7lX+y5umKUuJuQo2tPPBlUgPDQhxl5kRxr9oUizBtLWJOpXSTasMEgiai48wduHA1lKsRlsiz Xzard92trtrK02dd0skEHYDciJk= X-Received: by 2002:a05:6000:41c5:b0:47f:6f9e:1e82 with SMTP id ffacd0b85a97d-47fd72bbc06mr10922416f8f.9.1785609286811; Sat, 01 Aug 2026 11:34:46 -0700 (PDT) Received: from localhost (nat-icclus-192-26-29-3.epfl.ch. [192.26.29.3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47fd458bb4esm17263531f8f.30.2026.08.01.11.34.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Aug 2026 11:34:46 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sat, 01 Aug 2026 20:34:45 +0200 Message-Id: Cc: "Alexei Starovoitov" , "Daniel Borkmann" , "Andrii Nakryiko" , "Eduard Zingerman" , "Mykyta Yatsenko" , , , "Russell King" , "Puranjay Mohan" Subject: Re: [PATCH bpf-next] bpf: Add __bpfcall attribute to bpf_task_work_callback() From: "Kumar Kartikeya Dwivedi" To: "Heiko Carstens" , "Mykyta Yatsenko" X-Mailer: aerc 0.21.0 References: <20260727093834.2178900-1-hca@linux.ibm.com> <20260727141302.11274B21-hca@linux.ibm.com> In-Reply-To: <20260727141302.11274B21-hca@linux.ibm.com> On Mon Jul 27, 2026 at 4:13 PM CEST, Heiko Carstens wrote: > On Mon, Jul 27, 2026 at 02:09:12PM +0100, Mykyta Yatsenko wrote: >> On 7/27/26 10:38 AM, Heiko Carstens wrote: >> > BPF kCFI support is optional for architectures which support kCFI. >> > If an architecture provides bpf kCFI support it must override the >> > default __bpfcall define (which translates to __nocfi). >> > >> > Add the missing __bpfcall attribute to bpf_task_work_callback() which >> > calls bpf programs indirectly to avoid CFI checks for such cases. >> > >> > Fixes: 38aa7003e369 ("bpf: task work scheduling kfuncs") >> > Signed-off-by: Heiko Carstens >> > --- >> > kernel/bpf/helpers.c | 2 +- >> > 1 file changed, 1 insertion(+), 1 deletion(-) >> > >> > diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c >> > index 88b38db47de9..9bf82c9ea1da 100644 >> > --- a/kernel/bpf/helpers.c >> > +++ b/kernel/bpf/helpers.c >> > @@ -4447,7 +4447,7 @@ static void bpf_task_work_cancel(struct bpf_task= _work_ctx *ctx) >> > bpf_task_work_ctx_put(ctx); >> > } >> > >> > -static void bpf_task_work_callback(struct callback_head *cb) >> > +static __bpfcall void bpf_task_work_callback(struct callback_head *cb= ) >> >> Thanks for the patch, I've already sent another fix: >> https://lore.kernel.org/all/20260724-task_work_cfi-v1-1-2616691781ed@met= a.com/ >> Is __bpfcall still needed? > > Yes, it is needed for architectures which select ARCH_SUPPORTS_CFI, and w= hich > in addition support bpf, but do not provide CFI support for bpf programs. > > As of now it looks like this is only the case for arm, at least as far as= I > understand the code. It might be easier to implement bpf/cfi support for = arm, > then drop the __bpfcall macro entirely, and require from future architect= ures > to provde bpf/cfi support whenever they select ARCH_SUPPORTS_CFI. > > I'm writing the above, since due to AI feedback to this patch, there seem= to > be more bpf functions which call bpf programs indirectly and which miss t= he > __bpfcall attribute. I think letting arm JIT folks figure out CFI support is a better path. pw-bot: cr