-
Notifications
You must be signed in to change notification settings - Fork 139
Fix compatibility with Linux kernel 6.15–6.16 ABI/API changes #302
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
Changes from all commits
dd8fc82
d3b9c3e
dc0b741
7a0eaa8
1fb1712
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,9 @@ | |
| #include "ef100_vdpa.h" | ||
| #include "mcdi_filters.h" | ||
| #endif | ||
| #ifdef EFX_HAVE_TRY_LOOKUP_NOPERM | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The changes to src/driver/linux_net/* need to go via the AMD net driver team, as we consume the driver unmodified from them. We'll work internally to get this kernel supported with them, and then import a new version of the net driver to the Onload repository. |
||
| #include <linux/namei.h> | ||
| #endif | ||
|
|
||
|
|
||
| /* Parameter definition bound to a structure - each file has one of these */ | ||
|
|
@@ -84,10 +87,15 @@ static struct file_operations efx_debugfs_file_ops = { | |
| */ | ||
| void efx_fini_debugfs_child(struct dentry *dir, const char *name) | ||
| { | ||
| struct qstr child_name = QSTR_INIT(name, strlen(name)); | ||
| struct dentry *child; | ||
|
|
||
| #ifdef EFX_HAVE_TRY_LOOKUP_NOPERM | ||
| child = try_lookup_noperm(&QSTR(name), dir); | ||
| #else | ||
| struct qstr child_name = QSTR_INIT(name, strlen(name)); | ||
|
|
||
| child = d_hash_and_lookup(dir, &child_name); | ||
| #endif | ||
| if (!IS_ERR_OR_NULL(child)) { | ||
| /* If it's a "regular" file, free its parameter binding */ | ||
| if (S_ISREG(child->d_inode->i_mode)) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,7 +47,7 @@ EFRM_HAVE_ALLOC_FILE_PSEUDO symbol alloc_file_pseudo include/linux/file.h | |
| EFRM_NET_HAS_PROC_INUM member struct_net proc_inum include/net/net_namespace.h | ||
| EFRM_NET_HAS_USER_NS member struct_net user_ns include/net/net_namespace.h | ||
|
|
||
| EFRM_HAVE_OLD_FAULT memtype struct_vm_operations_struct fault include/linux/mm.h int (*)(struct vm_area_struct *vma, struct vm_fault *vmf) | ||
| EFRM_HAVE_OLD_FAULT memtype struct_vm_operations_struct fault include/linux/mm.h int (*)(struct vm_fault *vmf) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like us to understand why this was wrong before changing it. It has been this way for a long time. I appreciate that as this repository doesn't have the history pre-2020, it makes it difficult for external contributors to do that kind of archaeology, so I think this is a task for the AMD team. I'm wondering if when this was written, what was "new" then has become "old" now. I.e. there are potentially three signatures we need to interoperate with, although I'm hoping that the original "old" is now so old that we don't need it. In summary, I think this change is probably correct, but I want to check history to be sure. |
||
| EFRM_HAVE_NEW_FAULT memtype struct_vm_operations_struct fault include/linux/mm.h vm_fault_t (*)(struct vm_fault *vmf) | ||
|
|
||
| EFRM_HAVE_SCHED_TASK_H file include/linux/sched/task.h | ||
|
|
@@ -188,6 +188,9 @@ EFRM_HAVE_FOLLOW_PFNMAP_START symbol follow_pfnmap_start include/linux/mm.h | |
| EFRM_HAVE_FOLLOW_PTE symbol follow_pte include/linux/mm.h | ||
| EFRM_HAVE_FOLLOW_PTE_VMA symtype follow_pte include/linux/mm.h int(struct vm_area_struct*, unsigned long, pte_t**, spinlock_t**) | ||
|
|
||
| EFRM_PAGE_HAS_FOLIO_INDEX member struct_page __folio_index include/linux/mm_types.h | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks good to me. |
||
| EFRM_NEED_UNIXCB nsymbol UNIXCB include/net/af_unix.h | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This, and the code that uses it in shrub_socket_kernel.c needs closer inspection. While it might succeed in getting it to compile on recent kernels, we need to be careful about introducing new kernel definitions as they can be fragile to maintain. If there's a way we can avoid that, we'd have a strong preference for that. AMD Onload team to have a look at this. |
||
|
|
||
| # TODO move onload-related stuff from net kernel_compat | ||
| " | grep -E -v -e '^#' -e '^$' | sed 's/[ \t][ \t]*/:/g' | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,7 +47,7 @@ | |
|
|
||
| /* verifies compile time expression is 0 or positive - | ||
| * no-op for runtime expressions */ | ||
| #if __GNUC__ * 100 + __GNUC_MINOR__ >= 409 | ||
| #if defined(__clang__) || __GNUC__ * 100 + __GNUC_MINOR__ >= 409 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Although we don't officially support clang I'm inclined to recommend taking this fix as it will make life easier for any clang users and seems harmless for everyone else.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the Clang-related changes above are accepted, I’d really appreciate it if you could also include this commit: sheviks@9525ca6. Clang emits more errors than GCC; adding that commit ensures Clang generates the same Thanks!
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I’ve committed the change. Please see this commit for details: sheviks@dc0b741
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After I committed the patch, GitHub reported conflicts. When I resolved them, GitHub automatically added a merge commit.
A grep for Alternatively, if you'd prefer, I can review them and submit the fixes here. Thank you.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I reconsidered the approach. Since this PR will be split into smaller merges, I went ahead and committed the Thanks! |
||
| #define CI_BUILD_ASSERT_CONSTANT_NON_NEGATIVE(c) \ | ||
| do { \ | ||
| char __CI_BUILD_ASSERT_NAME(__LINE__) \ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,21 @@ | |
| #define ANCIENT_KERNEL_HACK | ||
| #endif | ||
|
|
||
| #ifdef EFRM_NEED_UNIXCB | ||
| struct unix_skb_parms { | ||
| struct pid *pid; /* skb credentials */ | ||
| kuid_t uid; | ||
| kgid_t gid; | ||
| struct scm_fp_list *fp; /* Passed files */ | ||
| #ifdef CONFIG_SECURITY_NETWORK | ||
| u32 secid; /* Security ID */ | ||
| #endif | ||
| u32 consumed; | ||
| } __randomize_layout; | ||
|
|
||
| #define UNIXCB(skb) (*(struct unix_skb_parms *)&((skb)->cb)) | ||
| #endif | ||
|
|
||
|
Comment on lines
+24
to
+38
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above comment for UNIXCB - Onload team to have a look |
||
| int ef_shrub_socket_open(uintptr_t* socket_out) | ||
| { | ||
| int rc; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -315,10 +315,15 @@ oo_hugetlb_page_offset(struct page *page) | |
| * for vanilla, and >= 5.14 for RHEL 9.6) where hugetlb_basepage_index() | ||
| * was not present. | ||
| */ | ||
| #ifdef EFRM_PAGE_HAS_FOLIO_INDEX | ||
| pgoff_t index = page->__folio_index; | ||
| #else | ||
| pgoff_t index = page->index; | ||
| #endif | ||
| #if defined(EFRM_HAS_FILEMAP_LOCK_HUGETLB_FOLIO) && ! defined(EFRM_HAS_HUGETLB_BASEPAGE_INDEX) | ||
| return page->index * PAGE_SIZE; | ||
| return index * PAGE_SIZE; | ||
| #else | ||
| return page->index * OO_HUGEPAGE_SIZE; | ||
| return index * OO_HUGEPAGE_SIZE; | ||
|
Comment on lines
+318
to
+326
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks good to me. |
||
| #endif | ||
| } | ||
| EXPORT_SYMBOL(oo_hugetlb_page_offset); | ||
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.
This file is part of the
sfcLinux net driver which is managed in a separate project so we would make changes there. Linux 6.15 build compatibility changes have already been made in the net driver so this particular change is no longer needed since 2b28cf9, thanks!