summaryrefslogtreecommitdiffstats
path: root/sys/amd64/linux32
Commit message (Collapse)AuthorAgeFilesLines
* Second-to-last commit implementing Capsicum capabilities in the FreeBSDrwatson2011-08-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | kernel for FreeBSD 9.0: Add a new capability mask argument to fget(9) and friends, allowing system call code to declare what capabilities are required when an integer file descriptor is converted into an in-kernel struct file *. With options CAPABILITIES compiled into the kernel, this enforces capability protection; without, this change is effectively a no-op. Some cases require special handling, such as mmap(2), which must preserve information about the maximum rights at the time of mapping in the memory map so that they can later be enforced in mprotect(2) -- this is done by narrowing the rights in the existing max_protection field used for similar purposes with file permissions. In namei(9), we assert that the code is not reached from within capability mode, as we're not yet ready to enforce namespace capabilities there. This will follow in a later commit. Update two capability names: CAP_EVENT and CAP_KEVENT become CAP_POST_KEVENT and CAP_POLL_KEVENT to more accurately indicate what they represent. Approved by: re (bz) Submitted by: jonathan Sponsored by: Google Inc
* Revert r220032:linux compat: add SO_PASSCRED option with basic handlingavg2011-03-311-1/+0
| | | | | | | | | | I have not properly thought through the commit. After r220031 (linux compat: improve and fix sendmsg/recvmsg compatibility) the basic handling for SO_PASSCRED is not sufficient as it breaks recvmsg functionality for SCM_CREDS messages because now we would need to handle sockcred data in addition to cmsgcred. And that is not implemented yet. Pointyhat to: avg
* linux compat: add SO_PASSCRED option with basic handlingavg2011-03-261-0/+1
| | | | | | | | This seems to have been a part of a bigger patch by dchagin that either haven't been committed or committed partially. Submitted by: dchagin, nox MFC after: 2 weeks
* linux compat: add non-dummy capget and capset system calls, regenerateavg2011-03-266-12/+38
| | | | | | | | | | And drop dummy definitions for those system calls. This may transiently break the build. PR: kern/149168 Submitted by: John Wehle <john@feith.com> Reviewed by: netchild MFC after: 2 weeks
* linux compat: add non-dummy capget and capset system callsavg2011-03-261-2/+4
| | | | | | | PR: kern/149168 Submitted by: John Wehle <john@feith.com> Reviewed by: netchild MFC after: 2 weeks
* Export the correct AT_PLATFORM value.dchagin2011-03-261-2/+1
| | | | | | | Since signal trampolines are copied to the shared page do not need to leave place on the stack for it. Forgotten in the previous commit. MFC after: 1 Week
* Enable shared page use for amd64/linux32 and i386/linux binaries.dchagin2011-03-132-16/+15
| | | | | | Move signal trampoline code from the top of the stack to the shared page. MFC after: 2 Weeks
* add DTrace systrace support for linux32 and freebsd32 on amd64 syscallsavg2011-03-125-3/+5431
| | | | | | | | | Regenerate system call and systrace support files. PR: kern/152822 Submitted by: Artem Belevich <fbsdlist@src.cx> Reviewed by: jhb (earlier version) MFC after: 3 weeks
* add DTrace systrace support for linux32 and freebsd32 on amd64 syscallsavg2011-03-123-5/+7
| | | | | | | | | | This commits makes necessary changes in syscall/sysent generation infrastructure. PR: kern/152822 Submitted by: Artem Belevich <fbsdlist@src.cx> Reviewed by: jhb (ealier version) MFC after: 3 weeks
* Extend struct sysvec with new method sv_schedtail, which is used for andchagin2011-03-081-4/+1
| | | | | | | | | | | | | | | explicit process at fork trampoline path instead of eventhadler(schedtail) invocation for each child process. Remove eventhandler(schedtail) code and change linux ABI to use newly added sysvec method. While here replace explicit comparing of module sysentvec structure with the newly created process sysentvec to detect the linux ABI. Discussed with: kib MFC after: 2 Week
* Remove dead code.dchagin2011-03-071-2/+0
| | | | MFC after: 1 Week
* For realtime signals fill the sigval value.dchagin2011-02-151-0/+1
|
* Sort include files in the alphabetical order.dchagin2011-02-131-1/+1
|
* Move linux_clone(), linux_fork(), linux_vfork() to a MI path.dchagin2011-02-122-242/+1
|
* In preparation for moving linux_clone() to a MI pathdchagin2011-02-122-1/+12
| | | | introduce linux_set_upcall_kse().
* In preparation for moving linux_clone () to a MI pathdchagin2011-02-121-40/+46
| | | | | | move the TLS code in a separate function. Use function parameter instead of direct using register.
* Regen for r218610.dchagin2011-02-123-4/+4
|
* The fourth argument of linux_clone is a pointer to the TLS. Change clone ↵dchagin2011-02-121-2/+1
| | | | syscall definition to match actual linux one.
* Regen for r218101.dchagin2011-01-301-3/+3
| | | | MFC after: 1 Month.
* Change linux futex syscall definition to match actual linux one.dchagin2011-01-301-2/+2
| | | | MFC after: 1 Month.
* The kern_wait() code already removes the SIGCHLD signal for the waiteddchagin2011-01-301-7/+0
| | | | | | | | | process. Removing other SIGCHLD signals is not needed and may cause problems. Pointed out by: jilles MFC after: 1 Month.
* My style(9) bug.dchagin2011-01-291-1/+3
| | | | | | Pointed out by: kib MFC after: 1 Month.
* Implement a variation of the linux_common_wait() which shoulddchagin2011-01-281-0/+43
| | | | | | | | | be used by linuxolator itself. Move linux_wait4() to MD path as it requires native struct rusage translation to struct l_rusage on linux32/amd64. MFC after: 1 Month.
* To avoid excessive code duplication move struct rusage translationdchagin2011-01-281-18/+23
| | | | | | to a separate function. MFC after: 1 Month.
* linux_sigreturn() loads the struct trapframe from l_sigcontextkib2011-01-271-22/+22
| | | | | | | | | | | | | | members, thus making a signed extension of 32 bit register context. If the register is not touched in usermode between return from signal and next syscall entry, the sign-extension part of 64bit register is not cleared, causing linux32_fetch_syscall_args() to read wrong values. Use unsigned type for the registers in the linux sigcontext. Reported by: Jacob Frelinger <jacob.frelinger duke edu>, arundel In collaboration with: dchagin MFC after: 1 week
* Add macro to test the sv_flags of any process. Change some places to testdchagin2011-01-261-1/+1
| | | | | | | the flags instead of explicit comparing with address of known sysentvec structures. MFC after: 1 month
* Remove redundant, bogus, and even harmful uses of setting TS bit in CR0.jkim2011-01-141-1/+1
| | | | | | | It is done from fpstate_drop() when it is really necessary. Reviewed by: kib MFC after: 1 week
* Improve PCB flags handling and make it more robust. Add two new functionsjkim2010-12-222-12/+15
| | | | | | | | | | | | | | | | for manipulating pcb_flags. These inline functions are very similar to atomic_set_char(9) and atomic_clear_char(9) but without unnecessary LOCK prefix for SMP. Add comments about the rationale[1]. Use these functions wherever possible. Although there are some places where it is not strictly necessary (e.g., a PCB is copied to create a new PCB), it is done across the board for sake of consistency. Turn pcb_full_iret into a PCB flag as it is safe now. Move rarely used fields before pcb_flags and reduce size of pcb_flags to one byte. Fix some style(9) nits in pcb.h while I am in the neighborhood. Reviewed by: kib Submitted by: kib[1] MFC after: 2 months
* Update some comments related to use of amd64 full context switch.kib2010-12-071-2/+2
| | | | | | | | | In exec_linux_setregs(), use locally cached pointer to pcb to set pcb_full_iret. In set_regs(), note that full return is needed when code that sets segment registers is enabled. MFC after: 1 week
* Retire write-only PCB_FULLCTX pcb flag on amd64.kib2010-12-071-1/+1
| | | | | | Reminded by: Petr Salinger <Petr.Salinger seznam cz> Tested by: pho MFC after: 1 week
* Add macro DECLARE_MODULE_TIED to denote a module as requiring thekib2010-10-121-1/+1
| | | | | | | | | | | | | | | kernel of exactly the same __FreeBSD_version as the headers module was compiled against. Mark our in-tree ABI emulators with DECLARE_MODULE_TIED. The modules use kernel interfaces that the Release Engineering Team feel are not stable enough to guarantee they will not change during the life cycle of a STABLE branch. In particular, the layout of struct sysentvec is declared to be not part of the STABLE KBI. Discussed with: bz, rwatson Approved by: re (bz, kensmith) MFC after: 2 weeks
* Regen.kib2010-10-083-4/+4
|
* Fix typo.kib2010-10-081-1/+1
| | | | | Submitted by: arundel MFC after: 3 days
* The interpreter name should no longer be treated as a buffer that can bealc2010-07-281-11/+5
| | | | | | overwritten. (This change should have been included in r210545.) Submitted by: kib
* Remove unneeded includes.kib2010-07-261-2/+0
| | | | | Submitted by: alc MFC after: 1 week
* Regenkib2010-07-233-5/+5
|
* Remove the linux_exec_copyin_args(), freebsd32_exec_copyin_args() maykib2010-07-232-101/+5
| | | | | | | server as well. COMPAT_FREEBSD32 is a prerequisite for COMPAT_LINUX32. Reviewed by: alc MFC after: 3 weeks
* Eliminate a little bit of duplicated code.alc2010-07-231-3/+1
|
* Regeneratekib2010-06-281-317/+317
|
* Do not require pos parameter to be zero in MAP_ANONYMOUS mmap requestskan2010-06-101-2/+6
| | | | | | | | | | in Linux emulation layer. Linux seems to only require that pos is page-aligned, but otherwise ignores it. Default FreeBSD mmap parameter checking is too strict to allow some Linux binaries to run. tsMuxeR is one example of such a binary. Discussed with: jhb MFC after: 1 week
* Reorganize syscall entry and leave handling.kib2010-05-231-16/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend struct sysvec with three new elements: sv_fetch_syscall_args - the method to fetch syscall arguments from usermode into struct syscall_args. The structure is machine-depended (this might be reconsidered after all architectures are converted). sv_set_syscall_retval - the method to set a return value for usermode from the syscall. It is a generalization of cpu_set_syscall_retval(9) to allow ABIs to override the way to set a return value. sv_syscallnames - the table of syscall names. Use sv_set_syscall_retval in kern_sigsuspend() instead of hardcoding the call to cpu_set_syscall_retval(). The new functions syscallenter(9) and syscallret(9) are provided that use sv_*syscall* pointers and contain the common repeated code from the syscall() implementations for the architecture-specific syscall trap handlers. Syscallenter() fetches arguments, calls syscall implementation from ABI sysent table, and set up return frame. The end of syscall bookkeeping is done by syscallret(). Take advantage of single place for MI syscall handling code and implement ptrace_lwpinfo pl_flags PL_FLAG_SCE, PL_FLAG_SCX and PL_FLAG_EXEC. The SCE and SCX flags notify the debugger that the thread is stopped at syscall entry or return point respectively. The EXEC flag augments SCX and notifies debugger that the process address space was changed by one of exec(2)-family syscalls. The i386, amd64, sparc64, sun4v, powerpc and ia64 syscall()s are changed to use syscallenter()/syscallret(). MIPS and arm are not converted and use the mostly unchanged syscall() implementation. Reviewed by: jhb, marcel, marius, nwhitehorn, stas Tested by: marcel (ia64), marius (sparc64), nwhitehorn (powerpc), stas (mips) MFC after: 1 month
* Rename st_*timespec fields to st_*tim for POSIX 2008 compliance.ed2010-03-281-9/+9
| | | | | | | | | | | | | | | A nice thing about POSIX 2008 is that it finally standardizes a way to obtain file access/modification/change times in sub-second precision, namely using struct timespec, which we already have for a very long time. Unfortunately POSIX uses different names. This commit adds compatibility macros, so existing code should still build properly. Also change all source code in the kernel to work without any of the compatibility macros. This makes it all a less ambiguous. I am also renaming st_birthtime to st_birthtim, even though it was a local extension anyway. It seems Cygwin also has a st_birthtim.
* Change the arguments of exec_setregs() so that it receives a pointernwhitehorn2010-03-251-9/+5
| | | | | | | | to the image_params struct instead of several members of that struct individually. This makes it easier to expand its arguments in the future without touching all platforms. Reviewed by: jhb
* Provide groundwork for 32-bit binary compatibility on non-x86 platforms,nwhitehorn2010-03-111-2/+2
| | | | | | | | | for upcoming 64-bit PowerPC and MIPS support. This renames the COMPAT_IA32 option to COMPAT_FREEBSD32, removes some IA32-specific code from MI parts of the kernel and enhances the freebsd32 compatibility code to support big-endian platforms. Reviewed by: kib, jhb
* Fix some problems with effective mmap() offsets > 32 bits. This wasjhb2009-10-281-36/+30
| | | | | | | | | | | | partially fixed on amd64 earlier. Rather than forcing linux_mmap_common() to use a 32-bit offset, have it accept a 64-bit file offset. This offset is then passed to the real mmap() call. Rather than inventing a structure to hold the normal linux_mmap args that has a 64-bit offset, just pass each of the arguments individually to linux_mmap_common() since that more closes matches the existing style of various kern_foo() functions. Submitted by: Christian Zander @ Nvidia MFC after: 1 week
* In r197963, a race with thread being selected for signal deliverykib2009-10-271-12/+6
| | | | | | | | | | | | | while in kernel mode, and later changing signal mask to block the signal, was fixed for sigprocmask(2) and ptread_exit(3). The same race exists for sigreturn(2), setcontext(2) and swapcontext(2) syscalls. Use kern_sigprocmask() instead of direct manipulation of td_sigmask to reschedule newly blocked signals, closing the race. Reviewed by: davidxu Tested by: pho MFC after: 1 month
* As jhb@ pointed out to me, r197057 was incorrect, not least because thesedes2009-09-101-0/+7
| | | | are generated files.
* Fix handling of .note.ABI-tag section for GNU systems [1].bz2009-08-241-5/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Handle GNU/Linux according to LSB Core Specification 4.0, Chapter 11. Object Format, 11.8. ABI note tag. Also check the first word of desc, not only name, according to glibc abi-tags specification to distinguish between Linux and kFreeBSD. Add explicit handling for Debian GNU/kFreeBSD, which runs on our kernels as well [2]. In {amd64,i386}/trap.c, when checking osrel of the current process, also check the ABI to not change the signal behaviour for Linux binary processes, now that we save an osrel version for all three from the lists above in struct proc [2]. These changes make it possible to run FreeBSD, Debian GNU/kFreeBSD and Linux binaries on the same machine again for at least i386 and amd64, and no longer break kFreeBSD which was detected as GNU(/Linux). PR: kern/135468 Submitted by: dchagin [1] (initial patch) Suggested by: kib [2] Tested by: Petr Salinger (Petr.Salinger seznam.cz) for kFreeBSD Reviewed by: kib MFC after: 3 days
* Restore the segment registers and segment base MSRs for amd64 syscallkib2009-07-091-0/+5
| | | | | | | | | | | | | | | | | return path only when neither thread was context switched while executing syscall code nor syscall explicitely modified LDT or MSRs. Save segment registers in trap handlers before interrupts are enabled, to not allow context switches to happen before registers are saved. Use separated byte in pcb for indication of fast/full return, since pcb_flags are not synchronized with context switches. The change puts back syscall microbenchmark numbers that were slowed down after commit of the support for LDT on amd64. Reviewed by: jeff Tested (and tested, and tested ...) by: pho Approved by: re (kensmith)
* Implement accept4 syscall.dchagin2009-06-011-0/+1
| | | | | Approved by: kib (mentor) MFC after: 1 month
OpenPOWER on IntegriCloud