Skip to content
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

armbian-kernel: enable BTF (and CO-RE) for all kernels #7629

Conversation

rpardini
Copy link
Member

armbian-kernel: enable BTF (and CO-RE) for all kernels

  • armbian-kernel: disable module signatures, harder
  • armbian-kernel: enable BTF (and CO-RE) for all kernels
  • armbian-kernel: enforce arm64 kernels use 48-bit PA/VA

@github-actions github-actions bot added size/medium PR with more then 50 and less then 250 lines Needs review Seeking for review Framework Framework components labels Dec 30, 2024
@rpardini rpardini marked this pull request as ready for review December 30, 2024 18:33
@rpardini rpardini requested a review from a team as a code owner December 30, 2024 18:33
@rpardini rpardini force-pushed the pr/armbian-kernel-enable-BTF-and-CO-RE-for-all-kernels branch from ae45043 to 8c09e7a Compare December 30, 2024 19:41
@igorpecovnik igorpecovnik added Ready to merge Reviewed, tested and ready for merge 02 Milestone: First quarter release and removed Needs review Seeking for review labels Dec 31, 2024
@igorpecovnik igorpecovnik merged commit 12f9318 into armbian:main Dec 31, 2024
11 checks passed
@amazingfate
Copy link
Contributor

cafdca0 is causing bcmdhd dkms module load panic on opi5max.
Reported by #7555 (comment)

@rpardini
Copy link
Member Author

cafdca0 is causing bcmdhd dkms module load panic on opi5max.
Reported by #7555 (comment)

I missed the link there, how is BTF to blame? I'm not saying it ain't, just asking to understand.

@amazingfate
Copy link
Contributor

cafdca0 is causing bcmdhd dkms module load panic on opi5max.
Reported by #7555 (comment)

I missed the link there, how is BTF to blame? I'm not saying it ain't, just asking to understand.

Here is the log when modprobe bcmdhd_sdio on rk vendor 6.1 kernel: http://paste.armbian.com/dewecaqowa.yaml
After loading the module, command lsmod will hang forever, and the system can't do normal boot/reboot.
I also tried 6.13 mainline kernel, which doesn't have this issue

@Tonymac32
Copy link
Member

RK vendor kernel 🤣🤣🤣. Of course it's the one, somewhere in the 3M line diff from a real 6.1 it still thinks it's kernel 2.6 or whatever concerning BTF. 🥲😭

@rpardini
Copy link
Member Author

What is funny is that rk vendor kernel works with the BTF stuff (say Cilium, Tetragon, bpftrace, etc, all work when BTF is enabled). Probably there's a 1-line change somewhere that affects the loading of modules -- we'll find it eventually.

I wonder if the Amlogic 5.15 kernel (used in meson s4t7 family, VIM4 etc) is also affected.

@amazingfate
Copy link
Contributor

I also tried v4l2loopback-dkms with BTF enabled rk vendor kernel, and it can't get loaded.

@amazingfate
Copy link
Contributor

After backporting this commit torvalds/linux@d4e48e3 to 6.1 vendor kernel, dkms module can get loaded with DEBUG_INFO_BTF enabled.
I guess all kernel before v6.11 have this issue.

@amazingfate
Copy link
Contributor

The dkms issue is also confirmed existing with phytium-embedded current 6.6.

@amazingfate
Copy link
Contributor

kernel family kernel version v4l2loopback dkms test result
bcm2711-current 6.6.71 load fine
phytium-embedded-current 6.6.12 kernel panic
rk35xx-vendor 6.1.84 kernel panic

I find that after adding this commit: torvalds/linux@f34d086 to rk35xx-vendor, the dkms module loads fine. This commit is introduced to mainline since v6.12, and backported to linux-stable since v6.1.113/v6.6.54.

We introduced BTF to get rid of the make clean issue since v6.12, what about enabling it only for kernels after v6.12? We have many vendor kernels which are not up-to-date with linux-stable and tt's hard to tell if one kenel has the fix.

@amazingfate
Copy link
Contributor

Another choice is to add the fix to the outdated vendor kernels. After a quick look to images from https://github.com/armbian/os/releases and https://github.com/armbian/community/releases, there are four 6.1/6.6 kernels are outdated:

kernel family kernel version afftected boards mainline or vendor kernel
rk35xx-vendor 6.1.84 all rk3528, rk356x, rk3588 boards vendor
phytium-embedded-current 6.6.12 phytium pi vendor
sun8i-legacy 6.1.104 all sun8i family boards mainline
meson-current 6.6.43 onecloud, odroidc1 mainline

The two mainline kernel sunxi-legacy and meson-current can get kernel version easily bumpped by changing KERNELBRANCH from tag to branch of linux-stable. And fixing the other two vendor kernel is not that hard.
The downside is that if we introduce a new vendor kernel, we may forget this fix. While as time goes by, kernel from vendor should have less possibility to be outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
02 Milestone: First quarter release Framework Framework components Ready to merge Reviewed, tested and ready for merge size/medium PR with more then 50 and less then 250 lines
Development

Successfully merging this pull request may close these issues.

4 participants