f3c0d74e | 17-Apr-2025 |
Warner Losh <imp@FreeBSD.org> |
kboot: Implement data_from_kernel to read kernel variables
Since the linux kernel doesn't expose enough of the EFI details to userland via /sys/firmware/efi, write a routine to extract data from the
kboot: Implement data_from_kernel to read kernel variables
Since the linux kernel doesn't expose enough of the EFI details to userland via /sys/firmware/efi, write a routine to extract data from the kernel directly by parsing /proc/kproc and /proc/kallsyms.
Sponsored by: Netflix Reviewed by: kevans, jhibbits Differential Revision: https://reviews.freebsd.org/D49868
show more ...
|
92ad79ec | 17-Apr-2025 |
Warner Losh <imp@FreeBSD.org> |
kboot: Move common EFI stuff from aarch64 to libkboot
Move efi_read_from_pa, efi_set_systbl and efi_bi_loadsmap into efi.c Move prototype for populate_avail_from_efi as well, though that arrived pre
kboot: Move common EFI stuff from aarch64 to libkboot
Move efi_read_from_pa, efi_set_systbl and efi_bi_loadsmap into efi.c Move prototype for populate_avail_from_efi as well, though that arrived previously.
Move efi memory map variables into efi.c.
Add efi_read_from_sysfs, but if 0 it out. We'll want to use it if we can get the proposed /sys/firmware/efi/memmap data published in the same format and the code works, it's just that the current /sys/firmware/efi/runtime-memmap isn't complete enough to use.
Sponsored by: Netflix Reviewed by: kevans, jhibbits Differential Revision: https://reviews.freebsd.org/D49863
show more ...
|
988ee1cc | 17-Apr-2025 |
Warner Losh <imp@FreeBSD.org> |
kboot: Method to populate the avail array from EFI map
If we can get an efi memory map, populate_avail_from_efi will create an avail array. We only use the regiions marked as 'free' to find a place
kboot: Method to populate the avail array from EFI map
If we can get an efi memory map, populate_avail_from_efi will create an avail array. We only use the regiions marked as 'free' to find a place for the kernel to land. The other regions are also eligible, but usually too small to materially affect where we'd put the kernel (not to worry, the kernel will use that memory).
Sponsored by: Netflix Reviewed by: kevans, jhibbits Differential Revision: https://reviews.freebsd.org/D49862
show more ...
|
f0f44cdb | 17-Apr-2025 |
Warner Losh <imp@FreeBSD.org> |
kboot: Save the upper limit of the call stack.
The location of argc argument is a fine limit for the extent of the stack traceback. We could save the location of return address for the call to _star
kboot: Save the upper limit of the call stack.
The location of argc argument is a fine limit for the extent of the stack traceback. We could save the location of return address for the call to _start_c, but we'd have to move that into MD assembler. While not hard, it wouldn't improve the traces we can get. And the math to find it is architecture dependent (though the same for both arm64 and amd64).
Sponsored by: Netflix Reviewed by: kevans, andrew, jhibbits Differential Revision: https://reviews.freebsd.org/D49858
show more ...
|
14acbf61 | 17-Apr-2025 |
Warner Losh <imp@FreeBSD.org> |
kboot: Add option to parse 32-bit quantity
The type that's exposed from sysfs' memory map is 32-bit and so is the data-type of memory description.
Sponsored by: Netflix Reviewed by: kevans, andre
kboot: Add option to parse 32-bit quantity
The type that's exposed from sysfs' memory map is 32-bit and so is the data-type of memory description.
Sponsored by: Netflix Reviewed by: kevans, andrew, jhibbits Differential Revision: https://reviews.freebsd.org/D49856
show more ...
|
58c99df2 | 17-Apr-2025 |
Warner Losh <imp@FreeBSD.org> |
kboot: .note.GNU-stack is needed
Add '.section .note.GNU-stack,"",%progbits' to all assembler. Newer versions of clang complain when this isn't present because executable stacks are going away in th
kboot: .note.GNU-stack is needed
Add '.section .note.GNU-stack,"",%progbits' to all assembler. Newer versions of clang complain when this isn't present because executable stacks are going away in the future. We don't need an executable stack anyway.
Sponsored by: Netflix Reviewed by: kevans, andrew, emaste, jhibbits Differential Revision: https://reviews.freebsd.org/D49855
show more ...
|
ed1b3f13 | 09-Apr-2025 |
Warner Losh <imp@FreeBSD.org> |
kboot: Free prior segs in init_avail()
We can call init_avail() multiple times. Each time, we want to toss whatever garbage may have already been there from a prior failed attempt to find a good mem
kboot: Free prior segs in init_avail()
We can call init_avail() multiple times. Each time, we want to toss whatever garbage may have already been there from a prior failed attempt to find a good memory map.
Sponsored by: Netflix
show more ...
|
b2bd8c9a | 09-Apr-2025 |
Warner Losh <imp@FreeBSD.org> |
kboot: Move str* util routines to libkboot
These are needed for the next round of EFI support for amd64 (partially shared with aarch64, but only partially because the Linux host interfaces are diffe
kboot: Move str* util routines to libkboot
These are needed for the next round of EFI support for amd64 (partially shared with aarch64, but only partially because the Linux host interfaces are different to get the same info).
Sponsored by: Netflix
show more ...
|
757dc8ab | 09-Apr-2025 |
Warner Losh <imp@FreeBSD.org> |
kboot: Move seg code into libkboot
This code is really generic segment processing and should live here. It also interfaces primarily with Linux APIs, so it's also appropriate for this if we have a v
kboot: Move seg code into libkboot
This code is really generic segment processing and should live here. It also interfaces primarily with Linux APIs, so it's also appropriate for this if we have a version of that runs as a FreeBSD binary using FreeBSD system calls and APIs, though that's in the future somehow...
Sponsored by: Netflix
show more ...
|
8f7327dc | 28-Jan-2024 |
Warner Losh <imp@FreeBSD.org> |
kboot: update copyright on these files.
host_syscalls.c: I've written, so put Netflix copyright on. It's possible in the confusion that Nathan wrote the host_gettimeofday implementation.
syscall_nr
kboot: update copyright on these files.
host_syscalls.c: I've written, so put Netflix copyright on. It's possible in the confusion that Nathan wrote the host_gettimeofday implementation.
syscall_nr: These files likely can't enjoy copyright protection since they are just facts (the per-arch Linux system calls), so add a note they are in the public domain.
Sponsored by: Netflix
show more ...
|
4aabaa18 | 28-Jan-2024 |
Warner Losh <imp@FreeBSD.org> |
kboot: Cleanup libkern reference
For aarch64 and amd64, we don't pull in anything from libkern, so we don't need it in our path. However, powerpc needs ucmpdi2 from libkern, so bring it into libkbo
kboot: Cleanup libkern reference
For aarch64 and amd64, we don't pull in anything from libkern, so we don't need it in our path. However, powerpc needs ucmpdi2 from libkern, so bring it into libkboot's build and omit it from loader.kboot.
Sponsored by: Netflix
show more ...
|