Patch "sched_ext: Fix the incorrect bpf_list kfunc API in common.bpf.h." has been added to the 6.13-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    sched_ext: Fix the incorrect bpf_list kfunc API in common.bpf.h.

to the 6.13-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     sched_ext-fix-the-incorrect-bpf_list-kfunc-api-in-co.patch
and it can be found in the queue-6.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit d3e559692c4ac4ba35a299815e828796e3731340
Author: Chuyi Zhou <zhouchuyi@xxxxxxxxxxxxx>
Date:   Wed Feb 12 15:19:36 2025 +0800

    sched_ext: Fix the incorrect bpf_list kfunc API in common.bpf.h.
    
    [ Upstream commit 2e2006c91c842c551521434466f9b4324719c9a7 ]
    
    Now BPF only supports bpf_list_push_{front,back}_impl kfunc, not bpf_list_
    push_{front,back}.
    
    This patch fix this issue. Without this patch, if we use bpf_list kfunc
    in scx, the BPF verifier would complain:
    
    libbpf: extern (func ksym) 'bpf_list_push_back': not found in kernel or
    module BTFs
    libbpf: failed to load object 'scx_foo'
    libbpf: failed to load BPF skeleton 'scx_foo': -EINVAL
    
    With this patch, the bpf list kfunc will work as expected.
    
    Signed-off-by: Chuyi Zhou <zhouchuyi@xxxxxxxxxxxxx>
    Fixes: 2a52ca7c98960 ("sched_ext: Add scx_simple and scx_example_qmap example schedulers")
    Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/sched_ext/include/scx/common.bpf.h b/tools/sched_ext/include/scx/common.bpf.h
index 625f5b046776c..9fa64b053ba91 100644
--- a/tools/sched_ext/include/scx/common.bpf.h
+++ b/tools/sched_ext/include/scx/common.bpf.h
@@ -251,8 +251,16 @@ void bpf_obj_drop_impl(void *kptr, void *meta) __ksym;
 #define bpf_obj_new(type) ((type *)bpf_obj_new_impl(bpf_core_type_id_local(type), NULL))
 #define bpf_obj_drop(kptr) bpf_obj_drop_impl(kptr, NULL)
 
-void bpf_list_push_front(struct bpf_list_head *head, struct bpf_list_node *node) __ksym;
-void bpf_list_push_back(struct bpf_list_head *head, struct bpf_list_node *node) __ksym;
+int bpf_list_push_front_impl(struct bpf_list_head *head,
+				    struct bpf_list_node *node,
+				    void *meta, __u64 off) __ksym;
+#define bpf_list_push_front(head, node) bpf_list_push_front_impl(head, node, NULL, 0)
+
+int bpf_list_push_back_impl(struct bpf_list_head *head,
+				   struct bpf_list_node *node,
+				   void *meta, __u64 off) __ksym;
+#define bpf_list_push_back(head, node) bpf_list_push_back_impl(head, node, NULL, 0)
+
 struct bpf_list_node *bpf_list_pop_front(struct bpf_list_head *head) __ksym;
 struct bpf_list_node *bpf_list_pop_back(struct bpf_list_head *head) __ksym;
 struct bpf_rb_node *bpf_rbtree_remove(struct bpf_rb_root *root,




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux