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)
Sun, Mar 17, 11:29 AM
Unknown Object (File)
Feb 14 2024, 4:34 AM
Unknown Object (File)
Feb 8 2024, 1:27 PM
Unknown Object (File)
Jan 29 2024, 9:02 AM
Unknown Object (File)
Dec 24 2023, 11:30 AM
Unknown Object (File)
Dec 21 2023, 5:02 PM
Unknown Object (File)
Dec 18 2023, 12:25 PM
Unknown Object (File)
Dec 14 2023, 2:58 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.