History log of /freebsd-11-stable/sys/amd64/cloudabi64/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
326743 10-Dec-2017 ed

MFC r326228 and r326229:

Use TO_PTR() to convert integers to pointers.

For FreeBSD/arm64's cloudabi32 support, I'm going to need a TO_PTR() in
this place. Also use it for all of the other source files, so that the
difference remains as minimal as possible.

322394 11-Aug-2017 ed

MFC r321924:

Keep top page on CloudABI to work around AMD Ryzen stability issues.

Similar to r321899, reduce sv_maxuser by one page inside of CloudABI.
This ensures that the stack, the vDSO and any allocations cannot touch
the top page of user virtual memory.

Considering that CloudABI userspace is completely oblivious to virtual
memory layout, don't bother making this conditional based on the CPU of
the running system.

321343 21-Jul-2017 kib

MFC r319873:
Move struct syscall_args syscall arguments parameters container into
struct thread.

316576 06-Apr-2017 kib

Improvements for the brand detection and prioritization.

MFC r315701 (by ed):
Set the interpreter path to /nonexistent.

MFC r315749:
Adjust r314851 to not require every brand to specify interpreter path.

MFC r315753:
Add a flag BI_BRAND_ONLY_STATIC to specify that the brand only
matches static binaries.

MFC r315754:
Update r315753 with the proper flag name.

MFC r316211:
A followup to r315749, two more places where brand->interp_path was
accessed unconditionally.

316574 06-Apr-2017 ed

Bring kernel space CloudABI code in sync with HEAD.

MFC r312353, r312354 and r312355:

Sync in the latest CloudABI generated source files.

Languages like C++17 and Go provide direct support for slice types:
pointer/length pairs. The CloudABI generator now has more complete for
this, meaning that for the C binding, pointer/length pairs now use an
automatic naming scheme of ${name} and ${name}_len.

Apart from this change and some reformatting, the ABI definitions are
identical. Binary compatibility is preserved entirely.

MFC r315700:

Make file descriptor passing work for CloudABI's sendmsg().

Reduce the potential amount of code duplication between cloudabi32 and
cloudabi64 by creating a cloudabi_sock_recv() utility function. The
cloudabi32 and cloudabi64 modules will then only contain code to convert
the iovecs to the native pointer size.

In cloudabi_sock_recv(), we can now construct an SCM_RIGHTS cmsghdr in
an mbuf and pass that on to kern_sendit().

MFC r315736:

Make file descriptor passing for CloudABI's recvmsg() work.

Similar to the change for sendmsg(), create a pointer size independent
implementation of recvmsg() and let cloudabi32 and cloudabi64 call into
it. In case userspace requests one or more file descriptors, call
kern_recvit() in such a way that we get the control message headers in
an mbuf. Iterate over all of the headers and copy the file descriptors
to userspace.


/freebsd-11-stable/sys/amd64/cloudabi32/cloudabi32_sysvec.c
cloudabi64_sysvec.c
/freebsd-11-stable/sys/arm/cloudabi32/cloudabi32_sysvec.c
/freebsd-11-stable/sys/arm64/cloudabi64/cloudabi64_sysvec.c
/freebsd-11-stable/sys/compat/cloudabi/cloudabi_file.c
/freebsd-11-stable/sys/compat/cloudabi/cloudabi_mem.c
/freebsd-11-stable/sys/compat/cloudabi/cloudabi_proc.c
/freebsd-11-stable/sys/compat/cloudabi/cloudabi_random.c
/freebsd-11-stable/sys/compat/cloudabi/cloudabi_sock.c
/freebsd-11-stable/sys/compat/cloudabi/cloudabi_util.h
/freebsd-11-stable/sys/compat/cloudabi32/cloudabi32_fd.c
/freebsd-11-stable/sys/compat/cloudabi32/cloudabi32_poll.c
/freebsd-11-stable/sys/compat/cloudabi32/cloudabi32_proto.h
/freebsd-11-stable/sys/compat/cloudabi32/cloudabi32_sock.c
/freebsd-11-stable/sys/compat/cloudabi32/cloudabi32_syscall.h
/freebsd-11-stable/sys/compat/cloudabi32/cloudabi32_syscalls.c
/freebsd-11-stable/sys/compat/cloudabi32/cloudabi32_sysent.c
/freebsd-11-stable/sys/compat/cloudabi32/cloudabi32_systrace_args.c
/freebsd-11-stable/sys/compat/cloudabi32/cloudabi32_thread.c
/freebsd-11-stable/sys/compat/cloudabi64/cloudabi64_fd.c
/freebsd-11-stable/sys/compat/cloudabi64/cloudabi64_poll.c
/freebsd-11-stable/sys/compat/cloudabi64/cloudabi64_proto.h
/freebsd-11-stable/sys/compat/cloudabi64/cloudabi64_sock.c
/freebsd-11-stable/sys/compat/cloudabi64/cloudabi64_syscall.h
/freebsd-11-stable/sys/compat/cloudabi64/cloudabi64_syscalls.c
/freebsd-11-stable/sys/compat/cloudabi64/cloudabi64_sysent.c
/freebsd-11-stable/sys/compat/cloudabi64/cloudabi64_systrace_args.c
/freebsd-11-stable/sys/compat/cloudabi64/cloudabi64_thread.c
/freebsd-11-stable/sys/contrib/cloudabi/cloudabi32_types.h
/freebsd-11-stable/sys/contrib/cloudabi/cloudabi64_types.h
/freebsd-11-stable/sys/contrib/cloudabi/cloudabi_types_common.h
/freebsd-11-stable/sys/contrib/cloudabi/syscalls32.master
/freebsd-11-stable/sys/contrib/cloudabi/syscalls64.master
/freebsd-11-stable/sys/i386/cloudabi32/cloudabi32_sysvec.c
316570 06-Apr-2017 ed

