-
Notifications
You must be signed in to change notification settings - Fork 1
Make it work on 16k page size Arm kernel #8
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: master
Are you sure you want to change the base?
Conversation
Build arm sel_ldr and nacl_helper_bootstrap with 64K page size alignment. Makes it compatible with 16k page size kernels. SCons plumbing.
Build arm sel_ldr and nacl_helper_bootstrap with 64K page size alignment. Makes it compatible with 16k page size kernels. CMake plumbing.
…-reorder disabled on armhf The -ftoplevel-reorder option breaks the build for armhf.
…tstrap with a different page size
|
I noticed the nexe (including the irt one) already use a 64k page size, so I brought 16k page size 32-bit arm libraries from a recent Debian, and I recompiled the loader for 16k page size (0x1000: 4k, 0x4000: 16k, 0x10000, 64k). On a 4k page size kernel: On a 16k page size kernel: At least the loader executable itself launchzs: Without that rebuild trick we would get a segfault just at executable launch: In the same way the bootstrap itself launchzs: But nothing more is done. |
|
Using So we can get it working! |
|
Since it works with the |
a53e13b to
24b9cc2
Compare
|
It now works: Some explicit alignment was needed in the |
24b9cc2 to
5b139e2
Compare
5b139e2 to
8819aac
Compare
|
I added patches for SCons and GN but I haven't tested them. |
|
I noticed that arm libraries on Debian are compiled with a 64k page size, we may do the same to be consistent and future proof. Arm can run 4k, 16k or 64k page size binaries, but the minimum requirement is selected by the way the Linux kernel is built. Debian went from 4k to 16k as a minimum default when going from Bookworm to Trixie. A kernel with a small page size can run binaries from higher page sizes since they're multiple and are then always aligned, while the opposite is not true. So we can do 64k page size right now. |
|
Anyway this has an impact on the binary size: While I confirm that the 64k boostrap and loader are working though. |
|
Well, it looks like not everything has to be aligned… This can reduces the sizes to 37560, 66232 or 164536. |
That part of the comment was wrong, I looked at the wrong file. The rest of the comment is right. |
|
I aligned less things and it still runs with 16k and 64k page size, while the size is now Which, I now do confirm, is also the size of So we not only build a large page binary, but we do enough alignment to keep it working, while not increasing its size from a single byte. I also get |
|
Something we should never do is to strip the helper bootstrap, it breaks it: |
|
We can strip |
Also when we do that, we can then run |
6d5ac19 to
b8813cd
Compare
That's roughly the same as what happens when using the orphan handling discard flag. |
b8813cd to
08c16f9
Compare
|
Maybe the strip fixes the build on Ubuntu? 😅️ |
That cannot. Actually the strip breaks the linux-amd64 binary: |
08c16f9 to
f94383c
Compare
|
The orphan handling discard flag only reduces to |
|
@slipher actually that |
8de02af to
cc4836d
Compare
0cfff7b to
0da8cd9
Compare





Attempt to to make it work on 16k page size Arm kernel.
This is work in progress, this doesn't run.
This is based over:
The commit is:
cmake: make possible to build sel_ldr with 16K page sizeWhat this does:
What this doesn't do:
It is possible that the loader itself does nasty things that aren't compatible with a 16K page size kernel, especially when reserving the memory or things like that.
At least it is confirmed that this patch doesn't break the loader when running on a 4K page size kernel.
It is not enough to fix the 16K page size issue, but at least it doesn't break the 4K page size issue.