aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/linux32
Commit message (Collapse)AuthorAgeFilesLines
* Fix i386 linux module after r367395.Tijl Coosemans2020-12-051-0/+0
| | | | | | | | | | | | | In r367395 parts of machine dependent linux_dummy.c were moved to a new machine independent file sys/compat/linux/linux_dummy.c and the existing linux_dummy.c was renamed to linux_dummy_machdep.c. Add linux_dummy_machdep.c to the linux module for i386. Rename sys/amd64/linux32/linux_dummy.c for consistency. Add the new linux_dummy.c to the linux module for i386. Notes: svn path=/head/; revision=368372
* Linuxolator: Replace use of eventhandlers by sysent hooks.Konstantin Belousov2020-11-231-0/+3
| | | | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D27309 Notes: svn path=/head/; revision=367960
* 'make sysent' for r367773Conrad Meyer2020-11-173-6/+60
| | | | | | | X-MFC-With: r367773 Notes: svn path=/head/; revision=367774
* linux(4): Implement name_to_handle_at(), open_by_handle_at()Conrad Meyer2020-11-171-2/+12
| | | | | | | | | They are similar to our getfhat(2) and fhopen(2) syscalls. Differential Revision: https://reviews.freebsd.org/D27111 Notes: svn path=/head/; revision=367773
* linux(4): Deduplicate unimpl/dummy syscall handlersConrad Meyer2020-11-051-115/+0
| | | | | | | | | | No functional change. Reviewed by: emaste, trasz Differential Revision: https://reviews.freebsd.org/D27099 Notes: svn path=/head/; revision=367395
* Fix misnomer - linux_to_bsd_errno() does the exact opposite.Edward Tomasz Napierala2020-10-271-1/+1
| | | | | | | | | | Reported by: arichardson MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26965 Notes: svn path=/head/; revision=367079
* audit: also correctly audit linux_execve()Kyle Evans2020-10-261-0/+3
| | | | | | | | | | Linux execve() gets audited as AUE_EXECVE as well, we should also interpret the return from this correctly for the same reasoning as in r367002. MFC with: r367002 Notes: svn path=/head/; revision=367060
* Get rid of sa->narg. It serves no purpose; use sa->callp->sy_narg instead.Edward Tomasz Napierala2020-09-271-1/+0
| | | | | | | | | Reviewed by: kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26458 Notes: svn path=/head/; revision=366205
* Regen after r366145.Edward Tomasz Napierala2020-09-252-429/+435
| | | | | | | Sponsored by: DARPA Notes: svn path=/head/; revision=366147
* Get rid of sv_errtbl and SV_ABI_ERRNO().Edward Tomasz Napierala2020-09-171-3/+1
| | | | | | | | | Reviewed by: kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26388 Notes: svn path=/head/; revision=365832
* Move SV_ABI_ERRNO translation into linux-specific code, to simplifyEdward Tomasz Napierala2020-09-151-1/+15
| | | | | | | | | | | | the syscall path and declutter it a bit. No functional changes intended. Reviewed by: kib (earlier version) MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26378 Notes: svn path=/head/; revision=365755
* amd64: clean up empty lines in .c and .h filesMateusz Guzik2020-09-013-9/+0
| | | | Notes: svn path=/head/; revision=365067
* Regen after r363304.Edward Tomasz Napierala2020-07-183-3/+40
| | | | | | | | MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=363305
* Add a trivial linux(4) splice(2) implementation, which simplyEdward Tomasz Napierala2020-07-182-2/+8
| | | | | | | | | | | | | | returns EINVAL. Fixes grep (grep-3.1-2build1). PR: kern/218699 Reported by: avos Reviewed by: emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25636 Notes: svn path=/head/; revision=363304
* linuxolator: implement memfd_create syscallKyle Evans2020-06-291-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This effectively mirrors our libc implementation, but with minor fudging -- name needs to be copied in from userspace, so we just copy it straight into stack-allocated memfd_name into the correct position rather than allocating memory that needs to be cleaned up. The sealing-related fcntl(2) commands, F_GET_SEALS and F_ADD_SEALS, have also been implemented now that we support them. Note that this implementation is still not quite at feature parity w.r.t. the actual Linux version; some caveats, from my foggy memory: - Need to implement SHM_GROW_ON_WRITE, default for memfd (in progress) - LTP wants the memfd name exposed to fdescfs - Linux allows open() of an fdescfs fd with O_TRUNC to truncate after dup. (?) Interested parties can install and run LTP from ports (devel/linux-ltp) to confirm any fixes. PR: 240874 Reviewed by: kib, trasz Differential Revision: https://reviews.freebsd.org/D21845 Notes: svn path=/head/; revision=362769
* Regen.Edward Tomasz Napierala2020-06-273-54/+490
| | | | | | | | MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=362693
* Add proper types for linux message queue syscalls; mostly takenEdward Tomasz Napierala2020-06-271-6/+32
| | | | | | | | | | | from 32-bit Linuxulator. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25386 Notes: svn path=/head/; revision=362692
* Add syscall definitions for linux xattr syscalls.Edward Tomasz Napierala2020-06-271-12/+66
| | | | | | | | | MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25387 Notes: svn path=/head/; revision=362691
* Adapt linuxulator syscalls.master files to the new layout.Edward Tomasz Napierala2020-06-211-633/+2203
| | | | | | | | | | | | No functional changes. Reviewed by: brooks MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25381 Notes: svn path=/head/; revision=362463
* Regen after r362440.Edward Tomasz Napierala2020-06-205-7/+14
| | | | | | | | MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=362441
* Add linux_madvise(2) instead of having Linux apps call the nativeEdward Tomasz Napierala2020-06-202-1/+8
| | | | | | | | | | | | | | | | FreeBSD madvise(2) directly. While some of the flag values match, most don't. PR: kern/230160 Reported by: markj Reviewed by: markj Discussed with: brooks, kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25272 Notes: svn path=/head/; revision=362440
* Convert canary, execpathp, and pagesizes to pointers.Brooks Davis2020-04-161-4/+4
| | | | | | | | | | | | | Use AUXARGS_ENTRY_PTR to export these pointers. This is a followup to r359987 and r359988. Reviewed by: jhb Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24446 Notes: svn path=/head/; revision=360024
* Make ps_strings in struct image_params into a pointer.Brooks Davis2020-04-151-1/+1
| | | | | | | | | | | This is a prepratory commit for D24407. Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA Notes: svn path=/head/; revision=359987
* Centralize compatability translation macros.Brooks Davis2020-04-141-8/+2
| | | | | | | | | | | | | | | | Copy the CP, PTRIN, etc macros from freebsd32.h into a sys/abi_compat.h and replace existing definitation with includes where required. This eliminates duplicate code and allows Linux and FreeBSD compatability headers to be included in the same files. Input from: cem, jhb Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24275 Notes: svn path=/head/; revision=359937
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-1/+1
| | | | | | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
* regen linuxulator sysent after r357577Ed Maste2020-02-055-5/+75
| | | | Notes: svn path=/head/; revision=357578
* linuxulator: implement sendfileEd Maste2020-02-052-3/+4
| | | | | | | | | | | Submitted by: Bora Özarslan <borako.ozarslan@gmail.com> Submitted by: Yang Wang <2333@outlook.jp> Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19917 Notes: svn path=/head/; revision=357577
* Regen.Mark Johnston2020-01-212-46/+101
| | | | | | | | MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=356946
* Fix 64-bit syscall argument fetching in 32-bit Linux syscall handlers.Mark Johnston2020-01-212-16/+12
| | | | | | | | | | | | | | | | | | | | | | | | The Linux32 system call argument fetcher places each argument (passed in registers in the Linux x86 system call convention) into an entry in the generic system call args array. Each member of this array is 8 bytes wide, so this approach is broken for system calls that take off_t arguments. Fix the problem by splitting l_loff_t arguments in the 32-bit system call descriptions, the same as we do for FreeBSD32. Change entry points to handle this using the PAIR32TO64 macro. Move linux_ftruncate64() into compat/linux. PR: 243155 Reported by: Alex S <iwtcex@gmail.com> Reviewed by: kib (previous version) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23210 Notes: svn path=/head/; revision=356945
* sysent targets: further cleanup and deduplicationKyle Evans2020-01-181-23/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | r355473 vastly improved the readability and cleanliness of these Makefiles. Every single one of them follows the same pattern and duplicates the exact same logic. Now that we have GENERATED/SRCS, split SRCS up into the two parameters we'll use for ${MAKESYSCALLS} rather than assuming a specific ordering of SRCS and include a common sysent.mk to handle the rest. This makes it less tedious to make sweeping changes. Some default values are provided for GENERATED/SYSENT_*; almost all of these just use a 'syscalls.master' and 'syscalls.conf' in cwd, and they all use effectively the same filenames with an arbitrary prefix. Most ABIs will be able to get away with just setting GENERATED_PREFIX and including ^/sys/conf/sysent.mk, while others only need light additions. kern/Makefile is the notable exception, as it doesn't take a SYSENT_CONF and the generated files are spread out between ^/sys/kern and ^/sys/sys, but it otherwise fits the pattern enough to use the common version. Reviewed by: brooks, imp Nice!: emaste Differential Revision: https://reviews.freebsd.org/D23197 Notes: svn path=/head/; revision=356868
* Set .ORDER for makesyscalls generated filesKyle Evans2020-01-101-0/+3
| | | | | | | | | | | | | | | | | | | | When either makesyscalls.lua or syscalls.master changes, all of the ${GENERATED} targets are now out-of-date. With make jobs > 1, this means we will run the makesyscalls script in parallel for the same ABI, generating the same set of output files. Prior to r356603 , there is a large window for interlacing output for some of the generated files that we were generating in-place rather than staging in a temp dir. After that, we still should't need to run the script more than once per-ABI as the first invocation should update all of them. Add .ORDER to do so cleanly. Reviewed by: brooks Discussed with: sjg Differential Revision: https://reviews.freebsd.org/D23099 Notes: svn path=/head/; revision=356604
* Add basic getcpu(2) support to linuxulator. The purpose of thisEdward Tomasz Napierala2019-12-311-2/+0
| | | | | | | | | | | | | | | | | | | syscall is to query the CPU number and the NUMA domain the calling thread is currently running on. The third argument is ignored. It doesn't do anything regarding scheduling - it's literally just a way to query the current state, without any guarantees you won't get rescheduled an opcode later. This unbreaks Java from CentOS 8 (java-11-openjdk-11.0.5.10-0.el8_0.x86_64). Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22972 Notes: svn path=/head/; revision=356241
* Regen after r356229.Edward Tomasz Napierala2019-12-313-3/+25
| | | | | | | | MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=356231
* Fix definitions for Linux getcpu(2).Edward Tomasz Napierala2019-12-311-1/+2
| | | | | | | | MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=356229
* linux(4): implement copy_file_range(2)Pawel Biernacki2019-12-301-2/+0
| | | | | | | | | | | | copy_file_range(2) is implemented natively since r350315, make it available for Linux binaries too. Reviewed by: kib (mentor), trasz (previous version) Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D22959 Notes: svn path=/head/; revision=356206
* Implement Linux syslog(2) syscall; just enough to make Linux dmesg(8)Edward Tomasz Napierala2019-12-291-1/+0
| | | | | | | | | | | utility work. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22465 Notes: svn path=/head/; revision=356177
* Add compat.linux.emul_path, so it can be set to something otherEdward Tomasz Napierala2019-12-161-3/+3
| | | | | | | | | | | | | | than "/compat/linux". Useful when you have several compat directories with different Linux versions and you don't want to clash with files installed by linux-c7 packages. Reviewed by: bcr (manpages) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22574 Notes: svn path=/head/; revision=355818
* Add sync_file_range(2) implementation to linux(4); it's a thin wrapperEdward Tomasz Napierala2019-12-141-1/+0
| | | | | | | | | | | | | | over the usual fsync(2). This silences some warnings when running "apt-get upgrade". Reviewed by: brooks, emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22371 Notes: svn path=/head/; revision=355754
* Regen after r355752.Edward Tomasz Napierala2019-12-143-3/+30
| | | | | | | | | MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22371 Notes: svn path=/head/; revision=355753
* Fix definitions for linuxulator's sync_file_range(2).Edward Tomasz Napierala2019-12-141-1/+2
| | | | | | | | | | Reviewed by: brooks, emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22371 Notes: svn path=/head/; revision=355752
* Use 4 byte stack alignment instead of 8 byte.John Baldwin2019-12-091-4/+4
| | | | | | | | This was an old bug prior to r355373 and mostly harmless as it would waste at most a handful of bytes on the stack. Notes: svn path=/head/; revision=355569
* Copy out aux args after the argument and environment vectors.John Baldwin2019-12-091-8/+17
| | | | | | | | | | | | | | | | | | | | | | Partially revert r354741 and r354754 and go back to allocating a fixed-size chunk of stack space for the auxiliary vector. Keep sv_copyout_auxargs but change it to accept the address at the end of the environment vector as an input stack address and no longer allocate room on the stack. It is now called at the end of copyout_strings after the argv and environment vectors have been copied out. This should fix a regression in r354754 that broke the stack alignment for newer Linux amd64 binaries (and probably broke Linux arm64 as well). Reviewed by: kib Tested on: amd64 (native, linux64 (only linux-base-c7), and i386) Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D22695 Notes: svn path=/head/; revision=355567
* sysent: Reduce duplication and improve readability.Brooks Davis2019-12-061-4/+12
| | | | | | | | | | | | | Use the power of variable to avoid spelling out source and generated files too many times. The previous Makefiles were hard to read, hard to edit, and badly formatted. Reviewed by: kevans, emaste Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22714 Notes: svn path=/head/; revision=355473
* Use uintptr_t instead of register_t * for the stack base.John Baldwin2019-12-031-30/+36
| | | | | | | | | | | | | | | | | | | - Use ustringp for the location of the argv and environment strings and allow destp to travel further down the stack for the stackgap and auxv regions. - Update the Linux copyout_strings variants to move destp down the stack as was done for the native ABIs in r263349. - Stop allocating a space for a stack gap in the Linux ABIs. This used to hold translated system call arguments, but hasn't been used since r159992. Reviewed by: kib Tested on: md64 (amd64, i386, linux64), i386 (i386, linux) Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D22501 Notes: svn path=/head/; revision=355373
* Convert in-tree sysent targets to use new makesyscalls.luaKyle Evans2019-11-181-2/+4
| | | | | | | | | | | | flua is bootstrapped as part of the build for those on older versions/revisions that don't yet have flua installed. Once upgraded past r354833, "make sysent" will again naturally work as expected. Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D21894 Notes: svn path=/head/; revision=354835
* Check for errors from copyout() and suword*() in sv_copyout_args/strings.John Baldwin2019-11-181-23/+41
| | | | | | | | | | Reviewed by: brooks, kib Tested on: amd64 (amd64, i386, linux64), i386 (i386, linux) Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D22401 Notes: svn path=/head/; revision=354827
* Use a sv_copyout_auxargs hook in the Linux ELF ABIs.John Baldwin2019-11-151-23/+17
| | | | | | | | | | Reviewed by: emaste Tested on: amd64 (linux64 only), i386 Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D22356 Notes: svn path=/head/; revision=354754
* linux: futex_mtx should follow futex_listYuri Pankov2019-10-181-4/+0
| | | | | | | | | | | Move futex_mtx to linux_common.ko for amd64 and aarch64 along with respective list/mutex init/destroy. PR: 240989 Reported by: Alex S <iwtcex@gmail.com> Notes: svn path=/head/; revision=353725
* sysent: regenerate after r352693Kyle Evans2019-09-251-0/+7
| | | | Notes: svn path=/head/; revision=352694
* Update comments and ordering in linux*_dummy.cEd Maste2019-09-111-1/+1
| | | | | | | | | - sort alphabetically - getcpu arrived in Linux 2.6.19 - fanotify_* arrived in 2.6.36 Notes: svn path=/head/; revision=352224