Page MenuHomeFreeBSD

linux: implement signal delivery on arm64
ClosedPublic

Authored by trasz on Jul 21 2021, 12:38 PM.
Tags
None
Referenced Files
F81629621: D31258.id92625.diff
Fri, Apr 19, 6:05 AM
Unknown Object (File)
Thu, Apr 18, 8:22 AM
Unknown Object (File)
Mar 17 2024, 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

Details

Summary

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

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 40599
Build 37488: arc lint + arc unit

Event Timeline

trasz created this revision.
dchagin added inline comments.
sys/arm64/linux/linux_locore.asm
48

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
500

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
48

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

Should be fixed now.

sys/arm64/linux/linux_sysvec.c
500

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
500

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
446

signo should be converted to the Linux signo

476

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.