MFC r315861:

Stop providing the compat_3_brand.

As of r315860, the ELF image activator works fine for CloudABI without it.

307144 12-Oct-2016 ed

MFC r303818, r303833, r303941, r304478, r304481, r304483, r304484, r304554,
r304555, r304556, r304557, r304558, r304559, r304561, r304563, r304564,
r304565, r304615, r304742, r304743, r304744, r304745, r304748, r304886,
r304991, r305928, r305938, r305987, r306185:

Bring CloudABI support back in sync with HEAD.

- Add support for running 32-bit executables on amd64, armv6 and i386.

- As these new architectures require the use of the vDSO, merge back
vDSO support for 64-bit executables running on amd64 and arm64 as
well. This has the advantage that support for vDSO-less execution
can be phased out when 11.0 becomes unsupported, as opposed to 11.x.

This change has been tested by running the cloudlibc unit tests on all
supported architectures, which seems to work fine.


/freebsd-11-stable/share/man/man4/cloudabi.4
/freebsd-11-stable/sys/amd64/cloudabi32
cloudabi64_sysvec.c
/freebsd-11-stable/sys/amd64/conf/NOTES
/freebsd-11-stable/sys/arm/cloudabi32
/freebsd-11-stable/sys/arm64/cloudabi64/cloudabi64_sysvec.c
/freebsd-11-stable/sys/compat/cloudabi/cloudabi_clock.c
/freebsd-11-stable/sys/compat/cloudabi/cloudabi_thread.c
/freebsd-11-stable/sys/compat/cloudabi/cloudabi_util.h
/freebsd-11-stable/sys/compat/cloudabi/cloudabi_vdso.c
/freebsd-11-stable/sys/compat/cloudabi/cloudabi_vdso.lds
/freebsd-11-stable/sys/compat/cloudabi32
/freebsd-11-stable/sys/compat/cloudabi32/cloudabi32_proto.h
/freebsd-11-stable/sys/compat/cloudabi32/cloudabi32_syscall.h
/freebsd-11-stable/sys/compat/cloudabi32/cloudabi32_syscalls.c
/freebsd-11-stable/sys/compat/cloudabi32/cloudabi32_sysent.c
/freebsd-11-stable/sys/compat/cloudabi32/cloudabi32_systrace_args.c
/freebsd-11-stable/sys/compat/cloudabi64/Makefile
/freebsd-11-stable/sys/compat/cloudabi64/cloudabi64_fd.c
/freebsd-11-stable/sys/compat/cloudabi64/cloudabi64_module.c
/freebsd-11-stable/sys/compat/cloudabi64/cloudabi64_poll.c
/freebsd-11-stable/sys/compat/cloudabi64/cloudabi64_proto.h
/freebsd-11-stable/sys/compat/cloudabi64/cloudabi64_sock.c
/freebsd-11-stable/sys/compat/cloudabi64/cloudabi64_syscall.h
/freebsd-11-stable/sys/compat/cloudabi64/cloudabi64_syscalls.c
/freebsd-11-stable/sys/compat/cloudabi64/cloudabi64_sysent.c
/freebsd-11-stable/sys/compat/cloudabi64/cloudabi64_systrace_args.c
/freebsd-11-stable/sys/compat/cloudabi64/cloudabi64_util.h
/freebsd-11-stable/sys/conf/files
/freebsd-11-stable/sys/conf/files.amd64
/freebsd-11-stable/sys/conf/files.arm
/freebsd-11-stable/sys/conf/files.arm64
/freebsd-11-stable/sys/conf/files.i386
/freebsd-11-stable/sys/conf/options
/freebsd-11-stable/sys/contrib/cloudabi/cloudabi32_types.h
/freebsd-11-stable/sys/contrib/cloudabi/cloudabi64_types.h
/freebsd-11-stable/sys/contrib/cloudabi/cloudabi_types_common.h
/freebsd-11-stable/sys/contrib/cloudabi/cloudabi_vdso_aarch64.S
/freebsd-11-stable/sys/contrib/cloudabi/cloudabi_vdso_armv6.S
/freebsd-11-stable/sys/contrib/cloudabi/cloudabi_vdso_i686.S
/freebsd-11-stable/sys/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S
/freebsd-11-stable/sys/contrib/cloudabi/cloudabi_vdso_x86_64.S
/freebsd-11-stable/sys/contrib/cloudabi/syscalls.master
/freebsd-11-stable/sys/contrib/cloudabi/syscalls32.master
/freebsd-11-stable/sys/contrib/cloudabi/syscalls64.master
/freebsd-11-stable/sys/i386/cloudabi32
/freebsd-11-stable/sys/i386/cloudabi32/cloudabi32_sysvec.c
/freebsd-11-stable/sys/i386/conf/NOTES
/freebsd-11-stable/sys/modules/Makefile
/freebsd-11-stable/sys/modules/cloudabi/Makefile
/freebsd-11-stable/sys/modules/cloudabi32
/freebsd-11-stable/sys/modules/cloudabi32/Makefile
/freebsd-11-stable/sys/modules/cloudabi64/Makefile
/freebsd-11-stable/usr.bin/truss/syscalls.c
302627 12-Jul-2016 ed

