summaryrefslogtreecommitdiff
path: root/sys/compat/linux/common
AgeCommit message (Collapse)Author
2022-12-24s/reqest/request/, s/requst/request/ and s/reuqest/request/ in comments.andvar
2022-05-22fix various small typos, mainly in comments.andvar
2022-05-20s/auxillary/auxiliary/ in comments.andvar
2021-12-02add prlimit64(2) syscall to COMPAT_LINUX and COMPAT_LINUX32ryo
2021-11-26The internal architecture name of golang is "arm" or "arm64", which hasryo
different naming conventions from netbsd's machine[] or machine_arch[] ("earmv7", "aarch64", etc.) and cannot be used as is. Instead, use define LINUX_GO_RT0_SIGNATURE_ARCH{32,64}.
2021-11-26- LINUX_GO_RT0_SIGNATURE for compat_linux is no longer enabled by default.ryo
it is now defined in each arch same as the other *_SIGNATURE definitions. - add new LINUX32_GO_RT0_SIGNATURE for compat_linux32, and is defined in amd64 and aarch64.
2021-11-25add support COMPAT_LINUX32 for aarch64ryo
2021-11-25- Add compat_linux statx(2) syscall.ryo
- The AT_EMPTY_PATH processing from the modification of sys/compat/linux/common/linux_file64.c r1.63 has been separated, and made common to linux_statat(), so that it can be used not only by linux32_sys_fstatat64() but also by other *statat() variants.
2021-11-25rename bsd_to_linux_stat() to bsd_to_linux_stat64() to avoid confusion.ryo
There is a static function with the same name in linux/common/linux_file.c. NFC.
2021-11-25rename bsd_to_linux_stat() to bsd_to_linux_stat64() to avoid confusion.ryo
There is a static function with the same name in linux/common/linux_file.c. NFC.
2021-11-23Make LINUX_FIOCLEX and LINUX_FIONCLEX workpho
These ioctls were declared in linux_termios.h but were not actually handled.
2021-11-01Use "stack_t" instead of "struct sigaltstack", as the former is thethorpej
newer standardized name. NFC.
2021-10-27Use __SIGTRAMP_SIGCODE_VERSION rather than hard-coding 0.thorpej
2021-09-23remove stray char.christos
2021-09-23add support COMPAT_LINUX for aarch64ryo
2021-09-21linux_sys_fstatat64: Add support for AT_EMPTY_PATH flag.rin
This is required for rtld shipped with glibc 2.33. Now, userland of Fedora 34 is working fine on NetBSD/amd64.
2021-09-20Add preadv(2) and pwritev(2) system calls to COMPAT_LINUX and COMPAT_LINUX32.thorpej
2021-09-20Add the eventfd system calls to COMPAT_LINUX and COMPAT_LINUX32.thorpej
2021-09-19Add the timerfd syscalls to COMPAT_LINUX and COMPAT_LINUX32.thorpej
2021-09-19Add the POSIX timer syscalls (timer_create(), timer_settime(), timer_gettime(),thorpej
timer_getoverrun(), and timer_delete()) to COMPAT_LINUX and COMPAT_LINUX32.
2021-09-19- LINUX_SIGEV_PAD is incorrect for 64-bit systems, because sigval_tthorpej
contains a pointer. Correct this. - Add routines to convert from Linux to native sigevent_t.
2021-09-07sys/compat: Memset zero before copyout.riastradh
Just in case of uninitialized padding which would lead to kernel stack disclosure. If the compiler can prove the memset redundant then it can optimize it away; otherwise better safe than sorry.
2020-12-04Rewrite linux_sys_alarm() to use dogetitimer() / dosetitimer(), ratherthorpej
than fiddling with process timers directly.
2020-11-03PR/55780: Bernd Sieker: setsockopt in Linux emulation misses some optionschristos
2020-10-24Fix compat with Linux programs that use longer namelen for socketsmgorny
Linux is less strict than NetBSD and permits namelen to be larger than valid struct sockaddr_in*. If this is the case, truncate the value to the correct size, so that NetBSD networking does not return an error. Reviewed by kamil
2020-07-16 Don't accept negative value.msaitoh
Reported-by: syzbot+e71a77402d6668f1868d@syzkaller.appspotmail.com
2020-06-11Counter tweaks:ad
- Don't need to count anonpages+filepages any more; clean+unknown+dirty for each kind of page can be summed to get the totals. - Track the number of free pages with a counter so that it's one less thing for the allocator to do, which opens up further options there. - Remove cpu_count_sync_one(). It has no users and doesn't save a whole lot. For the cheap option, give cpu_count_sync() a boolean parameter indicating that a cached value is okay, and rate limit the updates for cached values to hz.
2020-06-11uvm_availmem(): give it a boolean argument to specify whether a recentad
cached value will do, or if the very latest total must be fetched. It can be called thousands of times a second and fetching the totals impacts not only the calling LWP but other CPUs doing unrelated activity in the VM system.
2020-05-23Move proc_lock into the data segment. It was dynamically allocated becausead
at the time we had mutex_obj_alloc() but not __cacheline_aligned.
2020-05-14Fix previous; specify lwpid for curlpw in the case of pid == 0.rin
For linux_sys_sched_setaffinity, pid == 0 means the current thread. On the other hand, for our native sys_sched_setaffinity, lid == 0 means all lwp's that belong to the process.
2020-05-03Always clear FUTEX_PRIVATE_FLAG for Linux processes. NetBSD-native futexesthorpej
exist in different namespace depending on FUTEX_PRIVATE_FLAG. This appears not to be the case in Linux, and some futex users will mix private and non- private ops on the same futex object. Provide a convenience wrapper that puts this logic in one place witn a comment explaining why. While here, move the Linux futex wrapper out of its own file and plop it in linux_misc.c, which is where it lives in the linux32 module.
2020-04-29Fix proc lookup by distinguishing between the "tgid" and "tid" cases.thorpej
2020-04-29Fix proc / lwp lookup processing in linux_sys_sched_getaffinity()thorpej
and linux_sys_sched_setaffinity(). They were incorrect even before the LWP ID changes, but those changes exposed the latent bugs.
2020-04-29Oops, fix a silly mistake in the Linux futex syscall stubs -- we alsothorpej
copy in the timeout for FUTEX_WAIT_BITSET.
2020-04-26Add a NetBSD native futex implementation, mostly written by riastradh@.thorpej
Map the COMPAT_LINUX futex calls to the native ones.
2020-04-24Overhaul the way LWP IDs are allocated. Instead of each LWP having it'sthorpej
own LWP ID space, LWP IDs came from the same number space as PIDs. The lead LWP of a process gets the PID as its LID. If a multi-LWP process's lead LWP exits, the PID persists for the process. In addition to providing system-wide unique thread IDs, this also lets us eliminate the per-process LWP radix tree, and some associated locks. Remove the separate "global thread ID" map added previously; it is no longer needed to provide this functionality. Nudged in this direction by ad@ and chs@.
2020-04-19- Only increment nprocs when we're creating a new process, not justthorpej
when allocating a PID. - Per above, proc_free_pid() no longer decrements nprocs. It's now done in proc_free() right after proc_free_pid(). - Ensure nprocs is accessed using atomics everywhere.
2020-03-21Deal with having to teardown sysctl entries in multiple sub-trees.pgoyette
(This used to work, but I broke it recently.)
2020-03-16Use the module subsystem's ability to process SYSCTL_SETUP() entries topgoyette
automate installation of sysctl nodes. Note that there are still a number of device and pseudo-device modules that create entries tied to individual device units, rather than to the module itself. These are not changed.
2020-03-14- Hide the details of SPCF_SHOULDYIELD and related behind a couple of smallad
functions: preempt_point() and preempt_needed(). - preempt(): if the LWP has exceeded its timeslice in kernel, strip it of any priority boost gained earlier from blocking.
2020-03-08PR standards/44921: Add errno consts for robust mutexesmgorny
Add the two missing errno.h constants: EOWNERDEAD and ENOTRECOVERABLE. While technically they're used for robust mutexes which we do not support at the moment, they are listed in POSIX and used by libc++. While libc++ can be made to build without it, it just locally redefines the values then, so we may as well define them globally.
2020-02-15PR kern/54922: 9.99.45@20200202 panic: diagnostic assertion linux ldconfig ↵ad
triggers vpp != NULL in exit1()->radixtree.c line 674 Create an lwp_renumber() from the code in emulexec() and use in linux_e_proc_exec() and linux_e_proc_fork() too.
2020-01-12Tidy up the vnode locking around execve() on ELF images to acquire andad
release the locks fewer times. Proposed on tech-kern a very long time go.
2019-12-31Rename uvm_free() -> uvm_availmem().ad
2019-12-21uvmexp.free -> uvm_free()ad
2019-11-23Minor scheduler cleanup:ad
- Adapt to cpu_need_resched() changes. Avoid lost & duplicate IPIs and ASTs. sched_resched_cpu() and sched_resched_lwp() contain the logic for this. - Changes for LSIDL to make the locking scheme match the intended design. - Reduce lock contention and false sharing further. - Numerous small bugfixes, including some corrections for SCHED_FIFO/RT. - Use setrunnable() in more places, and merge cut & pasted code.
2019-11-09add dummy implementation of linux fallocate() which just returns EOPNOTSUPP;jdolecek
this is needed so that glibc falls back to emulation and apps behaving properly, since EOPNOTSUPP is a documented and expected return code, but ENOSYS is not right now there are no filesystems in NetBSD tree supporting the fallocate VOP, so no point trying to map this to a native call supposed to help with problem reported in https://mail-index.netbsd.org/tech-kern/2019/11/03/msg025641.html
2019-10-03Switch kevent udata from intptr_t void*kamil
Synchromize the struct field format with other BSDs and Darwin. No ABI change between older and newer struct form on the ports. The change will require no changes to most C users during the transition period as the header keeps a caller cast. Discussed with core@ and there were no objections for this move.
2019-09-20Avoid signed integer overflow when convering linux timeval to timespeckamil
Linux accepts garbage as timeout and attempts to set it to something meaningful. Instead of checking for valid ranges of usec, just convert the type safely, regardless of what is inside it.
2019-09-08Hum, remove incorrect assignment. Userland could have passed a smallermaxv
namelen, and the uninitialized bytes from sb_data were being used later in the network stack.