freebsd-dev/sys/compat/cloudabi64
Ed Schouten ab83575070 Make CloudABI's way of doing TLS more friendly to userspace emulators.
We're currently seeing how hard it would be to run CloudABI binaries on
operating systems cannot be modified easily (Windows, Mac OS X). The
idea is that we want to just run them without any sandboxing. Now
that CloudABI executables are PIE, this is already a bit easier, but TLS
is still problematic:

- CloudABI executables want to write to the %fs, which typically
  requires extra system calls by the emulator every time it needs to
  switch between CloudABI's and its own TLS.

- If CloudABI executables overwrite the %fs base unconditionally, it
  also becomes harder for the emulator to store a backup of the old
  value of %fs. To solve this, let's no longer overwrite %fs, but just
  %fs:0.

As CloudABI's C library does not use a TCB, this space can now be used
by an emulator to keep track of its internal state. The executable can
now safely overwrite %fs:0, as long as it makes sure that the TCB is
copied over to the new TLS area.

Ensure that there is an initial TLS area set up when the process starts,
only containing a bogus TCB. We don't really care about its contents on
FreeBSD.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D5836
2016-04-06 11:11:31 +00:00
..
cloudabi64_fd.c Replace the CloudABI system call table by a machine generated version. 2016-03-24 21:47:15 +00:00
cloudabi64_module.c Make CloudABI's way of doing TLS more friendly to userspace emulators. 2016-04-06 11:11:31 +00:00
cloudabi64_poll.c Replace the CloudABI system call table by a machine generated version. 2016-03-24 21:47:15 +00:00
cloudabi64_proto.h Regenerate system call table after r297468. 2016-03-31 18:50:52 +00:00
cloudabi64_sock.c Replace the CloudABI system call table by a machine generated version. 2016-03-24 21:47:15 +00:00
cloudabi64_syscall.h Regenerate system call table after r297468. 2016-03-31 18:50:52 +00:00
cloudabi64_syscalls.c Regenerate system call table after r297468. 2016-03-31 18:50:52 +00:00
cloudabi64_sysent.c Regenerate system call table after r297468. 2016-03-31 18:50:52 +00:00
cloudabi64_systrace_args.c Sync in the latest CloudABI system call definitions. 2016-03-31 18:50:06 +00:00
cloudabi64_thread.c Make CloudABI's way of doing TLS more friendly to userspace emulators. 2016-04-06 11:11:31 +00:00
cloudabi64_util.h Make CloudABI's way of doing TLS more friendly to userspace emulators. 2016-04-06 11:11:31 +00:00
Makefile Replace the CloudABI system call table by a machine generated version. 2016-03-24 21:47:15 +00:00
syscalls.conf