* Re: [PATCH bpf-next 1/2] bpf: Track CPUs that have executed a BPF program
@ 2026-12-05 13:07 kernel test robot
0 siblings, 0 replies; 12+ messages in thread
From: kernel test robot @ 2026-12-05 13:07 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp
::::::
:::::: Manual check reason: "too many reports for this commit"
::::::
BCC: lkp@intel.com
CC: llvm@lists.linux.dev
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <5cf89312e3fea4409dc1fc9da6aa37b1e7a7f3b5.1796391323.git.vmalik@redhat.com>
References: <5cf89312e3fea4409dc1fc9da6aa37b1e7a7f3b5.1796391323.git.vmalik@redhat.com>
TO: Viktor Malik <vmalik@redhat.com>
TO: bpf@vger.kernel.org
CC: Alexei Starovoitov <ast@kernel.org>
CC: Daniel Borkmann <daniel@iogearbox.net>
CC: Andrii Nakryiko <andrii@kernel.org>
CC: Eduard Zingerman <eddyz87@gmail.com>
CC: Kumar Kartikeya Dwivedi <memxor@gmail.com>
CC: Martin KaFai Lau <martin.lau@linux.dev>
CC: Song Liu <song@kernel.org>
CC: Yonghong Song <yonghong.song@linux.dev>
CC: Jiri Olsa <jolsa@kernel.org>
CC: Emil Tsalapatis <emil@etsalapatis.com>
CC: Ihor Solodrai <ihor.solodrai@linux.dev>
CC: John Fastabend <john.fastabend@gmail.com>
CC: Thomas Gleixner <tglx@kernel.org>
CC: Borislav Petkov <bp@alien8.de>
CC: Peter Zijlstra <peterz@infradead.org>
CC: Josh Poimboeuf <jpoimboe@kernel.org>
CC: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
CC: Ingo Molnar <mingo@redhat.com>
CC: Dave Hansen <dave.hansen@linux.intel.com>
CC: x86@kernel.org
CC: "H. Peter Anvin" <hpa@zytor.com>
CC: Valentin Schneider <vschneid@redhat.com>
CC: Tomas Glozar <tglozar@redhat.com>
CC: Viktor Malik <vmalik@redhat.com>
Hi Viktor,
kernel test robot noticed the following build errors:
[auto build test ERROR on bpf-next/master]
[also build test ERROR on linux-review/Xu-Kuohai/bpf-Invalidate-freed-prog-pack-memory-without-holding-pack_mutex/20261203-140921 next-20261204]
[cannot apply to bpf/master tip/x86/core linus/master v7.4-rc5]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Viktor-Malik/bpf-Track-CPUs-that-have-executed-a-BPF-program/20261204-144401
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link: https://lore.kernel.org/r/5cf89312e3fea4409dc1fc9da6aa37b1e7a7f3b5.1796391323.git.vmalik%40redhat.com
patch subject: [PATCH bpf-next 1/2] bpf: Track CPUs that have executed a BPF program
:::::: branch date: 23 hours ago
:::::: commit date: 23 hours ago
config: hexagon-randconfig-1000-20261204 (https://download.01.org/0day-ci/archive/20261205/20261205210325.VRjP89pz-lkp@intel.com/config)
compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261205/20261205210325.VRjP89pz-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/20261205210325.VRjP89pz-lkp@intel.com/
All errors (new ones prefixed by >>, old ones prefixed by <<):
>> ERROR: modpost: drivers/net/ethernet/engleder/tsnep.ko: symbol 'bpf_pred_flush_enabled' undefined!
>> ERROR: modpost: drivers/net/ethernet/engleder/tsnep.ko: symbol 'bpf_prog_ran' undefined!
>> ERROR: modpost: drivers/net/ethernet/freescale/fec.ko: symbol 'bpf_pred_flush_enabled' undefined!
>> ERROR: modpost: drivers/net/ethernet/freescale/fec.ko: symbol 'bpf_prog_ran' undefined!
>> ERROR: modpost: drivers/net/ethernet/mediatek/mtk_eth.ko: symbol 'bpf_pred_flush_enabled' undefined!
>> ERROR: modpost: drivers/net/ethernet/mediatek/mtk_eth.ko: symbol 'bpf_prog_ran' undefined!
>> ERROR: modpost: drivers/net/team/team_mode_loadbalance.ko: symbol 'bpf_pred_flush_enabled' undefined!
>> ERROR: modpost: drivers/net/team/team_mode_loadbalance.ko: symbol 'bpf_prog_ran' undefined!
>> ERROR: modpost: net/sched/cls_bpf.ko: symbol 'bpf_pred_flush_enabled' undefined!
>> ERROR: modpost: net/sched/cls_bpf.ko: symbol 'bpf_prog_ran' undefined!
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH bpf-next 1/2] bpf: Track CPUs that have executed a BPF program
@ 2026-12-05 9:55 kernel test robot
0 siblings, 0 replies; 12+ messages in thread
From: kernel test robot @ 2026-12-05 9:55 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp
::::::
:::::: Manual check reason: "too many reports for this commit"
::::::
BCC: lkp@intel.com
CC: llvm@lists.linux.dev
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <5cf89312e3fea4409dc1fc9da6aa37b1e7a7f3b5.1796391323.git.vmalik@redhat.com>
References: <5cf89312e3fea4409dc1fc9da6aa37b1e7a7f3b5.1796391323.git.vmalik@redhat.com>
TO: Viktor Malik <vmalik@redhat.com>
TO: bpf@vger.kernel.org
CC: Alexei Starovoitov <ast@kernel.org>
CC: Daniel Borkmann <daniel@iogearbox.net>
CC: Andrii Nakryiko <andrii@kernel.org>
CC: Eduard Zingerman <eddyz87@gmail.com>
CC: Kumar Kartikeya Dwivedi <memxor@gmail.com>
CC: Martin KaFai Lau <martin.lau@linux.dev>
CC: Song Liu <song@kernel.org>
CC: Yonghong Song <yonghong.song@linux.dev>
CC: Jiri Olsa <jolsa@kernel.org>
CC: Emil Tsalapatis <emil@etsalapatis.com>
CC: Ihor Solodrai <ihor.solodrai@linux.dev>
CC: John Fastabend <john.fastabend@gmail.com>
CC: Thomas Gleixner <tglx@kernel.org>
CC: Borislav Petkov <bp@alien8.de>
CC: Peter Zijlstra <peterz@infradead.org>
CC: Josh Poimboeuf <jpoimboe@kernel.org>
CC: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
CC: Ingo Molnar <mingo@redhat.com>
CC: Dave Hansen <dave.hansen@linux.intel.com>
CC: x86@kernel.org
CC: "H. Peter Anvin" <hpa@zytor.com>
CC: Valentin Schneider <vschneid@redhat.com>
CC: Tomas Glozar <tglozar@redhat.com>
CC: Viktor Malik <vmalik@redhat.com>
Hi Viktor,
kernel test robot noticed the following build errors:
[auto build test ERROR on bpf-next/master]
[also build test ERROR on linux-review/Xu-Kuohai/bpf-Invalidate-freed-prog-pack-memory-without-holding-pack_mutex/20261203-140921 next-20261203]
[cannot apply to bpf/master tip/x86/core linus/master v7.4-rc5]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Viktor-Malik/bpf-Track-CPUs-that-have-executed-a-BPF-program/20261204-144401
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link: https://lore.kernel.org/r/5cf89312e3fea4409dc1fc9da6aa37b1e7a7f3b5.1796391323.git.vmalik%40redhat.com
patch subject: [PATCH bpf-next 1/2] bpf: Track CPUs that have executed a BPF program
:::::: branch date: 10 hours ago
:::::: commit date: 10 hours ago
config: sparc64-defconfig (https://download.01.org/0day-ci/archive/20261205/20261205073055.qJNZEdix-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 63b30c97f6082ebf34b31bdd81bb50df7672b67b)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261205/20261205073055.qJNZEdix-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/20261205073055.qJNZEdix-lkp@intel.com/
All errors (new ones prefixed by >>, old ones prefixed by <<):
>> ERROR: modpost: drivers/net/ppp/ppp_generic.ko: symbol 'bpf_pred_flush_enabled' undefined!
>> ERROR: modpost: drivers/net/ppp/ppp_generic.ko: symbol 'bpf_prog_ran' undefined!
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH bpf-next 1/2] bpf: Track CPUs that have executed a BPF program
@ 2026-12-05 9:55 kernel test robot
0 siblings, 0 replies; 12+ messages in thread
From: kernel test robot @ 2026-12-05 9:55 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp
::::::
:::::: Manual check reason: "too many reports for this commit"
::::::
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <5cf89312e3fea4409dc1fc9da6aa37b1e7a7f3b5.1796391323.git.vmalik@redhat.com>
References: <5cf89312e3fea4409dc1fc9da6aa37b1e7a7f3b5.1796391323.git.vmalik@redhat.com>
TO: Viktor Malik <vmalik@redhat.com>
TO: bpf@vger.kernel.org
CC: Alexei Starovoitov <ast@kernel.org>
CC: Daniel Borkmann <daniel@iogearbox.net>
CC: Andrii Nakryiko <andrii@kernel.org>
CC: Eduard Zingerman <eddyz87@gmail.com>
CC: Kumar Kartikeya Dwivedi <memxor@gmail.com>
CC: Martin KaFai Lau <martin.lau@linux.dev>
CC: Song Liu <song@kernel.org>
CC: Yonghong Song <yonghong.song@linux.dev>
CC: Jiri Olsa <jolsa@kernel.org>
CC: Emil Tsalapatis <emil@etsalapatis.com>
CC: Ihor Solodrai <ihor.solodrai@linux.dev>
CC: John Fastabend <john.fastabend@gmail.com>
CC: Thomas Gleixner <tglx@kernel.org>
CC: Borislav Petkov <bp@alien8.de>
CC: Peter Zijlstra <peterz@infradead.org>
CC: Josh Poimboeuf <jpoimboe@kernel.org>
CC: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
CC: Ingo Molnar <mingo@redhat.com>
CC: Dave Hansen <dave.hansen@linux.intel.com>
CC: x86@kernel.org
CC: "H. Peter Anvin" <hpa@zytor.com>
CC: Valentin Schneider <vschneid@redhat.com>
CC: Tomas Glozar <tglozar@redhat.com>
CC: Viktor Malik <vmalik@redhat.com>
Hi Viktor,
kernel test robot noticed the following build errors:
[auto build test ERROR on bpf-next/master]
[also build test ERROR on linux-review/Xu-Kuohai/bpf-Invalidate-freed-prog-pack-memory-without-holding-pack_mutex/20261203-140921 next-20261203]
[cannot apply to bpf/master tip/x86/core linus/master v7.4-rc5]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Viktor-Malik/bpf-Track-CPUs-that-have-executed-a-BPF-program/20261204-144401
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link: https://lore.kernel.org/r/5cf89312e3fea4409dc1fc9da6aa37b1e7a7f3b5.1796391323.git.vmalik%40redhat.com
patch subject: [PATCH bpf-next 1/2] bpf: Track CPUs that have executed a BPF program
:::::: branch date: 10 hours ago
:::::: commit date: 10 hours ago
config: i386-randconfig-1000-20261204 (https://download.01.org/0day-ci/archive/20261205/20261205072951.hlxr7yKH-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.4.0-5) 12.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261205/20261205072951.hlxr7yKH-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/20261205072951.hlxr7yKH-lkp@intel.com/
All errors (new ones prefixed by >>, old ones prefixed by <<):
>> ERROR: modpost: drivers/net/virtio_net.ko: symbol 'bpf_pred_flush_enabled' undefined!
>> ERROR: modpost: drivers/net/virtio_net.ko: symbol 'bpf_prog_ran' undefined!
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH bpf-next 1/2] bpf: Track CPUs that have executed a BPF program
@ 2026-12-05 9:55 kernel test robot
0 siblings, 0 replies; 12+ messages in thread
From: kernel test robot @ 2026-12-05 9:55 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp
::::::
:::::: Manual check reason: "too many reports for this commit"
::::::
BCC: lkp@intel.com
CC: llvm@lists.linux.dev
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <5cf89312e3fea4409dc1fc9da6aa37b1e7a7f3b5.1796391323.git.vmalik@redhat.com>
References: <5cf89312e3fea4409dc1fc9da6aa37b1e7a7f3b5.1796391323.git.vmalik@redhat.com>
TO: Viktor Malik <vmalik@redhat.com>
TO: bpf@vger.kernel.org
CC: Alexei Starovoitov <ast@kernel.org>
CC: Daniel Borkmann <daniel@iogearbox.net>
CC: Andrii Nakryiko <andrii@kernel.org>
CC: Eduard Zingerman <eddyz87@gmail.com>
CC: Kumar Kartikeya Dwivedi <memxor@gmail.com>
CC: Martin KaFai Lau <martin.lau@linux.dev>
CC: Song Liu <song@kernel.org>
CC: Yonghong Song <yonghong.song@linux.dev>
CC: Jiri Olsa <jolsa@kernel.org>
CC: Emil Tsalapatis <emil@etsalapatis.com>
CC: Ihor Solodrai <ihor.solodrai@linux.dev>
CC: John Fastabend <john.fastabend@gmail.com>
CC: Thomas Gleixner <tglx@kernel.org>
CC: Borislav Petkov <bp@alien8.de>
CC: Peter Zijlstra <peterz@infradead.org>
CC: Josh Poimboeuf <jpoimboe@kernel.org>
CC: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
CC: Ingo Molnar <mingo@redhat.com>
CC: Dave Hansen <dave.hansen@linux.intel.com>
CC: x86@kernel.org
CC: "H. Peter Anvin" <hpa@zytor.com>
CC: Valentin Schneider <vschneid@redhat.com>
CC: Tomas Glozar <tglozar@redhat.com>
CC: Viktor Malik <vmalik@redhat.com>
Hi Viktor,
kernel test robot noticed the following build errors:
[auto build test ERROR on bpf-next/master]
[also build test ERROR on linux-review/Xu-Kuohai/bpf-Invalidate-freed-prog-pack-memory-without-holding-pack_mutex/20261203-140921 next-20261203]
[cannot apply to bpf/master tip/x86/core linus/master v7.4-rc5]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Viktor-Malik/bpf-Track-CPUs-that-have-executed-a-BPF-program/20261204-144401
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link: https://lore.kernel.org/r/5cf89312e3fea4409dc1fc9da6aa37b1e7a7f3b5.1796391323.git.vmalik%40redhat.com
patch subject: [PATCH bpf-next 1/2] bpf: Track CPUs that have executed a BPF program
:::::: branch date: 9 hours ago
:::::: commit date: 9 hours ago
config: um-defconfig (https://download.01.org/0day-ci/archive/20261205/20261205063005.WWNb6AQm-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 63b30c97f6082ebf34b31bdd81bb50df7672b67b)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261205/20261205063005.WWNb6AQm-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/20261205063005.WWNb6AQm-lkp@intel.com/
All errors (new ones prefixed by >>, old ones prefixed by <<):
>> ERROR: modpost: drivers/net/tun.ko: symbol 'bpf_pred_flush_enabled' undefined!
>> ERROR: modpost: drivers/net/tun.ko: symbol 'bpf_prog_ran' undefined!
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH bpf-next 1/2] bpf: Track CPUs that have executed a BPF program
@ 2026-12-05 9:55 kernel test robot
0 siblings, 0 replies; 12+ messages in thread
From: kernel test robot @ 2026-12-05 9:55 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp
::::::
:::::: Manual check reason: "too many reports for this commit"
::::::
BCC: lkp@intel.com
CC: llvm@lists.linux.dev
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <5cf89312e3fea4409dc1fc9da6aa37b1e7a7f3b5.1796391323.git.vmalik@redhat.com>
References: <5cf89312e3fea4409dc1fc9da6aa37b1e7a7f3b5.1796391323.git.vmalik@redhat.com>
TO: Viktor Malik <vmalik@redhat.com>
TO: bpf@vger.kernel.org
CC: Alexei Starovoitov <ast@kernel.org>
CC: Daniel Borkmann <daniel@iogearbox.net>
CC: Andrii Nakryiko <andrii@kernel.org>
CC: Eduard Zingerman <eddyz87@gmail.com>
CC: Kumar Kartikeya Dwivedi <memxor@gmail.com>
CC: Martin KaFai Lau <martin.lau@linux.dev>
CC: Song Liu <song@kernel.org>
CC: Yonghong Song <yonghong.song@linux.dev>
CC: Jiri Olsa <jolsa@kernel.org>
CC: Emil Tsalapatis <emil@etsalapatis.com>
CC: Ihor Solodrai <ihor.solodrai@linux.dev>
CC: John Fastabend <john.fastabend@gmail.com>
CC: Thomas Gleixner <tglx@kernel.org>
CC: Borislav Petkov <bp@alien8.de>
CC: Peter Zijlstra <peterz@infradead.org>
CC: Josh Poimboeuf <jpoimboe@kernel.org>
CC: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
CC: Ingo Molnar <mingo@redhat.com>
CC: Dave Hansen <dave.hansen@linux.intel.com>
CC: x86@kernel.org
CC: "H. Peter Anvin" <hpa@zytor.com>
CC: Valentin Schneider <vschneid@redhat.com>
CC: Tomas Glozar <tglozar@redhat.com>
CC: Viktor Malik <vmalik@redhat.com>
Hi Viktor,
kernel test robot noticed the following build errors:
[auto build test ERROR on bpf-next/master]
[also build test ERROR on linux-review/Xu-Kuohai/bpf-Invalidate-freed-prog-pack-memory-without-holding-pack_mutex/20261203-140921 next-20261203]
[cannot apply to bpf/master tip/x86/core linus/master v7.4-rc5]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Viktor-Malik/bpf-Track-CPUs-that-have-executed-a-BPF-program/20261204-144401
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link: https://lore.kernel.org/r/5cf89312e3fea4409dc1fc9da6aa37b1e7a7f3b5.1796391323.git.vmalik%40redhat.com
patch subject: [PATCH bpf-next 1/2] bpf: Track CPUs that have executed a BPF program
:::::: branch date: 6 hours ago
:::::: commit date: 6 hours ago
config: mips-ath25_defconfig (https://download.01.org/0day-ci/archive/20261205/20261205035845.BGvjUosK-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 63b30c97f6082ebf34b31bdd81bb50df7672b67b)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261205/20261205035845.BGvjUosK-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/20261205035845.BGvjUosK-lkp@intel.com/
All errors (new ones prefixed by >>):
>> ld.lld: error: undefined symbol: bpf_pred_flush_enabled
>>> referenced by bpf_filter.c
>>> io_uring/bpf_filter.o:(__io_uring_run_bpf_filters) in archive vmlinux.a
>>> referenced by bpf_filter.c
>>> io_uring/bpf_filter.o:(__io_uring_run_bpf_filters) in archive vmlinux.a
>>> referenced by flow_dissector.c
>>> net/core/flow_dissector.o:(bpf_flow_dissect) in archive vmlinux.a
>>> referenced 13 more times
--
>> ld.lld: error: undefined symbol: bpf_prog_ran
>>> referenced by bpf_filter.c
>>> io_uring/bpf_filter.o:(__io_uring_run_bpf_filters) in archive vmlinux.a
>>> referenced by bpf_filter.c
>>> io_uring/bpf_filter.o:(__io_uring_run_bpf_filters) in archive vmlinux.a
>>> referenced by bpf_filter.c
>>> io_uring/bpf_filter.o:(__io_uring_run_bpf_filters) in archive vmlinux.a
>>> referenced 23 more times
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH bpf-next 0/2] bpf, x86: Restrict BPF JIT IBPB flush to CPUs that ran BPF
@ 2026-12-04 13:44 Viktor Malik
2026-12-04 13:44 ` [PATCH bpf-next 1/2] bpf: Track CPUs that have executed a BPF program Viktor Malik
0 siblings, 1 reply; 12+ messages in thread
From: Viktor Malik @ 2026-12-04 13:44 UTC (permalink / raw)
To: bpf
Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Eduard Zingerman, Kumar Kartikeya Dwivedi, Martin KaFai Lau,
Song Liu, Yonghong Song, Jiri Olsa, Emil Tsalapatis,
Ihor Solodrai, John Fastabend, Thomas Gleixner, Borislav Petkov,
Peter Zijlstra, Josh Poimboeuf, Pawan Gupta, Ingo Molnar,
Dave Hansen, x86, H. Peter Anvin, Valentin Schneider,
Tomas Glozar, Viktor Malik
Hi,
we have recently started observing latency spikes on systems with
isolated CPUs when classic BPF programs were running in the background
(e.g. executed by NetworkManager or seccomp). The latencies are caused
by the BPF JIT-spraying mitigation introduced by commit 96cce16e26dd
("bpf: Support for hardening against JIT spraying") and its follow-ups.
The reason is that the IBPB flush is currently broadcast to every online
CPU, including the isolated ones that never run BPF programs.
While recent changes [1] have significantly decreased the frequency of
the IBPB flushes, they haven't eliminated them completely, which still
poses a serious problem for latency-sensitive workloads.
This patch series implement one of the ideas from a9b1f19a6a67 ("bpf:
Prefer packs that won't trigger an IBPB flush on allocation") and
introduce a mechanism to completely avoid the IBPB flushes on CPUs that
have not run any BPF program since the last flush. This is sound because
the original Spectre-v2 vulnerability is only exploitable if a cBPF
program runs on a CPU that previously ran any BPF program (and therefore
can reuse the branch predictors trained on the previous program).
Patch #1 introduces a new per-cpu flag bpf_prog_ran, which records that
a CPU executed any BPF program, and patch #2 restricts the IBPB flushes
on x86 to CPUs that have the flag set. This way, the isolated CPUs that
never run any BPF programs do not receive the unnecessary flushes.
[1] https://lore.kernel.org/bpf/cover.1796304466.git.xukuohai@huawei.com/
Viktor Malik (2):
bpf: Track CPUs that have executed a BPF program
x86/bugs: Restrict BPF JIT IBPB flush to CPUs that ran BPF
arch/x86/kernel/cpu/bugs.c | 8 +++++++-
include/linux/filter.h | 27 ++++++++++++++++++++++++++-
kernel/bpf/core.c | 8 ++++++++
kernel/bpf/trampoline.c | 5 +++++
4 files changed, 46 insertions(+), 2 deletions(-)
--
2.56.1
^ permalink raw reply [flat|nested] 12+ messages in thread* [PATCH bpf-next 1/2] bpf: Track CPUs that have executed a BPF program
2026-12-04 13:44 [PATCH bpf-next 0/2] bpf, x86: Restrict BPF JIT IBPB flush to CPUs that ran BPF Viktor Malik
@ 2026-12-04 13:44 ` Viktor Malik
2026-12-04 14:03 ` sashiko-bot
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: Viktor Malik @ 2026-12-04 13:44 UTC (permalink / raw)
To: bpf
Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Eduard Zingerman, Kumar Kartikeya Dwivedi, Martin KaFai Lau,
Song Liu, Yonghong Song, Jiri Olsa, Emil Tsalapatis,
Ihor Solodrai, John Fastabend, Thomas Gleixner, Borislav Petkov,
Peter Zijlstra, Josh Poimboeuf, Pawan Gupta, Ingo Molnar,
Dave Hansen, x86, H. Peter Anvin, Valentin Schneider,
Tomas Glozar, Viktor Malik
The BPF JIT-spraying mitigation introduced by commit 96cce16e26dd ("bpf:
Support for hardening against JIT spraying") and follow-ups flushes the
indirect branch predictors (IBPB on x86, via bpf_arch_pred_flush()) when
cBPF JIT memory is reused, to drop stale predictions trained by code
that previously occupied that memory. The flush is currently broadcast
to every online CPU with on_each_cpu(). On systems with isolated CPUs
running latency-sensitive workloads this is a serious regression: an
unprivileged cBPF load/free forces an IPI and an IBPB onto CPUs that
never run BPF, stealing time and wiping their branch predictors.
A flush is only ever needed on a CPU that has actually executed JITed
BPF code since the last flush - that is the only way a stale prediction
for a reused JIT chunk can exist there. Introduce a per-CPU flag,
bpf_prog_ran, recording that the CPU has executed a BPF program, so that
arch code can later target the flush at exactly those CPUs instead of
all of them.
The flag is set for any BPF program, not just cBPF: the flush is
triggered by a cBPF allocation, but the stale prediction being dropped
may have been trained by whatever previously occupied the reused chunk,
including an eBPF program.
The flag is set after the program executes (in __bpf_prog_run() and in
the trampoline exit helpers), so that a flush racing with the program
cannot clear the flag while predictions trained by that program are
still live. The mechanism is gated behind the bpf_pred_flush_enabled
static key, so there is no cost unless the mitigation is active.
This commit only introduces the flag; the x86 flush starts consuming it
in a follow-up change.
Signed-off-by: Viktor Malik <vmalik@redhat.com>
---
include/linux/filter.h | 27 ++++++++++++++++++++++++++-
kernel/bpf/core.c | 8 ++++++++
kernel/bpf/trampoline.c | 5 +++++
3 files changed, 39 insertions(+), 1 deletion(-)
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 275c89ed7574..cb408ddbca2f 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -873,6 +873,31 @@ typedef unsigned int (*bpf_dispatcher_fn)(const void *ctx,
unsigned int (*bpf_func)(const void *,
const struct bpf_insn *));
+DECLARE_STATIC_KEY_FALSE(bpf_pred_flush_enabled);
+DECLARE_PER_CPU(bool, bpf_prog_ran);
+
+/*
+ * When BPF JIT-spraying mitigation is in place, record, on the current CPU,
+ * that a JITed BPF program has just executed.
+ *
+ * The mitigation flushes the indirect branch predictors (IBPB on x86) when cBPF
+ * JIT memory is reused, to drop stale predictions from the code that previously
+ * occupied that memory. That flush is only ever needed on CPUs that have
+ * actually executed BPF since the last flush, so arch code consults this flag
+ * to target those CPUs.
+ */
+static __always_inline void bpf_prog_mark_ran(void)
+{
+ bool *ran;
+
+ if (!static_branch_unlikely(&bpf_pred_flush_enabled))
+ return;
+
+ ran = raw_cpu_ptr(&bpf_prog_ran);
+ if (!READ_ONCE(*ran))
+ WRITE_ONCE(*ran, true);
+}
+
static __always_inline u32 __bpf_prog_run(const struct bpf_prog *prog,
const void *ctx,
bpf_dispatcher_fn dfunc)
@@ -898,6 +923,7 @@ static __always_inline u32 __bpf_prog_run(const struct bpf_prog *prog,
} else {
ret = dfunc(ctx, prog->insnsi, prog->bpf_func);
}
+ bpf_prog_mark_ran();
return ret;
}
@@ -1598,7 +1624,6 @@ typedef void (*bpf_jit_fill_hole_t)(void *area, unsigned int size);
*/
void bpf_arch_pred_flush(void);
DECLARE_STATIC_CALL(bpf_arch_pred_flush, bpf_arch_pred_flush);
-DECLARE_STATIC_KEY_FALSE(bpf_pred_flush_enabled);
void bpf_jit_fill_hole_with_zero(void *area, unsigned int size);
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index 143fa134fea5..d7f0aa01029f 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -1204,6 +1204,14 @@ DEFINE_STATIC_CALL_NULL(bpf_arch_pred_flush, bpf_arch_pred_flush);
* static branch instead of repeatedly querying the static call target.
*/
DEFINE_STATIC_KEY_FALSE(bpf_pred_flush_enabled);
+EXPORT_SYMBOL(bpf_pred_flush_enabled);
+
+/*
+ * Set on a CPU once it has executed a JITed BPF program since the last
+ * predictor flush; see bpf_prog_mark_ran() and bpf_arch_pred_flush().
+ */
+DEFINE_PER_CPU(bool, bpf_prog_ran);
+EXPORT_PER_CPU_SYMBOL(bpf_prog_ran);
#define BPF_PROG_SIZE_TO_NBITS(size) (round_up(size, BPF_PROG_CHUNK_SIZE) / BPF_PROG_CHUNK_SIZE)
diff --git a/kernel/bpf/trampoline.c b/kernel/bpf/trampoline.c
index 619297eae8c1..43c1b2fb8839 100644
--- a/kernel/bpf/trampoline.c
+++ b/kernel/bpf/trampoline.c
@@ -1382,6 +1382,7 @@ static void notrace __bpf_prog_exit_recur(struct bpf_prog *prog, u64 start,
struct bpf_tramp_run_ctx *run_ctx)
__releases(RCU)
{
+ bpf_prog_mark_ran();
/* Before the exit, which can enable preemption: time off the CPU is not run time */
update_prog_stats(prog, start);
bpf_prog_exit_run_ctx(prog, &run_ctx->run_ctx);
@@ -1406,6 +1407,7 @@ static void notrace __bpf_prog_exit_lsm_cgroup(struct bpf_prog *prog, u64 start,
struct bpf_tramp_run_ctx *run_ctx)
__releases(RCU)
{
+ bpf_prog_mark_ran();
bpf_reset_run_ctx(run_ctx->run_ctx.saved_run_ctx);
rcu_read_unlock_migrate();
@@ -1430,6 +1432,7 @@ u64 notrace __bpf_prog_enter_sleepable_recur(struct bpf_prog *prog,
void notrace __bpf_prog_exit_sleepable_recur(struct bpf_prog *prog, u64 start,
struct bpf_tramp_run_ctx *run_ctx)
{
+ bpf_prog_mark_ran();
update_prog_stats(prog, start);
bpf_prog_exit_run_ctx(prog, &run_ctx->run_ctx);
migrate_enable();
@@ -1451,6 +1454,7 @@ static u64 notrace __bpf_prog_enter_sleepable(struct bpf_prog *prog,
static void notrace __bpf_prog_exit_sleepable(struct bpf_prog *prog, u64 start,
struct bpf_tramp_run_ctx *run_ctx)
{
+ bpf_prog_mark_ran();
bpf_reset_run_ctx(run_ctx->run_ctx.saved_run_ctx);
update_prog_stats(prog, start);
@@ -1473,6 +1477,7 @@ static void notrace __bpf_prog_exit(struct bpf_prog *prog, u64 start,
struct bpf_tramp_run_ctx *run_ctx)
__releases(RCU)
{
+ bpf_prog_mark_ran();
bpf_reset_run_ctx(run_ctx->run_ctx.saved_run_ctx);
update_prog_stats(prog, start);
--
2.56.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH bpf-next 1/2] bpf: Track CPUs that have executed a BPF program
2026-12-04 13:44 ` [PATCH bpf-next 1/2] bpf: Track CPUs that have executed a BPF program Viktor Malik
@ 2026-12-04 14:03 ` sashiko-bot
2026-12-04 15:22 ` Viktor Malik
2026-12-04 14:51 ` Valentin Schneider
` (2 subsequent siblings)
3 siblings, 1 reply; 12+ messages in thread
From: sashiko-bot @ 2026-12-04 14:03 UTC (permalink / raw)
To: Viktor Malik, bpf
Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [High] bpf: link failure under CONFIG_BPF_JIT=n in bpf_prog_mark_ran()
- [Medium] bpf: missing bpf_prog_mark_ran() in bpf_run_async_cb()
- [Low] bpf: untracked bpf_prog_pack trampoline execution bypassing
__bpf_prog_exit*()
--
commit a794f32a47f5dda2a5c528bf869f1bd4c8182a6e
Author: Viktor Malik <vmalik@redhat.com>
bpf: Track CPUs that have executed a BPF program
This commit introduces a per-CPU bpf_prog_ran flag, gated behind the
bpf_pred_flush_enabled static key, and sets it in __bpf_prog_run() and
the trampoline exit helpers so arch code can restrict indirect branch
predictor flushes to CPUs that have executed BPF code.
> diff --git a/include/linux/filter.h b/include/linux/filter.h
> index 275c89ed7574a..cb408ddbca2f0 100644
> --- a/include/linux/filter.h
> +++ b/include/linux/filter.h
> @@ -873,6 +873,31 @@ typedef unsigned int (*bpf_dispatcher_fn)(const void *ctx,
> unsigned int (*bpf_func)(const void *,
> const struct bpf_insn *));
>
> +DECLARE_STATIC_KEY_FALSE(bpf_pred_flush_enabled);
> +DECLARE_PER_CPU(bool, bpf_prog_ran);
> +
> +/*
> + * When BPF JIT-spraying mitigation is in place, record, on the current CPU,
> + * that a JITed BPF program has just executed.
> + *
> + * The mitigation flushes the indirect branch predictors (IBPB on x86) when cBPF
> + * JIT memory is reused, to drop stale predictions from the code that previously
> + * occupied that memory. That flush is only ever needed on CPUs that have
> + * actually executed BPF since the last flush, so arch code consults this flag
> + * to target those CPUs.
> + */
> +static __always_inline void bpf_prog_mark_ran(void)
> +{
> + bool *ran;
> +
> + if (!static_branch_unlikely(&bpf_pred_flush_enabled))
> + return;
> +
> + ran = raw_cpu_ptr(&bpf_prog_ran);
> + if (!READ_ONCE(*ran))
> + WRITE_ONCE(*ran, true);
> +}
[Severity: High]
Does this break linking when CONFIG_BPF=y and CONFIG_BPF_JIT=n?
bpf_pred_flush_enabled and bpf_prog_ran are declared and referenced
unconditionally here, but both definitions and exports in kernel/bpf/core.c
sit inside #ifdef CONFIG_BPF_JIT. Any interpreter-only build with callers
of __bpf_prog_run(), such as seccomp_run_filters(), will fail vmlinux link
and module modpost with undefined references to both symbols.
Guarding the declarations and bpf_prog_mark_ran() with #ifdef CONFIG_BPF_JIT
and providing an empty stub otherwise fixes the build and avoids emitting a
dead static branch when JIT is disabled.
[ ... ]
> @@ -898,6 +923,7 @@ static __always_inline u32 __bpf_prog_run(const struct bpf_prog *prog,
> } else {
> ret = dfunc(ctx, prog->insnsi, prog->bpf_func);
> }
> + bpf_prog_mark_ran();
> return ret;
> }
[Severity: Medium]
Should bpf_run_async_cb() in kernel/bpf/helpers.c also call
bpf_prog_mark_ran()?
Async BPF callbacks (such as bpf_timer_cb() and bpf_wq_work()) invoke JITed
subprograms allocated from bpf_prog_pack directly via callback_fn(),
bypassing __bpf_prog_run() and the trampoline exit helpers.
A CPU that runs one while bpf_prog_ran is false is skipped by a later
targeted flush when those bpf_prog_pack chunks are reused by cBPF, leaving
stale indirect branch predictions live.
All callers of bpf_run_async_cb() already run with migration disabled, so
calling bpf_prog_mark_ran() after callback_fn() there closes this gap.
[ ... ]
> diff --git a/kernel/bpf/trampoline.c b/kernel/bpf/trampoline.c
> index 619297eae8c15..43c1b2fb88399 100644
> --- a/kernel/bpf/trampoline.c
> +++ b/kernel/bpf/trampoline.c
> @@ -1382,6 +1382,7 @@ static void notrace __bpf_prog_exit_recur(struct bpf_prog *prog, u64 start,
> struct bpf_tramp_run_ctx *run_ctx)
> __releases(RCU)
> {
> + bpf_prog_mark_ran();
> /* Before the exit, which can enable preemption: time off the CPU is not run time */
> update_prog_stats(prog, start);
> bpf_prog_exit_run_ctx(prog, &run_ctx->run_ctx);
[Severity: Low]
Can a CPU execute JITed trampoline code from bpf_prog_pack without setting
bpf_prog_ran?
On x86-64, arch_alloc_bpf_trampoline() allocates trampolines from
bpf_prog_pack, and under BPF_TRAMP_F_ORIG_STACK the trampoline runs an
indirect call *rbx there with migration enabled.
In an fexit-only trampoline, a task can run call *rbx on CPU0, sleep in the
original function, and migrate to CPU1 where __bpf_prog_exit*() runs,
leaving bpf_prog_ran false on CPU0. The same happens through
__bpf_tramp_exit() or during skip patching in __bpf_trampoline_unlink_prog().
If the trampoline image is later freed and reused by a cBPF allocation, a
targeted predictor flush would skip that CPU.
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1796391323.git.vmalik@redhat.com?part=1
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH bpf-next 1/2] bpf: Track CPUs that have executed a BPF program
2026-12-04 14:03 ` sashiko-bot
@ 2026-12-04 15:22 ` Viktor Malik
0 siblings, 0 replies; 12+ messages in thread
From: Viktor Malik @ 2026-12-04 15:22 UTC (permalink / raw)
To: sashiko-reviews, bpf
On 12/4/26 15:03, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 3 potential
> issues to consider:
> - [High] bpf: link failure under CONFIG_BPF_JIT=n in bpf_prog_mark_ran()
> - [Medium] bpf: missing bpf_prog_mark_ran() in bpf_run_async_cb()
> - [Low] bpf: untracked bpf_prog_pack trampoline execution bypassing
> __bpf_prog_exit*()
> --
>
> commit a794f32a47f5dda2a5c528bf869f1bd4c8182a6e
> Author: Viktor Malik <vmalik@redhat.com>
>
> bpf: Track CPUs that have executed a BPF program
>
> This commit introduces a per-CPU bpf_prog_ran flag, gated behind the
> bpf_pred_flush_enabled static key, and sets it in __bpf_prog_run() and
> the trampoline exit helpers so arch code can restrict indirect branch
> predictor flushes to CPUs that have executed BPF code.
>
>> diff --git a/include/linux/filter.h b/include/linux/filter.h
>> index 275c89ed7574a..cb408ddbca2f0 100644
>> --- a/include/linux/filter.h
>> +++ b/include/linux/filter.h
>> @@ -873,6 +873,31 @@ typedef unsigned int (*bpf_dispatcher_fn)(const void *ctx,
>> unsigned int (*bpf_func)(const void *,
>> const struct bpf_insn *));
>>
>> +DECLARE_STATIC_KEY_FALSE(bpf_pred_flush_enabled);
>> +DECLARE_PER_CPU(bool, bpf_prog_ran);
>> +
>> +/*
>> + * When BPF JIT-spraying mitigation is in place, record, on the current CPU,
>> + * that a JITed BPF program has just executed.
>> + *
>> + * The mitigation flushes the indirect branch predictors (IBPB on x86) when cBPF
>> + * JIT memory is reused, to drop stale predictions from the code that previously
>> + * occupied that memory. That flush is only ever needed on CPUs that have
>> + * actually executed BPF since the last flush, so arch code consults this flag
>> + * to target those CPUs.
>> + */
>> +static __always_inline void bpf_prog_mark_ran(void)
>> +{
>> + bool *ran;
>> +
>> + if (!static_branch_unlikely(&bpf_pred_flush_enabled))
>> + return;
>> +
>> + ran = raw_cpu_ptr(&bpf_prog_ran);
>> + if (!READ_ONCE(*ran))
>> + WRITE_ONCE(*ran, true);
>> +}
>
> [Severity: High]
> Does this break linking when CONFIG_BPF=y and CONFIG_BPF_JIT=n?
>
> bpf_pred_flush_enabled and bpf_prog_ran are declared and referenced
> unconditionally here, but both definitions and exports in kernel/bpf/core.c
> sit inside #ifdef CONFIG_BPF_JIT. Any interpreter-only build with callers
> of __bpf_prog_run(), such as seccomp_run_filters(), will fail vmlinux link
> and module modpost with undefined references to both symbols.
>
> Guarding the declarations and bpf_prog_mark_ran() with #ifdef CONFIG_BPF_JIT
> and providing an empty stub otherwise fixes the build and avoids emitting a
> dead static branch when JIT is disabled.
Good catch, will add guards and an empty stub for the !CONFIG_BPF_JIT case.
>
> [ ... ]
>
>> @@ -898,6 +923,7 @@ static __always_inline u32 __bpf_prog_run(const struct bpf_prog *prog,
>> } else {
>> ret = dfunc(ctx, prog->insnsi, prog->bpf_func);
>> }
>> + bpf_prog_mark_ran();
>> return ret;
>> }
>
> [Severity: Medium]
> Should bpf_run_async_cb() in kernel/bpf/helpers.c also call
> bpf_prog_mark_ran()?
>
> Async BPF callbacks (such as bpf_timer_cb() and bpf_wq_work()) invoke JITed
> subprograms allocated from bpf_prog_pack directly via callback_fn(),
> bypassing __bpf_prog_run() and the trampoline exit helpers.
>
> A CPU that runs one while bpf_prog_ran is false is skipped by a later
> targeted flush when those bpf_prog_pack chunks are reused by cBPF, leaving
> stale indirect branch predictions live.
>
> All callers of bpf_run_async_cb() already run with migration disabled, so
> calling bpf_prog_mark_ran() after callback_fn() there closes this gap.
Good suggestion, will apply.
>
> [ ... ]
>
>> diff --git a/kernel/bpf/trampoline.c b/kernel/bpf/trampoline.c
>> index 619297eae8c15..43c1b2fb88399 100644
>> --- a/kernel/bpf/trampoline.c
>> +++ b/kernel/bpf/trampoline.c
>> @@ -1382,6 +1382,7 @@ static void notrace __bpf_prog_exit_recur(struct bpf_prog *prog, u64 start,
>> struct bpf_tramp_run_ctx *run_ctx)
>> __releases(RCU)
>> {
>> + bpf_prog_mark_ran();
>> /* Before the exit, which can enable preemption: time off the CPU is not run time */
>> update_prog_stats(prog, start);
>> bpf_prog_exit_run_ctx(prog, &run_ctx->run_ctx);
>
> [Severity: Low]
> Can a CPU execute JITed trampoline code from bpf_prog_pack without setting
> bpf_prog_ran?
>
> On x86-64, arch_alloc_bpf_trampoline() allocates trampolines from
> bpf_prog_pack, and under BPF_TRAMP_F_ORIG_STACK the trampoline runs an
> indirect call *rbx there with migration enabled.
>
> In an fexit-only trampoline, a task can run call *rbx on CPU0, sleep in the
> original function, and migrate to CPU1 where __bpf_prog_exit*() runs,
> leaving bpf_prog_ran false on CPU0. The same happens through
> __bpf_tramp_exit() or during skip patching in __bpf_trampoline_unlink_prog().
>
> If the trampoline image is later freed and reused by a cBPF allocation, a
> targeted predictor flush would skip that CPU.
IIUC, this should be resolvable by adding bpf_prog_mark_ran() to both
__bpf_tramp_enter() (to cover CPU0) and __bpf_tramp_exit() (to cover CPU1).
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH bpf-next 1/2] bpf: Track CPUs that have executed a BPF program
2026-12-04 13:44 ` [PATCH bpf-next 1/2] bpf: Track CPUs that have executed a BPF program Viktor Malik
2026-12-04 14:03 ` sashiko-bot
@ 2026-12-04 14:51 ` Valentin Schneider
2026-12-04 16:27 ` Dave Hansen
2026-12-05 9:55 ` kernel test robot
3 siblings, 0 replies; 12+ messages in thread
From: Valentin Schneider @ 2026-12-04 14:51 UTC (permalink / raw)
To: Viktor Malik, bpf
Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Eduard Zingerman, Kumar Kartikeya Dwivedi, Martin KaFai Lau,
Song Liu, Yonghong Song, Jiri Olsa, Emil Tsalapatis,
Ihor Solodrai, John Fastabend, Thomas Gleixner, Borislav Petkov,
Peter Zijlstra, Josh Poimboeuf, Pawan Gupta, Ingo Molnar,
Dave Hansen, x86, H. Peter Anvin, Tomas Glozar, Viktor Malik
On 04/12/26 14:44, Viktor Malik wrote:
> The BPF JIT-spraying mitigation introduced by commit 96cce16e26dd ("bpf:
> Support for hardening against JIT spraying") and follow-ups flushes the
> indirect branch predictors (IBPB on x86, via bpf_arch_pred_flush()) when
> cBPF JIT memory is reused, to drop stale predictions trained by code
> that previously occupied that memory. The flush is currently broadcast
> to every online CPU with on_each_cpu(). On systems with isolated CPUs
> running latency-sensitive workloads this is a serious regression: an
> unprivileged cBPF load/free forces an IPI and an IBPB onto CPUs that
> never run BPF, stealing time and wiping their branch predictors.
>
> A flush is only ever needed on a CPU that has actually executed JITed
> BPF code since the last flush - that is the only way a stale prediction
> for a reused JIT chunk can exist there. Introduce a per-CPU flag,
> bpf_prog_ran, recording that the CPU has executed a BPF program, so that
> arch code can later target the flush at exactly those CPUs instead of
> all of them.
>
> The flag is set for any BPF program, not just cBPF: the flush is
> triggered by a cBPF allocation, but the stale prediction being dropped
> may have been trained by whatever previously occupied the reused chunk,
> including an eBPF program.
>
> The flag is set after the program executes (in __bpf_prog_run() and in
> the trampoline exit helpers), so that a flush racing with the program
> cannot clear the flag while predictions trained by that program are
> still live. The mechanism is gated behind the bpf_pred_flush_enabled
> static key, so there is no cost unless the mitigation is active.
>
> This commit only introduces the flag; the x86 flush starts consuming it
> in a follow-up change.
>
> Signed-off-by: Viktor Malik <vmalik@redhat.com>
Reviewed-by: Valentin Schneider <vschneid@redhat.com>
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH bpf-next 1/2] bpf: Track CPUs that have executed a BPF program
2026-12-04 13:44 ` [PATCH bpf-next 1/2] bpf: Track CPUs that have executed a BPF program Viktor Malik
2026-12-04 14:03 ` sashiko-bot
2026-12-04 14:51 ` Valentin Schneider
@ 2026-12-04 16:27 ` Dave Hansen
2026-12-04 16:45 ` Viktor Malik
2026-12-05 9:55 ` kernel test robot
3 siblings, 1 reply; 12+ messages in thread
From: Dave Hansen @ 2026-12-04 16:27 UTC (permalink / raw)
To: Viktor Malik, bpf
Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Eduard Zingerman, Kumar Kartikeya Dwivedi, Martin KaFai Lau,
Song Liu, Yonghong Song, Jiri Olsa, Emil Tsalapatis,
Ihor Solodrai, John Fastabend, Thomas Gleixner, Borislav Petkov,
Peter Zijlstra, Josh Poimboeuf, Pawan Gupta, Ingo Molnar,
Dave Hansen, x86, H. Peter Anvin, Valentin Schneider,
Tomas Glozar
On 12/4/26 05:44, Viktor Malik wrote:
> +static __always_inline void bpf_prog_mark_ran(void)
> +{
> + bool *ran;
> +
> + if (!static_branch_unlikely(&bpf_pred_flush_enabled))
> + return;
> +
> + ran = raw_cpu_ptr(&bpf_prog_ran);
> + if (!READ_ONCE(*ran))
> + WRITE_ONCE(*ran, true);
> +}
This is bizarrely complex.
I obviously know why code might want to avoid dirtying a cacheline,
especially when it might be shared. But this is per-cpu data. It's
fundamentally not in other CPU caches.
What's wrong with?
if (static_branch_unlikely(&bpf_pred_flush_enabled))
this_cpu_write(bpf_prog_ran, true);
> DEFINE_STATIC_KEY_FALSE(bpf_pred_flush_enabled);
> +EXPORT_SYMBOL(bpf_pred_flush_enabled);
> +
> +/*
> + * Set on a CPU once it has executed a JITed BPF program since the last
> + * predictor flush; see bpf_prog_mark_ran() and bpf_arch_pred_flush().
> + */
> +DEFINE_PER_CPU(bool, bpf_prog_ran);
> +EXPORT_PER_CPU_SYMBOL(bpf_prog_ran);
What are the exports for? Any reason they're generic exports and not
GPL-only?
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH bpf-next 1/2] bpf: Track CPUs that have executed a BPF program
2026-12-04 16:27 ` Dave Hansen
@ 2026-12-04 16:45 ` Viktor Malik
0 siblings, 0 replies; 12+ messages in thread
From: Viktor Malik @ 2026-12-04 16:45 UTC (permalink / raw)
To: Dave Hansen, bpf
Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Eduard Zingerman, Kumar Kartikeya Dwivedi, Martin KaFai Lau,
Song Liu, Yonghong Song, Jiri Olsa, Emil Tsalapatis,
Ihor Solodrai, John Fastabend, Thomas Gleixner, Borislav Petkov,
Peter Zijlstra, Josh Poimboeuf, Pawan Gupta, Ingo Molnar,
Dave Hansen, x86, H. Peter Anvin, Valentin Schneider,
Tomas Glozar
On 12/4/26 17:27, Dave Hansen wrote:
> On 12/4/26 05:44, Viktor Malik wrote:
>> +static __always_inline void bpf_prog_mark_ran(void)
>> +{
>> + bool *ran;
>> +
>> + if (!static_branch_unlikely(&bpf_pred_flush_enabled))
>> + return;
>> +
>> + ran = raw_cpu_ptr(&bpf_prog_ran);
>> + if (!READ_ONCE(*ran))
>> + WRITE_ONCE(*ran, true);
>> +}
>
> This is bizarrely complex.
>
> I obviously know why code might want to avoid dirtying a cacheline,
> especially when it might be shared. But this is per-cpu data. It's
> fundamentally not in other CPU caches.
>
> What's wrong with?
>
> if (static_branch_unlikely(&bpf_pred_flush_enabled))
>
> this_cpu_write(bpf_prog_ran, true);
This CPU's bpf_prog_ran is read from another CPU in bpf_ibpb_needed() so
I was probably overcautiously protecting the cacheline here. But that's
likely not worth the complexity so I'll update to your suggestion.
>> DEFINE_STATIC_KEY_FALSE(bpf_pred_flush_enabled);
>> +EXPORT_SYMBOL(bpf_pred_flush_enabled);
>> +
>> +/*
>> + * Set on a CPU once it has executed a JITed BPF program since the last
>> + * predictor flush; see bpf_prog_mark_ran() and bpf_arch_pred_flush().
>> + */
>> +DEFINE_PER_CPU(bool, bpf_prog_ran);
>> +EXPORT_PER_CPU_SYMBOL(bpf_prog_ran);
>
> What are the exports for? Any reason they're generic exports and not
> GPL-only?
The exports are needed for builds when __bpf_prog_run() gets inlined
into modules (XDP drivers, test_bpf.ko), otherwise the build failed on
modpost errors.
No reason not to make them GPL-only, I'll change that in v2.
Thanks for the review!
Viktor
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH bpf-next 1/2] bpf: Track CPUs that have executed a BPF program
2026-12-04 13:44 ` [PATCH bpf-next 1/2] bpf: Track CPUs that have executed a BPF program Viktor Malik
` (2 preceding siblings ...)
2026-12-04 16:27 ` Dave Hansen
@ 2026-12-05 9:55 ` kernel test robot
3 siblings, 0 replies; 12+ messages in thread
From: kernel test robot @ 2026-12-05 9:55 UTC (permalink / raw)
To: Viktor Malik, bpf
Cc: oe-kbuild-all, Alexei Starovoitov, Daniel Borkmann,
Andrii Nakryiko, Eduard Zingerman, Kumar Kartikeya Dwivedi,
Martin KaFai Lau, Song Liu, Yonghong Song, Jiri Olsa,
Emil Tsalapatis, Ihor Solodrai, John Fastabend, Thomas Gleixner,
Borislav Petkov, Peter Zijlstra, Josh Poimboeuf, Pawan Gupta,
Ingo Molnar, Dave Hansen, x86, H. Peter Anvin, Valentin Schneider,
Tomas Glozar, Viktor Malik
Hi Viktor,
kernel test robot noticed the following build errors:
[auto build test ERROR on bpf-next/master]
[also build test ERROR on linux-review/Xu-Kuohai/bpf-Invalidate-freed-prog-pack-memory-without-holding-pack_mutex/20261203-140921 next-20261203]
[cannot apply to bpf/master tip/x86/core linus/master v7.4-rc5]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Viktor-Malik/bpf-Track-CPUs-that-have-executed-a-BPF-program/20261204-144401
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link: https://lore.kernel.org/r/5cf89312e3fea4409dc1fc9da6aa37b1e7a7f3b5.1796391323.git.vmalik%40redhat.com
patch subject: [PATCH bpf-next 1/2] bpf: Track CPUs that have executed a BPF program
config: m68k-m5208evb_defconfig (https://download.01.org/0day-ci/archive/20261205/20261205022615.mCaIxAaM-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 16.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261205/20261205022615.mCaIxAaM-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/20261205022615.mCaIxAaM-lkp@intel.com/
All errors (new ones prefixed by >>):
m68k-linux-ld: drivers/net/ethernet/freescale/fec_main.o: in function `fec_enet_rx_queue_xdp':
>> fec_main.c:(.text+0x50a6): undefined reference to `bpf_prog_ran'
>> m68k-linux-ld: fec_main.c:(.text+0x50b2): undefined reference to `bpf_prog_ran'
>> m68k-linux-ld: fec_main.c:(.text+0x4e60): undefined reference to `bpf_pred_flush_enabled'
m68k-linux-ld: fec_main.c:(.text+0x517c): undefined reference to `bpf_pred_flush_enabled'
m68k-linux-ld: net/core/dev.o: in function `bpf_prog_run_generic_xdp':
>> dev.c:(.text+0xd960): undefined reference to `bpf_prog_ran'
>> m68k-linux-ld: dev.c:(.text+0xd96c): undefined reference to `bpf_prog_ran'
>> m68k-linux-ld: dev.c:(.text+0xd77c): undefined reference to `bpf_pred_flush_enabled'
m68k-linux-ld: dev.c:(.text+0xda9a): undefined reference to `bpf_pred_flush_enabled'
m68k-linux-ld: net/packet/af_packet.o: in function `bpf_prog_run_pin_on_cpu':
>> af_packet.c:(.text+0x418): undefined reference to `bpf_prog_ran'
>> m68k-linux-ld: af_packet.c:(.text+0x424): undefined reference to `bpf_prog_ran'
>> m68k-linux-ld: af_packet.c:(.text+0x30c): undefined reference to `bpf_pred_flush_enabled'
m68k-linux-ld: af_packet.c:(.text+0x40e): undefined reference to `bpf_pred_flush_enabled'
m68k-linux-ld: kernel/seccomp.o: in function `seccomp_run_filters':
>> seccomp.c:(.text+0x11a0): undefined reference to `bpf_prog_ran'
>> m68k-linux-ld: seccomp.c:(.text+0x11b8): undefined reference to `bpf_prog_ran'
>> m68k-linux-ld: seccomp.c:(.text+0x10f8): undefined reference to `bpf_pred_flush_enabled'
m68k-linux-ld: seccomp.c:(.text+0x12a2): undefined reference to `bpf_pred_flush_enabled'
m68k-linux-ld: io_uring/bpf_filter.o: in function `__io_uring_run_bpf_filters':
>> bpf_filter.c:(.text+0x4f4): undefined reference to `bpf_prog_ran'
>> m68k-linux-ld: bpf_filter.c:(.text+0x502): undefined reference to `bpf_prog_ran'
>> m68k-linux-ld: bpf_filter.c:(.text+0x45a): undefined reference to `bpf_pred_flush_enabled'
m68k-linux-ld: net/core/flow_dissector.o: in function `bpf_prog_run_pin_on_cpu':
>> flow_dissector.c:(.text+0x3d8): undefined reference to `bpf_prog_ran'
>> m68k-linux-ld: flow_dissector.c:(.text+0x3e4): undefined reference to `bpf_prog_ran'
>> m68k-linux-ld: flow_dissector.c:(.text+0x2cc): undefined reference to `bpf_pred_flush_enabled'
m68k-linux-ld: flow_dissector.c:(.text+0x3ce): undefined reference to `bpf_pred_flush_enabled'
m68k-linux-ld: net/core/filter.o: in function `__bpf_prog_run_save_cb':
>> filter.c:(.text+0x80a8): undefined reference to `bpf_prog_ran'
>> m68k-linux-ld: filter.c:(.text+0x80b2): undefined reference to `bpf_prog_ran'
m68k-linux-ld: net/core/filter.o: in function `bpf_run_sk_reuseport':
filter.c:(.text+0x1952c): undefined reference to `bpf_prog_ran'
m68k-linux-ld: filter.c:(.text+0x19536): undefined reference to `bpf_prog_ran'
m68k-linux-ld: net/core/filter.o: in function `__bpf_prog_run_save_cb':
filter.c:(.text+0x8060): undefined reference to `bpf_pred_flush_enabled'
m68k-linux-ld: filter.c:(.text+0x81a0): undefined reference to `bpf_pred_flush_enabled'
m68k-linux-ld: net/core/filter.o: in function `bpf_run_sk_reuseport':
filter.c:(.text+0x194fe): undefined reference to `bpf_pred_flush_enabled'
m68k-linux-ld: filter.c:(.text+0x195b8): undefined reference to `bpf_pred_flush_enabled'
m68k-linux-ld: net/core/sock_reuseport.o: in function `__bpf_prog_run_save_cb':
sock_reuseport.c:(.text+0x2e8): undefined reference to `bpf_prog_ran'
m68k-linux-ld: sock_reuseport.c:(.text+0x2f2): undefined reference to `bpf_prog_ran'
m68k-linux-ld: sock_reuseport.c:(.text+0x2a0): undefined reference to `bpf_pred_flush_enabled'
m68k-linux-ld: sock_reuseport.c:(.text+0x3e0): undefined reference to `bpf_pred_flush_enabled'
m68k-linux-ld: net/core/ptp_classifier.o: in function `ptp_classify_raw':
ptp_classifier.c:(.text+0xc0): undefined reference to `bpf_prog_ran'
m68k-linux-ld: ptp_classifier.c:(.text+0xce): undefined reference to `bpf_prog_ran'
m68k-linux-ld: ptp_classifier.c:(.text+0xac): undefined reference to `bpf_pred_flush_enabled'
m68k-linux-ld: ptp_classifier.c:(.text+0x168): undefined reference to `bpf_pred_flush_enabled'
m68k-linux-ld: net/ipv4/inet_hashtables.o: in function `bpf_sk_lookup_run_v4':
inet_hashtables.c:(.text+0x240): undefined reference to `bpf_prog_ran'
m68k-linux-ld: inet_hashtables.c:(.text+0x24e): undefined reference to `bpf_prog_ran'
m68k-linux-ld: inet_hashtables.c:(.text+0x190): undefined reference to `bpf_pred_flush_enabled'
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2026-12-05 13:08 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-05 13:07 [PATCH bpf-next 1/2] bpf: Track CPUs that have executed a BPF program kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2026-12-05 9:55 kernel test robot
2026-12-05 9:55 kernel test robot
2026-12-05 9:55 kernel test robot
2026-12-05 9:55 kernel test robot
2026-12-04 13:44 [PATCH bpf-next 0/2] bpf, x86: Restrict BPF JIT IBPB flush to CPUs that ran BPF Viktor Malik
2026-12-04 13:44 ` [PATCH bpf-next 1/2] bpf: Track CPUs that have executed a BPF program Viktor Malik
2026-12-04 14:03 ` sashiko-bot
2026-12-04 15:22 ` Viktor Malik
2026-12-04 14:51 ` Valentin Schneider
2026-12-04 16:27 ` Dave Hansen
2026-12-04 16:45 ` Viktor Malik
2026-12-05 9:55 ` kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.