MFC r302448:

Don't forget to set sa->narg for CloudABI system calls.

It turns out that this value is not used within the system call code
under normal conditions, except when using tracing tools like ktrace.
If we forget to set this value, it is set to random garbage. This may
cause ktrace to hang indefinitely, making it impossible to kill.

Approved by: re@
Reported by: Michael Plass
PR: 210800

302408 08-Jul-2016 gjb

Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/cddl
/freebsd-11-stable/cddl/contrib/opensolaris
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/zfs
/freebsd-11-stable/cddl/contrib/opensolaris/lib/libzfs
/freebsd-11-stable/contrib/amd
/freebsd-11-stable/contrib/apr
/freebsd-11-stable/contrib/apr-util
/freebsd-11-stable/contrib/atf
/freebsd-11-stable/contrib/binutils
/freebsd-11-stable/contrib/bmake
/freebsd-11-stable/contrib/byacc
/freebsd-11-stable/contrib/bzip2
/freebsd-11-stable/contrib/com_err
/freebsd-11-stable/contrib/compiler-rt
/freebsd-11-stable/contrib/dialog
/freebsd-11-stable/contrib/dma
/freebsd-11-stable/contrib/dtc
/freebsd-11-stable/contrib/ee
/freebsd-11-stable/contrib/elftoolchain
/freebsd-11-stable/contrib/elftoolchain/ar
/freebsd-11-stable/contrib/elftoolchain/brandelf
/freebsd-11-stable/contrib/elftoolchain/elfdump
/freebsd-11-stable/contrib/expat
/freebsd-11-stable/contrib/file
/freebsd-11-stable/contrib/gcc
/freebsd-11-stable/contrib/gcclibs/libgomp
/freebsd-11-stable/contrib/gdb
/freebsd-11-stable/contrib/gdtoa
/freebsd-11-stable/contrib/groff
/freebsd-11-stable/contrib/ipfilter
/freebsd-11-stable/contrib/ldns
/freebsd-11-stable/contrib/ldns-host
/freebsd-11-stable/contrib/less
/freebsd-11-stable/contrib/libarchive
/freebsd-11-stable/contrib/libarchive/cpio
/freebsd-11-stable/contrib/libarchive/libarchive
/freebsd-11-stable/contrib/libarchive/libarchive_fe
/freebsd-11-stable/contrib/libarchive/tar
/freebsd-11-stable/contrib/libc++
/freebsd-11-stable/contrib/libc-vis
/freebsd-11-stable/contrib/libcxxrt
/freebsd-11-stable/contrib/libexecinfo
/freebsd-11-stable/contrib/libpcap
/freebsd-11-stable/contrib/libstdc++
/freebsd-11-stable/contrib/libucl
/freebsd-11-stable/contrib/libxo
/freebsd-11-stable/contrib/llvm
/freebsd-11-stable/contrib/llvm/projects/libunwind
/freebsd-11-stable/contrib/llvm/tools/clang
/freebsd-11-stable/contrib/llvm/tools/lldb
/freebsd-11-stable/contrib/llvm/tools/llvm-dwarfdump
/freebsd-11-stable/contrib/llvm/tools/llvm-lto
/freebsd-11-stable/contrib/mdocml
/freebsd-11-stable/contrib/mtree
/freebsd-11-stable/contrib/ncurses
/freebsd-11-stable/contrib/netcat
/freebsd-11-stable/contrib/ntp
/freebsd-11-stable/contrib/nvi
/freebsd-11-stable/contrib/one-true-awk
/freebsd-11-stable/contrib/openbsm
/freebsd-11-stable/contrib/openpam
/freebsd-11-stable/contrib/openresolv
/freebsd-11-stable/contrib/pf
/freebsd-11-stable/contrib/sendmail
/freebsd-11-stable/contrib/serf
/freebsd-11-stable/contrib/sqlite3
/freebsd-11-stable/contrib/subversion
/freebsd-11-stable/contrib/tcpdump
/freebsd-11-stable/contrib/tcsh
/freebsd-11-stable/contrib/tnftp
/freebsd-11-stable/contrib/top
/freebsd-11-stable/contrib/top/install-sh
/freebsd-11-stable/contrib/tzcode/stdtime
/freebsd-11-stable/contrib/tzcode/zic
/freebsd-11-stable/contrib/tzdata
/freebsd-11-stable/contrib/unbound
/freebsd-11-stable/contrib/vis
/freebsd-11-stable/contrib/wpa
/freebsd-11-stable/contrib/xz
/freebsd-11-stable/crypto/heimdal
/freebsd-11-stable/crypto/openssh
/freebsd-11-stable/crypto/openssl
/freebsd-11-stable/gnu/lib
/freebsd-11-stable/gnu/usr.bin/binutils
/freebsd-11-stable/gnu/usr.bin/cc/cc_tools
/freebsd-11-stable/gnu/usr.bin/gdb
/freebsd-11-stable/lib/libc/locale/ascii.c
/freebsd-11-stable/sys/cddl/contrib/opensolaris
/freebsd-11-stable/sys/contrib/dev/acpica
/freebsd-11-stable/sys/contrib/ipfilter
/freebsd-11-stable/sys/contrib/libfdt
/freebsd-11-stable/sys/contrib/octeon-sdk
/freebsd-11-stable/sys/contrib/x86emu
/freebsd-11-stable/sys/contrib/xz-embedded
/freebsd-11-stable/usr.sbin/bhyve/atkbdc.h
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.c
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.h
/freebsd-11-stable/usr.sbin/bhyve/console.c
/freebsd-11-stable/usr.sbin/bhyve/console.h
/freebsd-11-stable/usr.sbin/bhyve/pci_fbuf.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.h
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.c
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.h
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.c
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.h
/freebsd-11-stable/usr.sbin/bhyve/rfb.c
/freebsd-11-stable/usr.sbin/bhyve/rfb.h
/freebsd-11-stable/usr.sbin/bhyve/sockstream.c
/freebsd-11-stable/usr.sbin/bhyve/sockstream.h
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.c
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.h
/freebsd-11-stable/usr.sbin/bhyve/usb_mouse.c
/freebsd-11-stable/usr.sbin/bhyve/vga.c
/freebsd-11-stable/usr.sbin/bhyve/vga.h
301961 16-Jun-2016 kib

