Page MenuHomeFreeBSD

linux: implement signal delivery on arm64
ClosedPublic

Authored by trasz on Jul 21 2021, 12:38 PM.
Tags
None
Referenced Files
F102615107: D31258.diff
Thu, Nov 14, 8:23 PM
Unknown Object (File)
Thu, Nov 7, 4:08 PM
Unknown Object (File)
Tue, Nov 5, 2:59 PM
Unknown Object (File)
Tue, Nov 5, 1:26 PM
Unknown Object (File)
Thu, Oct 17, 4:19 AM
Unknown Object (File)
Wed, Oct 16, 12:06 PM
Unknown Object (File)
Wed, Oct 16, 4:49 AM
Unknown Object (File)
Oct 14 2024, 2:09 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.