[Libre-soc-bugs] [Bug 982] Support PowerPC ABI in ISACaller
bugzilla-daemon at libre-soc.org
bugzilla-daemon at libre-soc.org
Tue Sep 5 17:58:25 BST 2023
https://bugs.libre-soc.org/show_bug.cgi?id=982
--- Comment #4 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Jacob Lifshay from comment #2)
> note that the list of actual syscalls that are needed to run a simple
> program are a bit different:
> I tested the following program on ppc64le:
> gcc -x c - -static <<'EOF'
> #include <stdio.h>
> int main() {
> FILE *f;
> f = fopen("/proc/cmdline", "r");
it's very important to avoid fopen at the early phase, and just do
read open write and close. ("man 2 open")
check the size of the binary (static compile, stripped) and it will be
obvious why, immediately.
fopen pulls in vast quantities of libc6 including threads locking
spinlocks mutexes, it's a whole stack of shit that massively raises
the initial starting-point to an overwhelming barrier, *and* you
end up running hundreds of thousands of unnecessary instructions
to even initilise all that shit.
you don't need the hassle. cut the bullshit, make life easy, do the
other syscalls later.
btw there is a *REAL* simple way to get this entire thing done
*REAL* fast:
https://stackoverflow.com/questions/37032203/make-syscall-in-python
if you trap malloc realloc and free and emulate them (there are
plenty of "replacement" libraries which do exactly this)
then this entire job is done in about... ooo... a week?
on that: i don't want to hear anyone say "But Security"
or "But Guest interference with Host???" - this is not
qemu, this is an expedient simulator trick, deployed by
cavatools to achieve 500 to 1,000 times the speed of e.g.
risc-v-spike simulator.
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the libre-soc-bugs
mailing list