Update comments for the MD functions managing contexts for new
threads, to make it less confusing and using modern kernel terms.

Rename the functions to reflect current use of the functions, instead
of the historic KSE conventions:
cpu_set_fork_handler -> cpu_fork_kthread_handler (for kthreads)
cpu_set_upcall -> cpu_copy_thread (for forks)
cpu_set_upcall_kse -> cpu_set_upcall (for new threads creation)

Reviewed by: jhb (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (hrs)
Differential revision: https://reviews.freebsd.org/D6731


297613 06-Apr-2016 ed

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


297470 31-Mar-2016 ed

Make Position Independent Executables work for CloudABI.

- Set BI_CAN_EXEC_DYN, so we can execute ET_DYN ELF files in addition to
regular ET_EXECs.
- Provide an AT_BASE entry in the auxiliary vector, so the executable
knows at which address it got loaded and can apply relocations.


296570 09-Mar-2016 jhb

Fix reporting of the CloudABI ABI in kdump.

- Advertise the word size for CloudABI ABIs via the SV_LP64 flag. All of
the other ABIs include either SV_ILP32 or SV_LP64.
- Fix kdump to not assume a 32-bit ABI if the ABI flags field is non-zero
but SV_LP64 isn't set. Instead, only assume a 32-bit ABI if SV_ILP32 is
set and fallback to the unknown value of "00" if neither SV_LP64 nor
SV_ILP32 is set.

Reviewed by: kib, ed
Differential Revision: https://reviews.freebsd.org/D5560


295880 22-Feb-2016 skra

As <machine/pmap.h> is included from <vm/pmap.h>, there is no need to
include it explicitly when <vm/pmap.h> is already included.

Reviewed by: alc, kib
Differential Revision: https://reviews.freebsd.org/D5373


289747 22-Oct-2015 ed

Refactoring: move out generic bits from cloudabi64_sysvec.c.

In order to make it easier to support CloudABI on ARM64, move out all of
the bits from the AMD64 cloudabi_sysvec.c into a new file
cloudabi_module.c that would otherwise remain identical. This reduces
the AMD64 specific code to just ~160 lines.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D3974


286924 19-Aug-2015 bapt

Add a kern.features.cloudabi64 entry when the module is loaded to helps the
userland to be able to test is cloudabi64 is supported or not

Reviewed by: ed
Differential Revision: https://reviews.freebsd.org/D3430


286230 03-Aug-2015 ed

Let CloudABI use the SV_CAPSICUM flag.

CloudABI processes will now start up in capabilities mode.

Reviewed by: kib


286221 03-Aug-2015 ed

Set p_osrel to __FreeBSD_version on process startup.

Certain system calls have quirks applied to make them work as if called
on an older version of FreeBSD. As CloudABI executables don't have the
FreeBSD OS release number in the ELF header, this value is set to zero,
making the system calls fall back to typically historic, non-standard
behaviour.

Reviewed by: kib


285744 21-Jul-2015 ed

Make thread creation work for CloudABI processes.

Summary:
Remove the stub system call that was put in place during the system call
import and replace it by a target-dependent version stored in sys/amd64.
Initialize the thread in a way similar to cpu_set_upcall_kse(). We
provide the entry point with two arguments: the thread ID and the
argument pointer.

Test Plan:
Thread creation still seems to work, both for FreeBSD and CloudABI
binaries.

Reviewers: dchagin, mjg, kib

Reviewed By: kib

Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D3110


285716 20-Jul-2015 ed

Make forking of CloudABI processes work.

Just like FreeBSD+Capsicum, CloudABI uses process descriptors. Return
the file descriptor number to the parent process.

To the child process we both return a special value for the file
descriptor number (CLOUDABI_PROCESS_CHILD). We also return the thread ID
of the new thread in the copied process, so the threading library can
reinitialize itself.

Obtained from: https://github.com/NuxiNL/freebsd


285641 16-Jul-2015 ed

Add a sysentvec for CloudABI on x86-64.

Summary:
For CloudABI we need to put two things on the stack of new processes:
the argument data (a binary blob; not strings) and a startup data
structure. The startup data structure contains interesting things such
as a pointer to the ELF program header, the thread ID of the initial
thread, a stack smashing protection canary, and a pointer to the
argument data.

Fetching system call arguments and setting the return value is similar
to FreeBSD. The only differences are that system call 0 does not exist
and that we call into cloudabi_convert_errno() to convert the error
code. We also need this function in a couple of other places, so we'd
better reuse it here.

Reviewers: dchagin, kib

Reviewed By: kib

Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D3098