-
Notifications
You must be signed in to change notification settings - Fork 5
LoongArch: BPF: Fix sign extension for 12-bit immediates #6276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LoongArch: BPF: Fix sign extension for 12-bit immediates #6276
Conversation
|
Upstream branch: ab01bfa |
9a71dd4 to
e4f505a
Compare
|
Upstream branch: e6e10c5 |
a6d116d to
35a7ed2
Compare
e4f505a to
5119f01
Compare
|
Upstream branch: 5dae745 |
35a7ed2 to
76012e1
Compare
5119f01 to
fe98223
Compare
|
Upstream branch: 11369e6 |
76012e1 to
f5cc150
Compare
fe98223 to
6fe2c31
Compare
|
Upstream branch: efa4756 |
f5cc150 to
da377ae
Compare
6fe2c31 to
634398c
Compare
|
Upstream branch: b3387b3 |
da377ae to
1a0c5f3
Compare
634398c to
c95b89c
Compare
|
Upstream branch: 4cb4897 |
When loading immediate values that fit within 12-bit signed range, the move_imm function incorrectly used zero extension instead of sign extension. The bug was exposed when scx_simple scheduler failed with -EINVAL in ops.init() after passing node = -1 to scx_bpf_create_dsq(). Due to incorrect sign extension, `node >= (int)nr_node_ids` evaluated to true instead of false, causing BPF program failure. Verified by testing with the scx_simple scheduler (located in tools/sched_ext/). After building with `make` and running ./tools/sched_ext/build/bin/scx_simple, the scheduler now initializes successfully with this fix. Fix this by using sign extension (sext) instead of zero extension for signed immediate values in move_imm. Fixes: 5dc6155 ("LoongArch: Add BPF JIT support") Reported-by: Bing Huang <[email protected]> Signed-off-by: George Guo <[email protected]>
1a0c5f3 to
6335ff5
Compare
c95b89c to
828eff8
Compare
|
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=1018805 expired. Closing PR. |
Pull request for series with
subject: LoongArch: BPF: Fix sign extension for 12-bit immediates
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1018805