Page MenuHomeFreeBSD

linux: implement signal delivery on arm64
ClosedPublic

Authored by trasz on Jul 21 2021, 12:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 14, 11:35 AM
Unknown Object (File)
Wed, Dec 4, 6:06 AM
Unknown Object (File)
Sat, Nov 30, 8:16 AM
Unknown Object (File)
Nov 26 2024, 1:54 PM
Unknown Object (File)
Nov 25 2024, 9:38 PM
Unknown Object (File)
Nov 25 2024, 5:16 PM
Unknown Object (File)
Nov 25 2024, 11:47 AM
Unknown Object (File)
Nov 22 2024, 7:11 PM

Details

Summary

Note that this still uses FreeBSD-style sigframe;
this will be addressed later.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

trasz created this revision.
dchagin added inline comments.
sys/arm64/linux/linux_locore.asm
49โ€“50

so does thread cancelation works? according to Linux arch/arm64/kernel/vdso/sugreturn.s comments it should not,
as 'gdb, libgcc and libunwind rely on being able to identify the sigreturn instruction sequence to unwind from signal handler'
also see comment about misterious nop instruction. really weird piece of Linux

sys/arm64/linux/linux_sysvec.c
501

on all other Linuxulators I do not use sv_sigcode_base,
but I see that we can do some here, e.g. sv_sigcode is not used anymore so we do not need to initialize it and so..
I propose to do it as everywhere in Linuxulator, then make the same changes everywhere so that there is no need to test separately. ugh..

Fix trampoline, don't use sv_sigcode_base.

sys/arm64/linux/linux_locore.asm
49โ€“50

Turns out I can fail even at copy/pasting :-D

Should be fixed now.

sys/arm64/linux/linux_sysvec.c
501

Tbh we could just drop both sv_sigcode_base and sv_sigcode; we don't need them, do we?

Note that this still uses FreeBSD-style sigframe;
this will be addressed later.

does Linux userspace depends on a sigframe? AFAIK, sigframe used by linux_rt_sigreturn to restore mcontext,
you need Linux siginfo as it passed to the catcher, If I remember it right

sys/arm64/linux/linux_sysvec.c
501

yes, Linuxulator does not uses it, but sysctl_kern_proc_sigtramp() uses, I think what we can fix here

sys/arm64/linux/linux_sysvec.c
447

signo should be converted to the Linux signo

477

siginfo too, by siginfo_to_lsiginfo()

Translate the signal number and siginfo.

if it works I have no objection)

This revision is now accepted and ready to land.Jul 26 2021, 7:35 AM
This revision was automatically updated to reflect the committed changes.