-
Notifications
You must be signed in to change notification settings - Fork 92
[WIP] [Deepin-Kernel-SIG] [linux 6.6-y] deepin: KABI: reserve some space for kABI from Anolis #849
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
base: linux-6.6.y
Are you sure you want to change the base?
[WIP] [Deepin-Kernel-SIG] [linux 6.6-y] deepin: KABI: reserve some space for kABI from Anolis #849
Conversation
Reserve some space for kABI. Link: https://gitee.com/anolis/cloud-kernel/pulls/3764 Signed-off-by: Guixin Liu <[email protected]> Signed-off-by: WangYuli <[email protected]>
Reviewer's GuideThis PR augments the kernel’s public ABI by injecting reserved padding slots (via the DEEPIN_KABI_RESERVE macro) and including the new deepin_kabi header into a broad range of core data structures to pre-allocate space for future kernel-ABI extensions (sourced from Anolis). Updated Class Diagram for struct rt_bandwidthclassDiagram
class rt_bandwidth {
+DEEPIN_KABI_RESERVE(3)
+DEEPIN_KABI_RESERVE(4)
}
Updated Class Diagram for struct task_groupclassDiagram
class task_group {
+DEEPIN_KABI_RESERVE(1)
+DEEPIN_KABI_RESERVE(2)
+DEEPIN_KABI_RESERVE(3)
+DEEPIN_KABI_RESERVE(4)
+DEEPIN_KABI_RESERVE(5)
+DEEPIN_KABI_RESERVE(6)
+DEEPIN_KABI_RESERVE(7)
+DEEPIN_KABI_RESERVE(8)
}
Updated Class Diagram for struct net_device_opsclassDiagram
class net_device_ops {
+DEEPIN_KABI_RESERVE(9)
+DEEPIN_KABI_RESERVE(10)
+DEEPIN_KABI_RESERVE(11)
+DEEPIN_KABI_RESERVE(12)
+DEEPIN_KABI_RESERVE(13)
+DEEPIN_KABI_RESERVE(14)
+DEEPIN_KABI_RESERVE(15)
+DEEPIN_KABI_RESERVE(16)
}
Updated Class Diagram for struct moduleclassDiagram
class module {
+DEEPIN_KABI_RESERVE(1)
+DEEPIN_KABI_RESERVE(2)
+DEEPIN_KABI_RESERVE(3)
+DEEPIN_KABI_RESERVE(4)
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
[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.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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 reserves additional space for kernel ABI (kABI) compatibility in various subsystems. The key changes are the addition of DEEPIN_KABI_RESERVE macros in multiple header files to allocate reserved space, ensuring future backward compatibility and extension.
Reviewed Changes
Copilot reviewed 170 out of 170 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
include/drm/drm_modeset_helper_vtables.h | Added reserve space for kABI in drm_mode_config_helper_funcs. |
include/drm/drm_crtc.h | Added reserve space for kABI in drm_crtc_state and drm_crtc. |
include/drm/drm_connector.h | Added several DEEPIN_KABI_RESERVE macros to reserve kABI slots. |
include/drm/drm_client.h | Added reserve space for kABI in drm_client_buffer. |
include/drm/drm_atomic.h | Added reserve space for kABI in private state-related structures. |
include/acpi/acpi_bus.h | Added reserve space for kABI in acpi_device_power structure. |
fs/ubifs/ubifs.h | Added reserve space for kABI in ubifs_inode and ubifs_info. |
fs/ubifs/debug.h | Added include and reserve space for kABI. |
fs/mount.h | Added include and reserve space for kABI in mount structure. |
fs/eventfd.c | Added reserve space for kABI in eventfd_ctx. |
drivers/ptp/ptp_private.h | Added reserve space for kABI in ptp_clock structure. |
drivers/pci/controller/dwc/pcie-designware.h | Added reserve space for kABI in several PCIe-related structures. |
drivers/block/brd.c | Added reserve space for kABI in brd_device. |
block/elevator.h | Added reserve space for kABI in elevator operations and type structs. |
block/blk-mq.h | Added reserve space for kABI in blk_mq_alloc_data. |
block/blk-cgroup.h | Added reserve space for kABI in multiple blk cgroup structures. |
arch/x86/include/asm/kvm_host.h | Added reserve space for kABI in kvm_arch. |
arch/x86/include/asm/kprobes.h | Added reserve space for kABI in arch_specific_insn. |
arch/arm64/include/asm/probes.h | Added include and reserve space for kABI in arch_specific_insn. |
arch/arm64/include/asm/kvm_host.h | Added reserve space for kABI in kvm_arch. |
Comments suppressed due to low confidence (3)
include/drm/drm_connector.h:325
- Multiple consecutive DEEPIN_KABI_RESERVE macros are added here. Consider adding an inline comment to explain the purpose of these reserved fields for future maintainers.
DEEPIN_KABI_RESERVE(1)
fs/ubifs/ubifs.h:1529
- The structure includes several consecutive DEEPIN_KABI_RESERVE macros. Please add a comment explaining the reserved slots to improve code clarity and maintainability.
DEEPIN_KABI_RESERVE(1)
block/blk-cgroup.h:53
- Consider documenting the intent behind these multiple DEEPIN_KABI_RESERVE macros so that future developers understand the reserved space and its intended future use.
DEEPIN_KABI_RESERVE(1)
deepin没有使能CONFIG_DEEPIN_KABI_RESERVE配置项。经LLVM19工具链手工检查,开启该配置后可编译通过。 |
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.
Hey @Avenger-285714 - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@@ -22,5 +22,38 @@ struct netns_smc { | |||
int sysctl_smcr_testlink_time; | |||
int sysctl_wmem; | |||
int sysctl_rmem; | |||
|
|||
DEEPIN_KABI_RESERVE(1) |
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.
issue (complexity): Consider replacing the 32 individual DEEPIN_KABI_RESERVE macros with a single array macro to reserve space.
/* In a common header (e.g. deepin_kabi.h), add: */
#define DEEPIN_KABI_RESERVE_ARRAY(cnt) \
__u64 __deepin_kabi_reserved[(cnt)]
/* Then, in your struct, replace the 32 lines with one: */
struct netns_smc {
bool limit_smc_hs;
#ifdef CONFIG_SYSCTL
struct ctl_table_header *smc_hdr;
#endif
unsigned int sysctl_autocorking_size;
unsigned int sysctl_smcr_buf_type;
int sysctl_smcr_testlink_time;
int sysctl_wmem;
int sysctl_rmem;
/* collapse 32 individual DEEPIN_KABI_RESERVE(N) slots */
DEEPIN_KABI_RESERVE_ARRAY(32);
};
This preserves the same reserved space, dramatically cuts boilerplate, and still allows you to expand one of those slots later if required.
Reserve some space for kABI.
Link: https://gitee.com/anolis/cloud-kernel/pulls/3764
Summary by Sourcery
Reserve padding for kernel ABI (kABI) compatibility by adding DEEPIN_KABI_RESERVE entries and including deepin_kabi.h across scheduler, BPF, network, block, and numerous other subsystems to align with Anolis kABI requirements
Enhancements: