-
Notifications
You must be signed in to change notification settings - Fork 105
[Deepin-Kernel-SIG] [linux 6.6-y] [Upstream] Revert "LoongArch: BPF: Sign extend kfunc call arguments" #1433
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
[Deepin-Kernel-SIG] [linux 6.6-y] [Upstream] Revert "LoongArch: BPF: Sign extend kfunc call arguments" #1433
Conversation
deepin inclusion category: bugfix It cause loongarch build failed. it need merge more depends, such as "LoongArch: Add more instruction opcodes and emit_* helpers" This reverts commit 83aa5d5. Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideReverts the LoongArch BPF JIT kfunc-argument ABI extension logic to fix build issues by removing the helper that extended kfunc arguments and its use in kfunc call generation. Updated class diagram for LoongArch BPF JIT kfunc handling after revertclassDiagram
class JitCtx {
}
class BpfInsn {
}
class BtfFuncModel {
+int nr_args
+u8 arg_size[]
+u8 arg_flags[]
}
class LoongArchBpfJit_PreRevert {
+int build_insn(const BpfInsn *insn, JitCtx *ctx, bool extra_pass)
+void emit_sext_32(JitCtx *ctx, int reg, bool dst)
+void emit_abi_ext(JitCtx *ctx, int reg, u8 size, bool sign)
+void move_addr(JitCtx *ctx, int rd, u64 addr)
}
class LoongArchBpfJit_PostRevert {
+int build_insn(const BpfInsn *insn, JitCtx *ctx, bool extra_pass)
+void emit_sext_32(JitCtx *ctx, int reg, bool dst)
+void move_addr(JitCtx *ctx, int rd, u64 addr)
}
LoongArchBpfJit_PreRevert ..> BtfFuncModel : uses
LoongArchBpfJit_PostRevert ..|> LoongArchBpfJit_PreRevert : logical_evolution
LoongArchBpfJit_PreRevert ..> JitCtx : uses
LoongArchBpfJit_PreRevert ..> BpfInsn : uses
LoongArchBpfJit_PostRevert ..> JitCtx : uses
LoongArchBpfJit_PostRevert ..> BpfInsn : uses
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
deepin pr auto review这段代码的 diff 展示了对 LoongArch 架构下 BPF JIT 编译器的修改。主要改动是删除了处理 BPF 辅助函数调用参数扩展的代码逻辑。 以下是对这段代码变更的审查意见,涵盖语法逻辑、代码质量、性能和安全方面: 1. 语法逻辑与代码质量
2. 代码性能
3. 代码安全
4. 改进建议
总结这段代码变更主要是删除了 KFunc 调用前的参数符号扩展逻辑。
结论:在缺乏上下文(如关联的 Verifier 改动)的情况下,此改动存在较大的逻辑风险。建议审查相关的 BPF Verifier 代码,确认参数扩展是否已在更早阶段完成。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request reverts a previous commit that attempted to add sign extension for kfunc call arguments in the LoongArch BPF JIT implementation. The revert is necessary because the original commit depends on instruction opcodes (extwb and extwh) and corresponding emit helper functions that are not yet available in the current kernel version, causing build failures.
Changes:
- Removed the
emit_abi_exthelper function fromarch/loongarch/net/bpf_jit.h - Removed kfunc argument extension logic from the BPF_JMP | BPF_CALL case in
arch/loongarch/net/bpf_jit.c
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| arch/loongarch/net/bpf_jit.h | Removed emit_abi_ext function that used undefined LoongArch instructions |
| arch/loongarch/net/bpf_jit.c | Removed kfunc argument extension code block that called the now-removed emit_abi_ext function |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
deepin inclusion
category: bugfix
It cause loongarch build failed. it need merge more depends, such as "LoongArch: Add more instruction opcodes and emit_* helpers" This reverts commit 83aa5d5.
Summary by Sourcery
Bug Fixes: