Home | History | Annotate | Download | only in i386
History log of /src/sys/compat/linux/arch/i386/linux_machdep.c
RevisionDateAuthorComments
 1.169  01-Nov-2021  thorpej Use "stack_t" instead of "struct sigaltstack", as the former is the
newer standardized name. NFC.
 1.168  07-Sep-2021  riastradh sys/compat: Memset zero before copyout.

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.
 1.167  09-Aug-2021  andvar fix typos in asymmetry, asymmetric(al), symmetrical.
 1.166  19-May-2019  maxv branches: 1.166.2;
Rename

fpu_save_area_clear -> fpu_clear
fpu_save_area_reset -> fpu_sigreset

Clearer, and reduces a future diff. No real functional change.
 1.165  17-Sep-2017  maxv branches: 1.165.4;
Remove the second argument from USERMODE and KERNELMODE, it is unused
now that we don't have vm86 anymore.
 1.164  12-Aug-2017  maxv Remove vm86. Simplifies a number of critical places.

Pass 2.
 1.163  05-Feb-2017  maxv branches: 1.163.4; 1.163.6;
Rename ldt->ldtstore and gdt->gdtstore on i386. It reduces the diff with
amd64, and makes it easier to track down these variables on nxr - 'ldt'
and 'gdt' being common keywords.
 1.162  13-Jul-2016  maxv branches: 1.162.2; 1.162.4;
x86_alldisks can be NULL, so don't dereference it. Not tested, but obvious
enough.
 1.161  08-Dec-2015  christos Fix DIOCGPARTINFO
 1.160  08-Dec-2015  christos Replace DIOCGPART -> DIOCGPARTINFO which returns the data needed instead of
pointers.
 1.159  09-Nov-2014  maxv branches: 1.159.2;
Do not uselessly include <sys/malloc.h>.
 1.158  19-Feb-2014  dsl branches: 1.158.4;
Add explicit #include <x86/fpu.h> instead of relying on pcb.h including it.
 1.157  15-Feb-2014  dsl Remove all references to MDL_USEDFPU and deferred fpu initialisation.
The cost of zeroing the save area on exec is minimal.
This stops the FP registers of a random process being used the first
time an lwp uses the fpu.
sendsig_siginfo() and get_mcontext() now unconditionally copy the FP
registers.
I'll remove the double-copy for signal handlers soon.
get_mcontext() might have been leaking kernel memory to userspace - and
may still do so if i386_use_fxsave is false (short copies).
 1.156  26-Jan-2014  dsl Remove support for 'external' floating point units and the MS-DOS
compatible method of handling floating point exceptions.
Make kernel support for teh fpu non-optional (486SX should still work).
Only 386 cpus support external fpu, and i386 support was removed years ago.
This means that the npx code no longer uses port 0xf0 or interupt 13.
All the "npx at isa" lines go from the configs, arch/i386/isa/npx.c
is now mandatory for all i386 kernels.
I've renamed npxinit() to fpuinit() and npxinit_cpu() to fpuinit_cpu()
to match the very similar amd64 functions.
The fpu of the boot cpu is now initialised by a direct call from
cpu_configure(), this enables FP emulation for a 486SX.
(for amd64 the cr0 values are set in locore.S and similar).
This fixes a long-standing bug in linux_setregs() - which did not
save the fpu regsiters if they were active.
I've test booted a single cpu i386 kernel (using anita).
amd64 builds - none of teh changes should affect it.
The i386 XEN kernels build, but I'm not sure where they set cr0, and
it might have got lost!
 1.155  19-Jan-2014  dsl Flatten the floating point register structures bu moving the
'environment' registers into the main strcuture.
There are x87 instructions that only affect the environment, but that
is no real excuse for all the sub-structures.
Rename fields so that there are far fewer collisions between the two
sets of field names.
 1.154  09-Dec-2013  dsl Missing change to the fxsave structure rename
 1.153  01-Dec-2013  christos revert fpu/pcu changes until we figure out what's wrong; they cause random
freezes
 1.152  23-Oct-2013  drochner Use the MI "pcu" framework for bookkeeping of npx/fpu states on x86.
This reduces the amount of MD code enormously, and makes it easier
to implement support for newer CPU features which require more fpu
state, or for fpu usage by the kernel.
For access to FPU state across CPUs, an xcall kthread is used now
rather than a dedicated IPI.
No user visible changes intended.
 1.151  18-Nov-2011  christos branches: 1.151.10; 1.151.14;
- add sigtimedwait support.
- merge the siginfo population code.
 1.150  04-Mar-2011  joerg branches: 1.150.4;
Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.
 1.149  07-Jul-2010  chs branches: 1.149.2; 1.149.4;
many changes for COMPAT_LINUX:
- update the linux syscall table for each platform.
- support new-style (NPTL) linux pthreads on all platforms.
clone() with CLONE_THREAD uses 1 process with many LWPs
instead of separate processes.
- move the contents of sys__lwp_setprivate() into a new
lwp_setprivate() and use that everywhere.
- update linux_release[] and linux32_release[] to "2.6.18".
- adjust placement of emul fork/exec/exit hooks as needed
and adjust other emul code to match.
- convert all struct emul definitions to use named initializers.
- change the pid allocator to allow multiple pids to refer to the same proc.
- remove a few fields from struct proc that are no longer needed.
- disable the non-functional "vdso" code in linux32/amd64,
glibc works fine without it.
- fix a race in the futex code where we could miss a wakeup after
a requeue operation.
- redo futex locking to be a little more efficient.
 1.148  03-Feb-2010  wiz branches: 1.148.2; 1.148.4;
Remove extra parenthesis. Found by cppcheck, reported by
Henning Petersen in PR 42732.
 1.147  05-Jan-2010  mbalmer Remove extra semicolon.
 1.146  23-Nov-2009  rmind Use lwp_getpcb() in compat code, clean from struct user.
 1.145  29-May-2009  njoly Add native to linux siginfo si_status translation, used on i386 and
amd64.
 1.144  23-Apr-2009  njoly Convert si_code value from native to linux.
 1.143  21-Mar-2009  ad PR port-i386/40143 Viewing an mpeg transport stream with mplayer causes crash

Fix numerous problems:

1. LDT updates are not atomic.

2. Number of processes running with private LDTs and/or I/O bitmaps
is not capped. System with high maxprocs can be paniced.

3. LDTR can be leaked over context switch.

4. GDT slot allocations can race, giving the same LDT slot to two procs.

5. Incomplete interrupt/trap frames can be stacked.

6. In some rare cases segment faults are not handled correctly.
 1.142  11-Jan-2009  christos branches: 1.142.2;
merge christos-time_t
 1.141  25-Oct-2008  christos branches: 1.141.2; 1.141.4; 1.141.6;
Add preliminary tls support for i386. Does not work yet. From FreeBSD.
 1.140  21-Oct-2008  njoly Do not use native_to_linux_si_code() outside LINUX_NPTL; until i
figure a better way to handle it.
 1.139  19-Oct-2008  njoly Add native to linux siginfo si_code translation, mostly for negative
values. Adjust amd64 and i386 accordingly, not sure about aother archs
i can't test.
 1.138  18-Sep-2008  christos Define a PSL_CLEARSIG macro for the psl flags to be cleared on signal delivery
and use it everywhere.
 1.137  19-May-2008  njoly branches: 1.137.4;
Fix free() argument in linux_read_ldt.
 1.136  28-Apr-2008  martin branches: 1.136.2;
Remove clause 3 and 4 from TNF licenses
 1.135  24-Apr-2008  ad branches: 1.135.2;
Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since
we no longer need to guard against access from hardware interrupt handlers.

Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the
child process share the parent's lock so that signal state may be kept in
sync. Partially addresses PR kern/37437.
 1.134  21-Mar-2008  ad branches: 1.134.2;
Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
 1.133  20-Dec-2007  dsl branches: 1.133.6;
Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.132  08-Dec-2007  dsl branches: 1.132.4;
ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.131  04-Dec-2007  dsl Remove all the __P
 1.130  19-Oct-2007  ad branches: 1.130.2; 1.130.4;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.129  30-Jun-2007  dsl branches: 1.129.6; 1.129.8; 1.129.12;
Call fp->f_ops->fo_ioctl() directly (not by sys_ioctl() for LINUX_VT_GETMODE
and LINUX_VT_SETMODE. One fewer use of the stackgap.
 1.128  23-Jun-2007  dsl Read and write the ldt without using the stackgap.
 1.127  13-Jun-2007  christos Get ready for NPTL but don't turn it on as of yet.
 1.126  21-May-2007  christos rename si_sigval -> si_value to match POSIX RTS.
 1.125  10-May-2007  christos - linux uname -m on x86 returns i{3,4,5,6}86 make it so.
- delete the machine sysctl that never worked, and gc linux_machine.
 1.124  16-Apr-2007  ad Share the sysarch stuff between the x86 ports. PR kern/36046.
 1.123  04-Mar-2007  christos branches: 1.123.2; 1.123.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.122  09-Feb-2007  ad branches: 1.122.2;
Merge newlock2 to head.
 1.121  29-Jan-2007  hubertf Remove more duplicate headers.
Patch by Slava Semushin <slava.semushin@gmail.com>

Again, this was tested by comparing obj files from a pristine and a patched
source tree against an i386/ALL kernel, and also for src/sbin/fsck_ffs,
src/sbin/fsdb and src/usr.sbin/makefs. Only changes in assert() line numbers
were detected in 'objdump -d' output.
 1.120  26-Dec-2006  elad Adapt to recent machdep scope changes.

Pointed out by Kouichirou Hiratsuka, thanks!
 1.119  16-Nov-2006  christos branches: 1.119.2;
__unused removal on arguments; approved by core.
 1.118  14-Nov-2006  elad Clean some KAUTH_GENERIC_ISSUSER usage in compat code.
 1.117  14-Oct-2006  christos sprinkle __unused.
 1.116  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.115  13-Sep-2006  christos branches: 1.115.2;
avoid empty if
 1.114  23-Jul-2006  ad branches: 1.114.4;
Use the LWP cached credentials where sane.
 1.113  14-May-2006  elad integrate kauth.
 1.112  11-Dec-2005  christos branches: 1.112.4; 1.112.6; 1.112.8; 1.112.10; 1.112.12;
merge ktrace-lwp.
 1.111  21-Aug-2005  yamt linux_machdepioctl: remove duplicated FILE_USE/UNUSE.
 1.110  25-Jun-2005  christos branches: 1.110.2;
- include <sys/wait.h> so that this compile
- use the code field directly, instead of redoing the logic.
- XXX: the status field must be wrong. I think that the _WSTATUS()
should not be used directly.
 1.109  24-Jun-2005  manu More accurate SIGCHLD code and status for siginfo
 1.108  22-Jun-2005  manu report the right process status
 1.107  20-May-2005  fvdl Define linux_usertrap function, and set it in struct emul. For all
but amd64, it just returns 0, doing nothing.

For amd64, it implements vsyscalls through cheating: if the faulting
address is in the vsyscall area (which is statically known on Linux/amd64),
and the intruction pointer is too, it must have been a vsyscall. In that
case, retrieve the return address from the user stack, fix up %rip and
%rsp, and just execute the normal system call. It will return as if
the vsyscall has been executed.
 1.106  26-Feb-2005  perry branches: 1.106.2;
nuke trailing whitespace
 1.105  13-Nov-2004  christos branches: 1.105.4; 1.105.6;
Remove setup stack function. It moved to linux_exec_machdep.c.
 1.104  13-Nov-2004  christos Add ptyfs pty device number translation.
 1.103  20-Oct-2004  thorpej Move boot device detection code from i386 and amd64 ports to x86_autoconf.c.
Rename i386_alldisks and x86_64_alldisks to x86_alldisks, adjust other
references to compensate.
 1.102  28-Jan-2004  yamt rename i386 mdlwp flags from MDP_ to MDL_
to avoid confusion with mdproc flags which also have MDP_ prefixes.
 1.101  08-Dec-2003  christos remove error(1) comment.
 1.100  06-Oct-2003  christos Catch up with chuck's stack changes. Don't map the linux stuff executable
and avoid mapping segments that have 0 size.
 1.99  25-Sep-2003  christos constify sendsig/trapsignal
 1.98  21-Sep-2003  jdolecek make compile after last change (!)
 1.97  21-Sep-2003  christos Now that we have siginfo, use it, instead of pretending to have one.
 1.96  06-Sep-2003  christos SA_SIGINFO changes
 1.95  24-Aug-2003  chs add support for non-executable mappings (where the hardware allows this)
and make the stack and heap non-executable by default. the changes
fall into two basic catagories:

- pmap and trap-handler changes. these are all MD:
= alpha: we already track per-page execute permission with the (software)
PG_EXEC bit, so just have the trap handler pay attention to it.
= i386: use a new GDT segment for %cs for processes that have no
executable mappings above a certain threshold (currently the
bottom of the stack). track per-page execute permission with
the last unused PTE bit.
= powerpc/ibm4xx: just use the hardware exec bit.
= powerpc/oea: we already track per-page exec bits, but the hardware only
implements non-exec mappings at the segment level. so track the
number of executable mappings in each segment and turn on the no-exec
segment bit iff the count is 0. adjust the trap handler to deal.
= sparc (sun4m): fix our use of the hardware protection bits.
fix the trap handler to recognize text faults.
= sparc64: split the existing unified TSB into data and instruction TSBs,
and only load TTEs into the appropriate TSB(s) for the permissions.
fix the trap handler to check for execute permission.
= not yet implemented: amd64, hppa, sh5

- changes in all the emulations that put a signal trampoline on the stack.
instead, we now put the trampoline into a uvm_aobj and map that into
the process separately.

originally from openbsd, adapted for netbsd by me.
 1.94  21-Aug-2003  hannken Fix syscall_vm86 argument:
struct trapframe -> struct trapframe *
 1.93  09-Aug-2003  christos Explain a diagnostic message a bit better, and make it a debug only message.
 1.92  08-Aug-2003  christos - GC all the setup_stack functions
- add one for linux/i386
 1.91  02-Aug-2003  jdolecek use copyout() instead of subyte()
 1.90  03-Jul-2003  christos Implement linux_rt_sigreturn for real. Add a hack for more plausible siginfo.
The java segv handler still segv's again inside the signal handler, but our
sample test program now works [gets the proper ucontext].
 1.89  29-Jun-2003  fvdl branches: 1.89.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.88  28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.87  21-Mar-2003  dsl Change 'data' argument to fo_ioctl and fo_fcntl from 'caddr_t' to 'void *'.
Avoids a lot of casting and removes the need for some line breaks.
Removed a load of (caddr_t) casts from calls to copyin/copyout as well.
(approved by christos - he has a plan to remove caddr_t...)
 1.86  27-Feb-2003  yamt make compat_linux struct file interlock friendly.
 1.85  18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.84  06-Dec-2002  junyoung Fix compile error.
 1.83  06-Dec-2002  christos add a linux_rt_sigframe to support SA_SIGINFO, and use it when SA_SIGINFO
is requested. This appears to be how linuxthreads decides which signal handler
to use.
 1.82  26-Nov-2002  christos rename sa_ -> linux_sa_
first attempt at providing siginfo_t to the signal handler.
 1.81  09-Oct-2002  junyoung Get rid of pcb_flags which is no longer existent.
 1.80  25-Sep-2002  thorpej Don't include <sys/map.h>.
 1.79  06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.78  04-Jul-2002  thorpej Add kernel support for having userland provide the signal trampoline:

* struct sigacts gets a new sigact_sigdesc structure, which has the
sigaction and the trampoline/version. Version 0 means "legacy kernel
provided trampoline". Other versions are coordinated with machine-
dependent code in libc.
* sigaction1() grows two more arguments -- the trampoline pointer and
the trampoline version.
* A new __sigaction_sigtramp() system call is provided to register a
trampoline along with a signal handler.
* The handler is no longer passed to sensig() functions. Instead,
sendsig() looks up the handler by peeking in the sigacts for the
process getting the signal (since it has to look in there for the
trampoline anyway).
* Native sendsig() functions now select the appropriate trampoline and
its arguments based on the trampoline version in the sigacts.

Changes to libc to use the new facility will be checked in later. Kernel
version not bumped; we will ride the 1.6C bump made recently.
 1.77  20-May-2002  jdolecek Fix bug introduced in rev. 1.69 - linux_fakedev() returned always
zero for nontranslated raw devices.
This fixes recently discovered jdb /dev/dsp stdin problem, reported
on current-users by Mark Davies.
 1.76  13-May-2002  simonb branches: 1.76.2;
Remove an unreachable "return 0;".
 1.75  02-Apr-2002  christos save/restore fs and gs; this should be pulled up.
 1.74  31-Mar-2002  christos make signal array handling uniform, and put signal arrays in a separate
file. This is simular to errno array handling.
 1.73  29-Mar-2002  christos 1. fill in the ldt.sd_xx field, for total compat with linux.
2. in setregs, use gdt's instead of ldt's because linux wants to play with
all the ldts. Apparently linuxthreads uses ldt's to allocate space for
pthread_t's.
 1.72  22-Mar-2002  christos sync with current reality and fix debugging.
 1.71  16-Mar-2002  christos make the stackgap_{init,alloc} functions MP friendly (i.e. pass struct proc *
in, instead of using curproc). While there add an optional size argument to
stackgap_init.
 1.70  16-Feb-2002  christos 1. load cr2 now that we have it.
2. ldt_info.base_addr == 0 && ldt_info.limit == 0 means zero the ldt
From Robert V. Barron's wabi patch.
 1.69  15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.68  13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.67  02-Aug-2001  thorpej Deal with the SSE FPU save format.
 1.66  15-Jul-2001  jdolecek execute signal handlers on separate signal stack, if it's been provided
 1.65  17-Jun-2001  sommerfeld branches: 1.65.2;
Add %fs/%gs to trap frame and save/restore them on
trap/interrupt/syscall entry from userspace.

Remove special-case "by hand" validation of fs/gs register values as
well as special handling of them in various signal handling paths.

Now, like %ds and %es, they are validated by the hardware on return to
userland.

This paves the way for the use of %fs for per-cpu data on
multiprocessor systems, and fixes an otherwise difficult-to-fix
interaction between threads/clone(2) and USER_LDT.

Discussed in advance with Frank van der Linden.
 1.64  14-Jun-2001  thorpej Fix a partial construction problem that can cause race conditions
between creation of a file descriptor and close(2) when using kernel
assisted threads. What we do is stick descriptors in the table, but
mark them as "larval". This causes essentially everything to treat
it as a non-existent descriptor, except for fdalloc(), which sees a
filled slot so that it won't (incorrectly) allocate it again. When
a descriptor is fully constructed, the code that has constructed it
marks it as "mature" (which actually clears the "larval" flag), and
things continue to work as normal.

While here, gather all the code that gets a descriptor from the table
into a fd_getfile() function, and call it, rather than having the
same (sometimes incorrect) code copied all over the place.
 1.63  30-May-2001  mrg use _KERNEL_OPT.
 1.62  26-Jan-2001  manu branches: 1.62.2;
Moved include <sys/ioctl.h> so that we can build without WSCONS enabled.
 1.61  18-Jan-2001  jdolecek constify
 1.60  18-Jan-2001  fvdl EINVAL -> ENOTTY
 1.59  09-Jan-2001  fvdl Add emulation of KIOCSOUND.
 1.58  29-Dec-2000  fvdl Implement KDGETMODE ioctl.
 1.57  29-Dec-2000  fvdl Under Linux it's possible to return values through the ioctl system
call directly (i.e. not a reference argument, but a direct return
value). So far I have only seen this with binaries that talk
to their own device modules, using non-standard ioctl calls.
Hence, allow for a pass-through ioctl call using PTIOCLINUX to
return EJUSTRETURN, signalling that the return value is in
the 'data' field of the structure, which can then be put in 'retval'.
 1.56  22-Dec-2000  jdolecek split off thread specific stuff from struct sigacts to struct sigctx, leaving
only signal handler array sharable between threads
move other random signal stuff from struct proc to struct sigctx

This addresses kern/10981 by Matthew Orgass.
 1.55  18-Dec-2000  fvdl For unknown ioctls, pass them through to a device using PTIOCLINUX,
so that it may deal with them if it knows them (i.e. LKMs which
deal with Linux binaries).
 1.54  12-Dec-2000  fvdl Allow for passing through of certain ranges of ioctl command values
directly to a device. The device has to be aware of how to handle
with these special ioctls. Useful for LKMs that deal with Linux
binaries.
 1.53  10-Dec-2000  thorpej Fix previous:
- EBADF, not NULL when a file descriptor can't be found.
- Check FIF_WANTCLOSE properly.
 1.52  10-Dec-2000  fvdl Add i386-specific code for a few ioctl calls.
 1.51  29-Nov-2000  jdolecek LKMify
 1.50  11-Jun-2000  veego branches: 1.50.2;
Remove the pcvt support.
 1.49  15-May-2000  jhawk branches: 1.49.2;
Remove conditionization upon XSERVER -- all the code
so conditionalized is already conditionalized on (NWSDISPLAY > 0),
so is wscons-specific. wscons has no conditionalization on XSERVER;
neither should the linux compatibility code.

Removing this is necessary to keep linux X server emulation functionining
after GENERIC rev 1.337 removing "options XSERVER" (relegating it
to the pccons/pcvt-specific, and therefore depricated).
 1.48  30-Mar-2000  augustss Kill register declarations.
 1.47  04-Oct-1999  fvdl branches: 1.47.2;
Handle the newer, larger sigset_t Linux now uses.
 1.46  08-Jan-1999  kleink Rearrange the emulation-specific setregs() entry to set up the FPU control
word *after* calling the native setregs(), which would clobber it again.
 1.45  04-Oct-1998  fvdl Assign my copyright to TNF. Merge with others were appropriate.
Regen syscall files after script change.
 1.44  03-Oct-1998  christos Attempt to fix the mess.
 1.43  01-Oct-1998  erh Moved here from arch/i386/i386/linux_machdep.c.
 1.42  11-Sep-1998  mycroft Substantial signal handling changes:
* Increase the size of sigset_t to accomodate 128 signals -- adding new
versions of sys_setprocmask(), sys_sigaction(), sys_sigpending() and
sys_sigsuspend() to handle the changed arguments.
* Abstract the guts of sys_sigaltstack(), sys_setprocmask(), sys_sigaction(),
sys_sigpending() and sys_sigsuspend() into separate functions, and call them
from all the emulations rather than hard-coding everything. (Avoids uses
the stackgap crap for these system calls.)
* Add a new flag (p_checksig) to indicate that a process may have signals
pending and userret() needs to do the full (slow) check.
* Eliminate SAS_ALTSTACK; it's exactly the inverse of SS_DISABLE.
* Correct emulation bugs with restoring SS_ONSTACK.
* Make the signal mask in the sigcontext always use the emulated mask format.
* Store signals internally in sigaction structures, rather than maintaining a
bunch of little sigsets for each SA_* bit.
* Keep track of where we put the signal trampoline, rather than figuring it out
in *_sendsig().
* Issue a warning when a non-emulated sigaction bit is observed.
* Add missing emulated signals, and a native SIGPWR (currently not used).
* Implement the `not reset when caught' semantics for relevant signals.

Note: Only code touched by the i386 port has been modified. Other ports and
emulations need to be updated.
 1.41  11-Jun-1998  drochner Since wscons can support VT_xxx ioctl()s, enable them if NWSDISPLAY > 0.
Implement KDGKBTYPE and KDGKBENT, this will make X servers happy.
 1.40  08-May-1998  kleink Fix some arithmetics lossage on typeless pointers.
 1.39  24-Jan-1998  mycroft Store the initial NPX control word appropriate for the emulation in the saved
FPU state, and use it when initializing the FPU on demand.
 1.38  24-Jan-1998  mycroft Need foo_exec.h.
 1.37  24-Jan-1998  mycroft Add local versions of setregs(), so I can tweak some registers later.
 1.36  22-Jan-1998  thorpej Generate dependencies on the USER_LDT option.
 1.35  15-Jan-1998  thorpej Generate dependencies on the VM86 option.
 1.34  16-Oct-1997  mycroft branches: 1.34.2;
Pull in vmparam.h as necessary.
 1.33  29-Oct-1996  sommerfe branches: 1.33.12;
Workaround for building linux-emulation LKM.
 1.32  13-Oct-1996  christos backout previous kprintf changes
 1.31  12-Oct-1996  thorpej Need <sys/exec.h> for the PS_STRINGS definition.
 1.30  11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.29  03-May-1996  christos Prototype and gcc -Wall cleanups
 1.28  18-Apr-1996  mycroft Turn off the alignment check flag when entering a signal handler.
 1.27  12-Apr-1996  mycroft Turn off the trace flag when delivering a signal.
 1.26  11-Apr-1996  mycroft Export [gs]et_vflags(), and always use them when saving/restoring registers
in VM86 mode.
Allow changing of *all* PSL bits in VM86 mode; some applications don't work
right otherwise, and all the nasty bits are virtualized anyway.
Make sure PSL_VIF, PSL_VIP, and PSL_VM don't show up in the user's view of
the PSL.
 1.25  08-Mar-1996  mycroft Add a message to help us debug Linux compat.
 1.24  04-Jan-1996  jtc Changed name of sigaltstack's ss_base field to ss_sp to match XPG4.2 and
traditional usage.
 1.23  10-Oct-1995  mycroft Switch to user code and data selectors in the GDT while handling signals.
 1.22  10-Oct-1995  mycroft Add USERMODE() and KERNELMODE() macros, and use them.
 1.21  08-Oct-1995  fvdl Implement the KDGKBMODE ioctl for Linux (possible with pcvt 3.32).
 1.20  07-Oct-1995  mycroft Prefix names of system call implementation functions with `sys_'.
 1.19  19-Sep-1995  thorpej Make system calls conform to a standard prototype and bring those
prototypes into scope.
 1.18  08-Sep-1995  fvdl Fix PR #1445 (incorrect ifdef/else/endif), from Bill Sommerfeld via
John Kohl.
 1.17  07-Sep-1995  fvdl Get notion of VT number right.
 1.16  01-Sep-1995  mycroft SA_ONSTACK --> SS_ONSTACK
 1.15  31-Aug-1995  fvdl Only define some vars (one of pcvt-specific type) when pcvt is configured.
Fixes PR #1424 (from Mike Long)
 1.14  30-Aug-1995  fvdl Remove VT-switch disabling hack now that pcvt handles this.
 1.13  27-Aug-1995  fvdl Add some yucky code to emulate Linux VTs well enough to make svgalib
stuff work reasonably well.
 1.12  14-Aug-1995  mycroft Export bsd_to_linux_sig[], and use it.
 1.11  14-Aug-1995  mycroft Rearrange #includes.
 1.10  24-Jun-1995  christos Stackgap_init() now takes an p->p_emul argument.
 1.9  22-Jun-1995  fvdl Include file change.
 1.8  07-May-1995  mycroft Turn off a debugging printf().
 1.7  07-May-1995  mycroft Improve Linux signal emulation, and emulate the modify_ldt() call.
 1.6  06-May-1995  mycroft Add stub for linux_modify_ldt().
 1.5  01-May-1995  mycroft Fix typos.
 1.4  01-May-1995  mycroft Save and restore %fs and %gs across signals.
 1.3  01-May-1995  mycroft Update to match include files. Eliminate _ucodesel, _udatasel, and IdlePTD.
 1.2  22-Apr-1995  christos - added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.
 1.1  07-Apr-1995  fvdl Changes because of proper Linux signal stackframe building, and
seperate signal trampoline code. Ugly hack in trap.c no longer
needed.
 1.33.12.1  08-Sep-1997  thorpej Significantly restructure the way signal state for a process is stored.
Rather than using bitmasks to redundantly store the information kept
in the process's sigacts (because the sigacts was kept in the u-area),
hang sigacts directly off the process, and access it directly.

Simplify signal setup code tremendously by storing information in
the sigacts as an array of struct sigactions, rather than in a different
format, since userspace uses sigactions.

Make sigacts sharable by adding reference counting.
 1.34.2.1  29-Jan-1998  mellon Pull up 1.37-1.39 (mycroft)
 1.47.2.6  11-Feb-2001  bouyer Sync with HEAD.
 1.47.2.5  18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.47.2.4  05-Jan-2001  bouyer Sync with HEAD
 1.47.2.3  13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.47.2.2  08-Dec-2000  bouyer Sync with HEAD.
 1.47.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.49.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.50.2.4  03-Apr-2002  he Pull up revision 1.75 (requested by christos):
Fix restoral of %fs / %gs in i386 emulation code.
 1.50.2.3  17-Jun-2001  he Pull up revision 1.65 (requested by sommerfeld):
Add %fs/%gs to trap frame and save/restore them on trap/interupt/
syscall entry from userspace.

Remove special-case ``by hand'' validation of %fs/%gs register
values s well as special handling of them in various signal
handling paths. Now, like %ds and %es, they are validated by
the hardware on return to userland.

This paves the way for the use of %fs for per-cpu data on multi-
processor systems, and fixes an otherwise difficult-to-fix
interaction between threads/clone(2) and USER_LDT.
 1.50.2.2  15-May-2001  he Pull up revision 1.62 (requested by drochner):
Fix a build problem where COMPAT_LINUX is defined, but wscons is
not present. Fixes PR#12886.
 1.50.2.1  30-Mar-2001  he Pull up revisions 1.52-1.60 (via patch, requested by fvdl):
Add some required Linux emulation bits to support the Linux
version of VMware.
 1.62.2.16  11-Dec-2002  thorpej Sync with HEAD.
 1.62.2.15  18-Oct-2002  nathanw Catch up to -current.
 1.62.2.14  17-Sep-2002  nathanw Catch up to -current.
 1.62.2.13  01-Aug-2002  nathanw Catch up to -current.
 1.62.2.12  12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.62.2.11  24-Jun-2002  nathanw Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.62.2.10  20-Jun-2002  nathanw Catch up to -current.
 1.62.2.9  29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.62.2.8  17-Apr-2002  nathanw Catch up to -current.
 1.62.2.7  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.62.2.6  28-Feb-2002  nathanw p->p_addr ==> l->l_addr
 1.62.2.5  28-Feb-2002  nathanw Catch up to -current.
 1.62.2.4  14-Nov-2001  nathanw Catch up to -current.
 1.62.2.3  24-Aug-2001  nathanw Catch up with -current.
 1.62.2.2  21-Jun-2001  nathanw Catch up to -current.
 1.62.2.1  05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.65.2.6  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.65.2.5  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.65.2.4  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.65.2.3  16-Mar-2002  jdolecek Catch up with -current.
 1.65.2.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.65.2.1  03-Aug-2001  lukem update to -current
 1.76.2.3  15-Jul-2002  gehenna catch up with -current.
 1.76.2.2  30-May-2002  gehenna Catch up with -current.
 1.76.2.1  16-May-2002  gehenna Replace the direct-access to devsw table with calling devsw API.
Replace the block major -> name conversion function with devsw API.
 1.89.2.8  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.89.2.7  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.89.2.6  14-Nov-2004  skrll Sync with HEAD.
 1.89.2.5  02-Nov-2004  skrll Sync with HEAD.
 1.89.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.89.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.89.2.2  03-Aug-2004  skrll Sync with HEAD
 1.89.2.1  02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.105.6.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.105.4.1  29-Apr-2005  kent sync with -current
 1.106.2.1  28-Aug-2005  tron Pull up following revision(s) (requested by yamt in ticket #701):
sys/compat/linux/arch/i386/linux_machdep.c: revision 1.111
linux_machdepioctl: remove duplicated FILE_USE/UNUSE.
 1.110.2.8  24-Mar-2008  yamt sync with head.
 1.110.2.7  21-Jan-2008  yamt sync with head
 1.110.2.6  07-Dec-2007  yamt sync with head
 1.110.2.5  27-Oct-2007  yamt sync with head.
 1.110.2.4  03-Sep-2007  yamt sync with head.
 1.110.2.3  26-Feb-2007  yamt sync with head.
 1.110.2.2  30-Dec-2006  yamt sync with head.
 1.110.2.1  21-Jun-2006  yamt sync with head.
 1.112.12.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.112.10.3  06-May-2006  christos - Move kauth_cred_t declaration to <sys/types.h>
- Cleanup struct ucred; forward declarations that are unused.
- Don't include <sys/kauth.h> in any header, but include it in the c files
that need it.

Approved by core.
 1.112.10.2  10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.112.10.1  08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.112.8.3  14-Sep-2006  yamt sync with head.
 1.112.8.2  11-Aug-2006  yamt sync with head
 1.112.8.1  24-May-2006  yamt sync with head.
 1.112.6.1  01-Jun-2006  kardel Sync with head.
 1.112.4.1  09-Sep-2006  rpaulo sync with head
 1.114.4.7  01-Feb-2007  ad Sync with head.
 1.114.4.6  30-Jan-2007  ad Remove support for SA. Ok core@.
 1.114.4.5  19-Jan-2007  ad Fix Linux compatability for i386, others to follow later.
 1.114.4.4  18-Jan-2007  yamt linux_restore_sigcontext: fix an unused variable in the case of !VM86.
 1.114.4.3  12-Jan-2007  ad Sync with head.
 1.114.4.2  18-Nov-2006  ad Sync with head.
 1.114.4.1  24-Oct-2006  ad - Redo LWP locking slightly and fix some races.
- Fix some locking botches.
- Make signal mask / stack per-proc for SA processes.
- Add _lwp_kill().
 1.115.2.2  10-Dec-2006  yamt sync with head.
 1.115.2.1  22-Oct-2006  yamt sync with head
 1.119.2.1  06-Jan-2007  bouyer Pull up following revision(s) (requested by elad in ticket #317):
sys/compat/linux/arch/i386/linux_machdep.c: revision 1.120
sys/dev/wscons/wsdisplay_compat_usl.c: revision 1.38
Adapt to recent machdep scope changes.
Pointed out by Kouichirou Hiratsuka, thanks!
 1.122.2.3  17-May-2007  yamt sync with head.
 1.122.2.2  07-May-2007  yamt sync with head.
 1.122.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.123.4.1  11-Jul-2007  mjf Sync with head.
 1.123.2.3  23-Oct-2007  ad Sync with head.
 1.123.2.2  15-Jul-2007  ad Sync with head.
 1.123.2.1  27-May-2007  ad Sync with head.
 1.129.12.1  25-Oct-2007  bouyer Sync with HEAD.
 1.129.8.2  09-Jan-2008  matt sync with HEAD
 1.129.8.1  06-Nov-2007  matt sync with HEAD
 1.129.6.2  09-Dec-2007  jmcneill Sync with HEAD.
 1.129.6.1  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.130.4.2  26-Dec-2007  ad Sync with head.
 1.130.4.1  08-Dec-2007  ad Sync with head.
 1.130.2.2  27-Dec-2007  mjf Sync with HEAD.
 1.130.2.1  08-Dec-2007  mjf Sync with HEAD.
 1.132.4.1  02-Jan-2008  bouyer Sync with HEAD
 1.133.6.4  17-Jan-2009  mjf Sync with HEAD.
 1.133.6.3  28-Sep-2008  mjf Sync with HEAD.
 1.133.6.2  02-Jun-2008  mjf Sync with HEAD.
 1.133.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.134.2.2  04-Jun-2008  yamt sync with head
 1.134.2.1  18-May-2008  yamt sync with head.
 1.135.2.5  11-Aug-2010  yamt sync with head.
 1.135.2.4  11-Mar-2010  yamt sync with head
 1.135.2.3  20-Jun-2009  yamt sync with head
 1.135.2.2  04-May-2009  yamt sync with head.
 1.135.2.1  16-May-2008  yamt sync with head.
 1.136.2.5  24-Sep-2008  wrstuden Merge in changes between wrstuden-revivesa-base-2 and
wrstuden-revivesa-base-3.
 1.136.2.4  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.136.2.3  14-May-2008  wrstuden Per discussion with ad at n dot o, revert signal mask handling
changes.

The l_sigstk changes are most likely totally un-needed as SA will
never use a signal stack - we send an upcall (or will as other
diffs are brought in).

The l_sigmask changes were too controvertial. In all honesty, I
think it's probably best to revert them. The main reason they were
there is the fact that in an SA process, we don't mask signals per
kernel thread, we mask them per user thread. In the kernel, we want
them all to get turned into upcalls. Thus the normal state of
l_sigmask in an SA process is for it to always be empty.

While we are in the process of delivering a signal, we want to
temporarily mask a signal (so we don't recursively exhaust our
upcall stacks). However signal delivery is rare (important, but
rare), and delivering back-to-back signals is even rarer. So rather
than cause every user of a signal mask to be prepared for this very
rare case, we will just add a second check later in the signal
delivery code. Said change is not in this diff.

This also un-compensates all of our compatability code for dealing
with SA. SA is a NetBSD-specific thing, so there's no need for
Irix, Linux, Solaris, SVR4 and so on to cope with it.

As previously, everything other than kern_sa.c compiles in i386
GENERIC as of this checkin. I will switch to ALL soon for compile
testing.
 1.136.2.2  14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

Instead, create a new file, sys/satypes.h, which contains just the
types needed for syscallargs.h. Yes, there's only one now, but that
may change and it's probably more likely to change if it'd be difficult
to handle. :-)

Per discussion with matt at n dot o, add an include of satypes.h to
sigtypes.h. Upcall handlers are kinda signal handlers, and signalling
is the header file that's already included for syscallargs.h that
closest matches SA.

This shaves about 3000 lines off of the diff of the branch relative
to the base. That also represents about 18% of the total before this
checkin.

I think this reduction is very good thing.
 1.136.2.1  10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.137.4.2  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.137.4.1  19-Oct-2008  haad Sync with HEAD.
 1.141.6.2  09-Nov-2008  christos account for major and minor being unsigned long long
 1.141.6.1  25-Oct-2008  christos file linux_machdep.c was added on branch christos-time_t on 2008-11-09 02:05:20 +0000
 1.141.4.1  04-Apr-2009  snj Pull up following revision(s) (requested by ad in ticket #656):
sys/arch/amd64/amd64/gdt.c: revision 1.21 via patch
sys/arch/amd64/amd64/machdep.c: revision 1.129 via patch
sys/arch/i386/i386/gdt.c: revision 1.47 via patch
sys/arch/i386/i386/kvm86.c: revision 1.17 via patch
sys/arch/i386/i386/locore.S: revision 1.85 via patch
sys/arch/i386/i386/machdep.c: revision 1.666 via patch
sys/arch/i386/i386/vector.S: revision 1.45 via patch
sys/arch/i386/include/pcb.h: revision 1.47 via patch
sys/arch/x86/include/pmap.h: revision 1.22 via patch
sys/arch/x86/include/sysarch.h: revision 1.8 via patch
sys/arch/x86/x86/pmap.c: revision 1.80 via patch
sys/arch/x86/x86/sys_machdep.c: revision 1.17 via patch
sys/compat/linux/arch/i386/linux_machdep.c: revision 1.143 via patch
sys/kern/init_main.c: revision 1.384 via patch
PR port-i386/40143 Viewing an mpeg transport stream with mplayer causes crash
Fix numerous problems:
1. LDT updates are not atomic.
2. Number of processes running with private LDTs and/or I/O bitmaps
is not capped. System with high maxprocs can be paniced.
3. LDTR can be leaked over context switch.
4. GDT slot allocations can race, giving the same LDT slot to two procs.
5. Incomplete interrupt/trap frames can be stacked.
6. In some rare cases segment faults are not handled correctly.
 1.141.2.2  28-Apr-2009  skrll Sync with HEAD.
 1.141.2.1  19-Jan-2009  skrll Sync with HEAD.
 1.142.2.2  23-Jul-2009  jym Sync with HEAD.
 1.142.2.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.148.4.1  05-Mar-2011  rmind sync with head
 1.148.2.1  17-Aug-2010  uebayasi Sync with HEAD.
 1.149.4.1  05-Mar-2011  bouyer Sync with HEAD
 1.149.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.150.4.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.150.4.1  17-Apr-2012  yamt sync with head
 1.151.14.1  18-May-2014  rmind sync with head
 1.151.10.2  03-Dec-2017  jdolecek update from HEAD
 1.151.10.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.158.4.1  17-Jan-2015  martin Pull up following revision(s) (requested by maxv in ticket #427):
sys/compat/svr4/svr4_schedctl.c: revision 1.8
sys/netinet/tcp_timer.c: revision 1.88
sys/miscfs/genfs/layer_vfsops.c: revision 1.45
sys/compat/svr4/svr4_ioctl.c: revision 1.37
sys/ufs/chfs/chfs_vfsops.c: revision 1.14
sys/miscfs/fdesc/fdesc_vfsops.c: revision 1.91
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.30
sys/compat/common/kern_time_50.c: revision 1.28
sys/netinet6/ip6_forward.c: revision 1.74
sys/miscfs/umapfs/umap_vnops.c: revision 1.57
sys/compat/svr4/svr4_fcntl.c: revision 1.74
distrib/sets/lists/comp/mi: revision 1.1931
sys/netinet6/udp6_output.c: revision 1.46
sys/fs/puffs/puffs_compat.c: revision 1.3
sys/fs/udf/udf_rename.c: revision 1.11
sys/compat/svr4/svr4_filio.c: revision 1.24
sys/fs/udf/udf_rename.c: revision 1.12
sys/netinet/tcp_usrreq.c: revision 1.202
sys/miscfs/umapfs/umap_subr.c: revision 1.29
sys/compat/linux/common/linux_fadvise64.c: revision 1.3
sys/netinet/if_atm.c: revision 1.34
sys/miscfs/procfs/procfs_subr.c: revision 1.106
sys/miscfs/genfs/layer_subr.c: revision 1.37
sys/netinet/tcp_sack.c: revision 1.30
sys/compat/freebsd/freebsd_misc.c: revision 1.33
sys/compat/freebsd/freebsd_file.c: revision 1.33
sys/ufs/chfs/chfs_vnode.c: revision 1.12
sys/compat/svr4/svr4_ttold.c: revision 1.34
sys/compat/linux/common/linux_file.c: revision 1.114
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.43
sys/compat/linux/common/linux_signal.c: revision 1.76
sys/compat/common/compat_util.c: revision 1.46
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.18
sys/compat/svr4/svr4_sockio.c: revision 1.36
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.32
sys/compat/svr4/svr4_signal.c: revision 1.66
sys/kern/kern_exec.c: revision 1.410
sys/fs/puffs/puffs_vfsops.c: revision 1.115
sys/compat/svr4/svr4_exec_elf64.c: revision 1.15
sys/compat/linux/arch/i386/linux_machdep.c: revision 1.159
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.50
sys/compat/linux32/common/linux32_misc.c: revision 1.24
sys/netinet/in_pcb.c: revision 1.153
sys/sys/malloc.h: revision 1.116
sys/compat/common/if_43.c: revision 1.9
share/man/man9/Makefile: revision 1.380
sys/netinet/tcp_vtw.c: revision 1.12
sys/miscfs/umapfs/umap_vfsops.c: revision 1.95
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.186
sys/compat/common/uipc_syscalls_43.c: revision 1.46
sys/ufs/ext2fs/ext2fs_vnops.c: revision 1.115
sys/fs/puffs/puffs_msgif.c: revision 1.97
sys/compat/svr4/svr4_ipc.c: revision 1.27
sys/compat/linux/common/linux_exec.c: revision 1.117
sys/ufs/ext2fs/ext2fs_readwrite.c: revision 1.66
sys/netinet/tcp_output.c: revision 1.179
sys/compat/svr4/svr4_termios.c: revision 1.28
sys/fs/udf/udf_strat_bootstrap.c: revision 1.4
sys/fs/puffs/puffs_subr.c: revision 1.67
sys/fs/puffs/puffs_node.c: revision 1.36
sys/miscfs/overlay/overlay_vnops.c: revision 1.21
sys/fs/cd9660/cd9660_node.c: revision 1.34
sys/netinet/raw_ip.c: revision 1.146
sys/sys/mallocvar.h: revision 1.13
sys/miscfs/overlay/overlay_vfsops.c: revision 1.63
share/man/man9/malloc.9: revision 1.50
sys/netinet6/dest6.c: revision 1.18
sys/compat/linux/common/linux_uselib.c: revision 1.33
sys/compat/linux/common/linux_socket.c: revision 1.120
share/man/man9/malloc.9: revision 1.51
sys/netinet/tcp_subr.c: revision 1.257
sys/compat/linux/common/linux_socketcall.c: revision 1.45
sys/compat/linux/common/linux_fadvise64_64.c: revision 1.3
sys/compat/freebsd/freebsd_ipc.c: revision 1.17
sys/compat/linux/common/linux_misc_notalpha.c: revision 1.109
sys/compat/linux/arch/alpha/linux_pipe.c: revision 1.17
sys/netinet6/in6_pcb.c: revision 1.132
sys/netinet6/in6_ifattach.c: revision 1.94
sys/compat/svr4/svr4_exec_elf32.c: revision 1.15
sys/miscfs/nullfs/null_vfsops.c: revision 1.90
sys/fs/cd9660/cd9660_util.c: revision 1.12
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.48
sys/compat/freebsd/freebsd_exec_elf32.c: revision 1.20
sys/miscfs/procfs/procfs_vfsops.c: revision 1.94
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.28
sys/compat/linux/common/linux_sched.c: revision 1.67
sys/compat/linux/common/linux_exec_aout.c: revision 1.67
sys/compat/linux/common/linux_pipe.c: revision 1.67
sys/compat/linux/common/linux_llseek.c: revision 1.34
sys/compat/linux/arch/mips/linux_ptrace.c: revision 1.10
Do not uselessly include <sys/malloc.h>.
Cleanup:
- remove struct kmembuckets (dead)
- correctly deadify MALLOC_XX
- remove MALLOC_DEFINE_LIMIT and MALLOC_JUSTDEFINE_LIMIT (dead)
- remove malloc_roundup(), malloc_type_setlimit(), MALLOC_DEFINE_LIMIT()
and MALLOC_JUSTDEFINE_LIMIT() from man 9 malloc
New sentence, new line. Bump date for previous.
Obsolete malloc_roundup(9), malloc_type_setlimit(9) and MALLOC_DEFINE_LIMIT(9)
man pages.
 1.159.2.3  28-Aug-2017  skrll Sync with HEAD
 1.159.2.2  05-Oct-2016  skrll Sync with HEAD
 1.159.2.1  27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.162.4.1  21-Apr-2017  bouyer Sync with HEAD
 1.162.2.2  20-Mar-2017  pgoyette Sync with HEAD
 1.162.2.1  20-Jul-2016  pgoyette Adapt machine-independant code to the new {b,c}devsw reference-counting
(using localcount(9)). All callers of {b,c}devsw_lookup() now call
{b,c}devsw_lookup_acquire() which retains a reference on the 'struct
{b,c}devsw'. This reference must be released by the caller once it is
finished with the structure's content (or other data that would disappear
if the 'struct {b,c}devsw' were to disappear).
 1.163.6.1  21-Jun-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1836):

sys/compat/linux/arch/i386/linux_machdep.c: revision 1.168
sys/compat/sunos/sunos_misc.c: revision 1.177
sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.52
sys/compat/common/kern_resource_43.c: revision 1.23
sys/compat/netbsd32/netbsd32_conv.h: revision 1.46
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.35
sys/compat/common/vfs_syscalls_12.c: revision 1.38
sys/compat/ultrix/ultrix_misc.c: revision 1.126
sys/compat/common/kern_sig_43.c: revision 1.37
sys/compat/linux/common/linux_mtio.c: revision 1.8
sys/compat/freebsd/freebsd_misc.c: revision 1.34
sys/compat/linux/common/linux_olduname.c: revision 1.67
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.44
sys/compat/freebsd/freebsd_sched.c: revision 1.23
sys/compat/ossaudio/ossaudio.c: revision 1.84
sys/compat/sys/time_types.h: revision 1.6
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.51
sys/compat/linux/common/linux_file.c: revision 1.119
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.34
sys/compat/netbsd32/netbsd32_wait.c: revision 1.25
sys/compat/linux32/common/linux32_time.c: revision 1.38
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.33
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.52
sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.46
sys/compat/netbsd32/netbsd32_compat_12.c: revision 1.36
sys/compat/ultrix/ultrix_ioctl.c: revision 1.39
sys/compat/linux/common/linux_misc.c: revision 1.252
sys/compat/linux/common/linux_hdio.c: revision 1.19
sys/compat/sunos/sunos_ioctl.c: revision 1.71
sys/compat/linux/common/linux_sched.c: revision 1.79
sys/compat/common/kern_info_43.c: revision 1.40
sys/compat/linux32/common/linux32_exec_elf32.c: revision 1.20
sys/compat/linux/common/linux_socket.c: revision 1.153
sys/compat/linux/arch/amd64/linux_machdep.c: revision 1.60
sys/compat/common/vfs_syscalls_43.c: revision 1.68
sys/compat/linux/arch/powerpc/linux_exec_powerpc.c: revision 1.25
sys/compat/netbsd32/netbsd32_ptrace.c: revision 1.9
sys/compat/common/kern_time_50.c: revision 1.37
sys/compat/netbsd32/netbsd32_compat_20.c: revision 1.42
sys/compat/linux/common/linux_cdrom.c: revision 1.28
sys/compat/linux/arch/m68k/linux_machdep.c: revision 1.43
sys/compat/common/kern_info_09.c: revision 1.22
sys/compat/linux32/common/linux32_resource.c: revision 1.12
sys/compat/linux/common/linux_oldolduname.c: revision 1.67
sys/compat/netbsd32/netbsd32_nfssvc.c: revision 1.8
sys/compat/linux32/common/linux32_signal.c: revision 1.21
sys/compat/common/kern_sig_13.c: revision 1.22
sys/compat/sunos32/sunos32_ioctl.c: revision 1.36
sys/compat/netbsd32/netbsd32_compat_43.c: revision 1.62
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.23
sys/compat/netbsd32/netbsd32_time.c: revision 1.56
sys/compat/linux/common/linux_signal.c: revision 1.84
sys/compat/netbsd32/netbsd32_signal.c: revision 1.52
sys/compat/sunos32/sunos32_misc.c: revision 1.85
sys/compat/linux/common/linux_time.c: revision 1.40
sys/compat/linux/common/linux_fdio.c: revision 1.14
sys/compat/common/vfs_syscalls_30.c: revision 1.43

sys/compat: Memset zero before copyout.

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.
 1.163.4.1  27-Apr-2017  pgoyette Restore all work from the former pgoyette-localcount branch (which is
now abandoned doe to cvs merge botch).

The branch now builds, and installs via anita. There are still some
problems (cgd is non-functional and all atf tests time-out) but they
will get resolved soon.
 1.165.4.1  10-Jun-2019  christos Sync with HEAD
 1.166.2.1  03-Aug-2022  martin Pull up following revision(s), all via patch
(requested by riastradh in ticket #1487):

sys/compat/linux/arch/i386/linux_machdep.c: revision 1.168
sys/compat/sunos/sunos_misc.c: revision 1.177
sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.52
sys/compat/common/kern_resource_43.c: revision 1.23
sys/compat/netbsd32/netbsd32_conv.h: revision 1.46
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.35
sys/compat/common/vfs_syscalls_12.c: revision 1.38
sys/compat/ultrix/ultrix_misc.c: revision 1.126
sys/compat/common/kern_sig_43.c: revision 1.37
sys/compat/linux/common/linux_mtio.c: revision 1.8
sys/compat/freebsd/freebsd_misc.c: revision 1.34
sys/compat/freebsd/freebsd_machdep.c: revision 1.5
sys/compat/linux/common/linux_olduname.c: revision 1.67
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.44
sys/compat/freebsd/freebsd_sched.c: revision 1.23
sys/compat/ossaudio/ossaudio.c: revision 1.84
sys/compat/sys/time_types.h: revision 1.6
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.51
sys/compat/common/ieee80211_20.c: revision 1.7
sys/compat/linux/common/linux_file.c: revision 1.119
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.34
sys/compat/netbsd32/netbsd32_wait.c: revision 1.25
sys/compat/linux32/common/linux32_time.c: revision 1.38
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.33
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.52
sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.46
sys/compat/netbsd32/netbsd32_compat_12.c: revision 1.36
sys/compat/ultrix/ultrix_ioctl.c: revision 1.39
sys/compat/linux/common/linux_misc.c: revision 1.252
sys/compat/linux/common/linux_hdio.c: revision 1.19
sys/compat/sunos/sunos_ioctl.c: revision 1.71
sys/compat/linux/common/linux_sched.c: revision 1.79
sys/compat/common/kern_info_43.c: revision 1.40
sys/compat/linux32/common/linux32_exec_elf32.c: revision 1.20
sys/compat/linux/common/linux_socket.c: revision 1.153
sys/compat/linux/arch/amd64/linux_machdep.c: revision 1.60
sys/compat/common/vfs_syscalls_43.c: revision 1.68
sys/compat/linux/arch/powerpc/linux_exec_powerpc.c: revision 1.25
sys/compat/netbsd32/netbsd32_ptrace.c: revision 1.9
sys/compat/common/kern_time_50.c: revision 1.37
sys/compat/netbsd32/netbsd32_compat_20.c: revision 1.42
sys/compat/linux/common/linux_cdrom.c: revision 1.28
sys/compat/linux/arch/m68k/linux_machdep.c: revision 1.43
sys/compat/common/kern_info_09.c: revision 1.22
sys/compat/linux32/common/linux32_resource.c: revision 1.12
sys/compat/linux/common/linux_oldolduname.c: revision 1.67
sys/compat/common/if_media_80.c: revision 1.4
sys/compat/linux/arch/alpha/linux_osf1.c: revision 1.5
sys/compat/netbsd32/netbsd32_nfssvc.c: revision 1.8
sys/compat/linux32/common/linux32_signal.c: revision 1.21
sys/compat/common/kern_sig_13.c: revision 1.22
sys/compat/sunos32/sunos32_ioctl.c: revision 1.36
sys/compat/netbsd32/netbsd32_compat_43.c: revision 1.62
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.23
sys/compat/netbsd32/netbsd32_time.c: revision 1.56
sys/compat/linux/common/linux_signal.c: revision 1.84
sys/compat/netbsd32/netbsd32_signal.c: revision 1.52
sys/compat/sunos32/sunos32_misc.c: revision 1.85
sys/compat/linux/common/linux_time.c: revision 1.40
sys/compat/linux/common/linux_fdio.c: revision 1.14
sys/compat/common/vfs_syscalls_30.c: revision 1.43

sys/compat: Memset zero before copyout.

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.

RSS XML Feed