-
Notifications
You must be signed in to change notification settings - Fork 90
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
Reduce fudge factor from shoehorn and strip elf files before loading #158
Conversation
There are some errors that I'll try and track down. The Elfloader is reporting that the loaded regions are all exclusive, however there appears to be consistent hanging before executing the kernel in some cases.
|
e396746
to
f438dbf
Compare
@@ -57,6 +57,13 @@ function(ApplyData61ElfLoaderSettings kernel_platform kernel_sel4_arch) | |||
endif() | |||
set(IMAGE_START_ADDR 0x10000000 CACHE INTERNAL "" FORCE) | |||
endif() | |||
if(KernelPlatformSpike OR KernelPlatformQEMURiscVVirt) | |||
# Spike loads elfloader to either 0x80200000 or 0x80400000 | |||
# But the RISC-V kernel is currently loaded to a differen't |
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.
# But the RISC-V kernel is currently loaded to a differen't | |
# But the RISC-V kernel is currently loaded to a different |
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.
Looks good. Should we close JIRA SELFOUR-2335?
f438dbf
to
347b969
Compare
Correct the calculated memory needed to load an elf image. Using only the p_memsz value ignores gaps between segments; instead calculate the first+last addresses using p_vaddr & p_memsz. Signed-off-by: Kent McLeod <kent@kry10.com>
Strip out sections from kernel and rootserver elffiles before loading them into the cpio archive. Nothing makes use of this information at runtime and it causes the elf binary to be larger than it needs to be. Signed-off-by: Kent McLeod <kent@kry10.com>
As get_memory_usage in elf_sift.py now can calculate correct memory usage from a list of ELF segments, a more accurate upper bound on memory usage for the loaded apps is possible and the old fudge factor is no longer needed. We still need some gap to account for the size of the elfloader program so that the elfloader ends up above itself in memory if loaded to the lowest available address. Signed-off-by: Kent McLeod <kent@kry10.com>
Shoehorn currently can't manage to pick a good load address. Signed-off-by: Kent McLeod <kent@kry10.com>
347b969
to
7726e9b
Compare
Correct the calculated memory needed to load an elf image. Using only
the p_memsz value ignores gaps between segments; instead calculate the
first+last addresses using p_vaddr & p_memsz.
As get_memory_usage in elf_sift.py now can calculate correct memory
usage from a list of ELF segments, a more accurate upper bound on
memory usage for the loaded apps is possible and the old fudge
factor is no longer needed.
Thanks to @sleffler for the patch.