]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
8 years agoMFC r283423:
dchagin [Sat, 9 Jan 2016 16:12:37 +0000 (16:12 +0000)]
MFC r283423:

Move FEATURE macros for v4l and v4l2 to the common module.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293529 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283422:
dchagin [Sat, 9 Jan 2016 16:11:09 +0000 (16:11 +0000)]
MFC r283422:

Refund the proc emuldata struct for future use. For now move flags from
thread emuldata to proc emuldata as it was originally intended.

As we can have both 64 & 32 bit Linuxulator running any eventhandler
can be called twice for us. To prevent this move eventhandlers code
from linux_emul.c to the linux_common.ko module.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293528 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283421:
dchagin [Sat, 9 Jan 2016 16:08:22 +0000 (16:08 +0000)]
MFC r283421:

Introduce a new module linux_common.ko which is intended for the
following primary purposes:

1. Remove the dependency of linsysfs and linprocfs modules from linux.ko,
which will be architecture specific on amd64.

2. Incorporate into linux_common.ko general code for platforms on which
we'll support two Linuxulator modules (for both instruction set - 32 & 64 bit).

3. Move malloc(9) declaration to linux_common.ko, to enable getting memory
usage statistics properly.

Currently linux_common.ko incorporates a code from linux_mib.c and linux_util.c
and linprocfs, linsysfs and linux kernel modules depend on linux_common.ko.

Temporarily remove dtrace garbage from linux_mib.c and linux_util.c

git-svn-id: svn://svn.freebsd.org/base/stable/10@293527 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283447:
dchagin [Sat, 9 Jan 2016 16:01:57 +0000 (16:01 +0000)]
MFC r283447:

Fix build with KTR option.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293526 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283420:
dchagin [Sat, 9 Jan 2016 16:00:13 +0000 (16:00 +0000)]
MFC r283420:

Add newfstatat system call for 64-bit Linuxulator.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293525 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283419:
dchagin [Sat, 9 Jan 2016 15:58:42 +0000 (15:58 +0000)]
MFC r283419:

Fix compilation with -DDEBUG option.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293524 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283417:
dchagin [Sat, 9 Jan 2016 15:57:28 +0000 (15:57 +0000)]
MFC r283417:

Add 64 bit support to the vdso.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293523 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283416:
dchagin [Sat, 9 Jan 2016 15:56:01 +0000 (15:56 +0000)]
MFC r283416:

x86_64 Linux do not use multiplexing on ipc system calls.
Move struct ipc_perm definition to the MD path as it differs for 64 and
32 bit platform.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293522 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283415:
dchagin [Sat, 9 Jan 2016 15:54:55 +0000 (15:54 +0000)]
MFC r283415:

Disable i386 call for x86-64 Linux.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293521 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283414:
dchagin [Sat, 9 Jan 2016 15:53:50 +0000 (15:53 +0000)]
MFC r283414:

Print out proper procmap entry for 64 bit binaries.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293520 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283413:
dchagin [Sat, 9 Jan 2016 15:52:32 +0000 (15:52 +0000)]
MFC r283413:

64-bit paltforms, like x86_64, do not use multiplexing on
socketcall system calls.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293519 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283412:
dchagin [Sat, 9 Jan 2016 15:50:55 +0000 (15:50 +0000)]
MFC r283412:

Get ready to commit x86_64 Linux emulation.
All fields of type l_int in struct statfs are defined
as l_long on i386 and amd64.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293518 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283411:
dchagin [Sat, 9 Jan 2016 15:49:42 +0000 (15:49 +0000)]
MFC r283411:

Remove stale comment about a signal trampoline which
is moved to the shared page at r219609.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293517 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283410:
dchagin [Sat, 9 Jan 2016 15:48:11 +0000 (15:48 +0000)]
MFC r283410:

Put linux_platform into the vdso to avoid copying it onto the stack at
every exec.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293516 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283408:
dchagin [Sat, 9 Jan 2016 15:46:05 +0000 (15:46 +0000)]
MFC r283408:

Eliminate a now unused global declaration of elf_linux_sysvec.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293515 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283407:
dchagin [Sat, 9 Jan 2016 15:44:38 +0000 (15:44 +0000)]
MFC r283407:

Implement vdso - virtual dynamic shared object. Through vdso Linux
exposes functions from kernel with proper DWARF CFI information so that
it becomes easier to unwind through them.
Using vdso is a mandatory for a thread cancelation && cleanup
on a modern glibc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293514 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen for r293511.
dchagin [Sat, 9 Jan 2016 15:40:44 +0000 (15:40 +0000)]
Regen for r293511.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293513 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283403:
dchagin [Sat, 9 Jan 2016 15:39:41 +0000 (15:39 +0000)]
MFC r283403:

Implement pselect6() system call.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293512 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen for r293510.
dchagin [Sat, 9 Jan 2016 15:38:16 +0000 (15:38 +0000)]
Regen for r293510.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293511 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283401:
dchagin [Sat, 9 Jan 2016 15:37:10 +0000 (15:37 +0000)]
MFC r283401:

Implement prlimit64() system call.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293510 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen for r293508.
dchagin [Sat, 9 Jan 2016 15:35:57 +0000 (15:35 +0000)]
Regen for r293508.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293509 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283399:
dchagin [Sat, 9 Jan 2016 15:34:54 +0000 (15:34 +0000)]
MFC r283399:

Implement dup3() system call.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293508 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283398:
dchagin [Sat, 9 Jan 2016 15:33:48 +0000 (15:33 +0000)]
MFC r283398:

Sched_rr_get_interval returns EINVAL in case when the invalid pid
specified. This silence the ltp tests.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293507 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen for r293505.
dchagin [Sat, 9 Jan 2016 15:32:33 +0000 (15:32 +0000)]
Regen for r293505.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293506 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283396:
dchagin [Sat, 9 Jan 2016 15:31:15 +0000 (15:31 +0000)]
MFC r283396:

Implement rt_sigqueueinfo() system call.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293505 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen for r293503.
dchagin [Sat, 9 Jan 2016 15:29:10 +0000 (15:29 +0000)]
Regen for r293503.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293504 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283394:
dchagin [Sat, 9 Jan 2016 15:28:05 +0000 (15:28 +0000)]
MFC r283394:

Implement waitid() system call.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293503 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen for r293501.
dchagin [Sat, 9 Jan 2016 15:26:20 +0000 (15:26 +0000)]
Regen for r293501.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293502 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283392:
dchagin [Sat, 9 Jan 2016 15:25:22 +0000 (15:25 +0000)]
MFC r283392:

struct l_rusage does not defined for i386 Linuxulator due to it's nature.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293501 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283391:
dchagin [Sat, 9 Jan 2016 15:23:54 +0000 (15:23 +0000)]
MFC r283391:

To reduce code duplication introduce linux_copyout_rusage() method.
Use it in linux_wait4() system call and move linux_wait4() to the MI path.
While here add a prototype for the static bsd_to_linux_rusage().

git-svn-id: svn://svn.freebsd.org/base/stable/10@293500 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283390:
dchagin [Sat, 9 Jan 2016 15:22:50 +0000 (15:22 +0000)]
MFC r283390:

Add a function for converting wait options.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293499 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283389:
dchagin [Sat, 9 Jan 2016 15:21:45 +0000 (15:21 +0000)]
MFC r283389:

Add a siginfo_t conversion function.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293498 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283388:
dchagin [Sat, 9 Jan 2016 15:20:48 +0000 (15:20 +0000)]
MFC r283388:

Remove a now unused define.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293497 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283386:
dchagin [Sat, 9 Jan 2016 15:19:43 +0000 (15:19 +0000)]
MFC r283386:

Introduce LINUX_VERSION_STR, LINUX_VERSION_CODE macro for use instead
of harcoded pr_osrelease, pr_osrel values. This will be used later in
the VDSO.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293496 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283385:
dchagin [Sat, 9 Jan 2016 15:18:36 +0000 (15:18 +0000)]
MFC r283385:

Some style(9) && whitespaces fixes. No functional changes.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293495 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283384:
dchagin [Sat, 9 Jan 2016 15:17:34 +0000 (15:17 +0000)]
MFC r283384:

pthread_join() caller do futex_wait on child_clear_tid. As a results
of multiple simultaneous calls to pthread_join() specifying the same
target thread are undefined wake up the one thread.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293494 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283383:
dchagin [Sat, 9 Jan 2016 15:16:13 +0000 (15:16 +0000)]
MFC r283383:

Switch linuxulator to use the native 1:1 threads.

The reasons:
1. Get rid of the stubs/quirks with process dethreading,
   process reparent when the process group leader exits and close
   to this problems on wait(), waitpid(), etc.
2. Reuse our kernel code instead of writing excessive thread
   managment routines in Linuxulator.

Implementation details:

1. The thread is created via kern_thr_new() in the clone() call with
   the CLONE_THREAD parameter. Thus, everything else is a process.
2. The test that the process has a threads is done via P_HADTHREADS
   bit p_flag of struct proc.
3. Per thread emulator state data structure is now located in the
   struct thread and freed in the thread_dtor() hook.
   Mandatory holdig of the p_mtx required when referencing emuldata
   from the other threads.
4. PID mangling has changed. Now Linux pid is the native tid
   and Linux tgid is the native pid, with the exception of the first
   thread in the process where tid and pid are one and the same.

Ugliness:

   In case when the Linux thread is the initial thread in the thread
   group thread id is equal to the process id. Glibc depends on this
   magic (assert in pthread_getattr_np.c). So for system calls that
   take thread id as a parameter we should use the special method
   to reference struct thread.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293493 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoTo facillitate Linuxulator merging temporarilly revert r288994 (by bdrewery).
dchagin [Sat, 9 Jan 2016 15:12:31 +0000 (15:12 +0000)]
To facillitate Linuxulator merging temporarilly revert r288994 (by bdrewery).

git-svn-id: svn://svn.freebsd.org/base/stable/10@293492 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283382:
dchagin [Sat, 9 Jan 2016 14:53:08 +0000 (14:53 +0000)]
MFC r283382:

In preparation for switching linuxulator to the use the native 1:1
threads add a hook for cleaning thread resources before the thread die.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293490 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283381:
dchagin [Sat, 9 Jan 2016 14:51:50 +0000 (14:51 +0000)]
MFC r283381:

In preparation for switching linuxulator to the use the native 1:1
threads add per thread emulator state data.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293489 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen fro r293487.
dchagin [Sat, 9 Jan 2016 14:48:23 +0000 (14:48 +0000)]
Regen fro r293487.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293488 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283379:
dchagin [Sat, 9 Jan 2016 14:47:08 +0000 (14:47 +0000)]
MFC r283379:

Implement a Linux version of sched_getparam() && sched_setparam().
Temporarily use the first thread in proc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293487 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283378:
dchagin [Sat, 9 Jan 2016 14:45:41 +0000 (14:45 +0000)]
MFC r283378:

Remove a now unused include.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293486 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283377:
dchagin [Sat, 9 Jan 2016 14:44:41 +0000 (14:44 +0000)]
MFC r283377:

In preparation for switching linuxulator to the use the native 1:1
threads split sys_sched_getparam(), sys_sched_setparam(),
sys_sched_getscheduler(), sys_sched_setscheduler() to their kern_*
counterparts and add targettd parameter to allow specify the target
thread directly by callee.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293485 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen for r293483.
dchagin [Sat, 9 Jan 2016 14:43:16 +0000 (14:43 +0000)]
Regen for r293483.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293484 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283375:
dchagin [Sat, 9 Jan 2016 14:41:58 +0000 (14:41 +0000)]
MFC r283375:

In preparation for switching linuxulator to the use the native 1:1
threads use MI linux_sched_rr_get_interval() in i386.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293483 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283374:
dchagin [Sat, 9 Jan 2016 14:40:38 +0000 (14:40 +0000)]
MFC r283374:

In preparation for switching linuxulator to the use the native 1:1
threads refactor kern_sched_rr_get_interval() and sys_sched_rr_get_interval().
Add a kern_sched_rr_get_interval() counterpart which takes a targettd
parameter to allow specify target thread directly by callee (new Linuxulator).

Linuxulator temporarily uses first thread in proc.

Move linux_sched_rr_get_interval() to the MI part.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293482 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283373:
dchagin [Sat, 9 Jan 2016 14:38:29 +0000 (14:38 +0000)]
MFC r283373:

In preparation for switching linuxulator to the use the native 1:1
threads introduce kern_thr_alloc() which will be used later in the
linux_clone().

git-svn-id: svn://svn.freebsd.org/base/stable/10@293481 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283372:
dchagin [Sat, 9 Jan 2016 14:36:44 +0000 (14:36 +0000)]
MFC r283372:

In preparation for switching linuxulator to the use the native 1:1
threads split sys_thr_exit() up into sys_thr_exit() and kern_thr_exit().
Move
Where the second will be used in linux_exit() system call later.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293480 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen for r293478.
dchagin [Sat, 9 Jan 2016 14:34:29 +0000 (14:34 +0000)]
Regen for r293478.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293479 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283370:
dchagin [Sat, 9 Jan 2016 14:33:10 +0000 (14:33 +0000)]
MFC r283370:

In preparation for switching linuxulator to the use the native 1:1
threads introduce linux_exit() stub instead of sys_exit() call
(which terminates process).
In the new linuxulator exit() system call terminates the calling
thread (not a whole process).

git-svn-id: svn://svn.freebsd.org/base/stable/10@293478 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r283369:
dchagin [Sat, 9 Jan 2016 14:31:03 +0000 (14:31 +0000)]
MFC r283369:

In preparation for switching linuxulator to the use the native 1:1
threads print the thread id in addition to the pid in debug messages.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293477 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoBump __FreeBSD_version after utimensat merge made in r293473.
dchagin [Sat, 9 Jan 2016 14:24:11 +0000 (14:24 +0000)]
Bump __FreeBSD_version after utimensat merge made in r293473.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293476 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRegen for r293474.
dchagin [Sat, 9 Jan 2016 14:21:46 +0000 (14:21 +0000)]
Regen for r293474.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293475 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r277610 (by jillies):
dchagin [Sat, 9 Jan 2016 14:20:23 +0000 (14:20 +0000)]
MFC r277610 (by jillies):

Add futimens and utimensat system calls.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293474 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoTo facillitate an upcoming Linuxulator merging partially
dchagin [Sat, 9 Jan 2016 14:08:10 +0000 (14:08 +0000)]
To facillitate an upcoming Linuxulator merging partially
MFC r275121 (by kib). Only merge the syntax changes from r275121,
PROC_*LOCK() macros still lock the same proc spinlock.

The process spin lock currently has the following distinct uses:

- Threads lifetime cycle, in particular, counting of the threads in
  the process, and interlocking with process mutex and thread lock.
  The main reason of this is that turnstile locks are after thread
  locks, so you e.g. cannot unlock blockable mutex (think process
  mutex) while owning thread lock.

- Virtual and profiling itimers, since the timers activation is done
  from the clock interrupt context.  Replace the p_slock by p_itimmtx
  and PROC_ITIMLOCK().

- Profiling code (profil(2)), for similar reason.  Replace the p_slock
  by p_profmtx and PROC_PROFLOCK().

- Resource usage accounting.  Need for the spinlock there is subtle,
  my understanding is that spinlock blocks context switching for the
  current thread, which prevents td_runtime and similar fields from
  changing (updates are done at the mi_switch()).  Replace the p_slock
  by p_statmtx and PROC_STATLOCK().

Discussed with: kib

git-svn-id: svn://svn.freebsd.org/base/stable/10@293473 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r292123: Document mps.enable_ssu
rpokala [Sat, 9 Jan 2016 05:07:02 +0000 (05:07 +0000)]
MFC r292123: Document mps.enable_ssu

mps(4) sends StartStopUnit to SATA direct-access devices during shutdown.
Document the tunables which control that behavior.

Approved by: jhb
Sponsored by: Panasas, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293464 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r291114: popen() requires check for fdopen() failure
rpokala [Sat, 9 Jan 2016 05:05:15 +0000 (05:05 +0000)]
MFC r291114: popen() requires check for fdopen() failure

Move fdopen() up near other resource allocation like malloc(); do proper
deallocation on failure later on in the function.

Approved by: jhb
Sponsored by: Panasas, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293463 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r279567, r279568: Add and document an option to cause syslogd to run
rpokala [Sat, 9 Jan 2016 05:02:35 +0000 (05:02 +0000)]
MFC r279567, r279568: Add and document an option to cause syslogd to run
in the foreground.

This allows a separate process to monitor when and how syslogd exits. That
process can then restart syslogd if needed.

Approved by: jhb
Sponsored by: Panasas, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293462 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r293055: kbdmap.5: Use current names for ASCII control codes lf, ff, us
emaste [Sat, 9 Jan 2016 01:01:04 +0000 (01:01 +0000)]
MFC r293055: kbdmap.5: Use current names for ASCII control codes lf, ff, us

Refer to the old names nl, np, ns as historical aliases.

PR: 205776, 205778

git-svn-id: svn://svn.freebsd.org/base/stable/10@293455 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r292749:
kib [Sat, 9 Jan 2016 00:34:48 +0000 (00:34 +0000)]
MFC r292749:
Do not substitute interpeter if the brand interpreter path is
different from the interpreter path requested by the binary.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293449 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r293173, r293231:
gjb [Sat, 9 Jan 2016 00:31:24 +0000 (00:31 +0000)]
MFC r293173, r293231:
 r293173:
  Fix path to include .OBJDIR to avoid polluting the source
  tree during 'make release'.

 r293231:
  Add a new target to touch the ${.OBJDIR}/release file, which
  indicates the 'release' target has run (in order to prevent
  subsequent invocations that may clobber original build output).

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@293448 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r293047: Use correct name 'us' for character 31 in keymaps
emaste [Sat, 9 Jan 2016 00:28:34 +0000 (00:28 +0000)]
MFC r293047: Use correct name 'us' for character 31 in keymaps

'ns' was a historical accident, and kbdcontrol(1) has accepted the
correct 'us' as well as 'ns' since r38139.

PR: 205776

git-svn-id: svn://svn.freebsd.org/base/stable/10@293447 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 293043
jpaetzel [Fri, 8 Jan 2016 23:58:32 +0000 (23:58 +0000)]
MFC 293043

Unset the gss kernel state when gssd exits

When gssd exits it leaves the kernel state set by
gssd_syscall().  nfsd sees this and waits endlessly
in an unkillable state for gssd to come back.  If you
had acidentally started gssd then stopped it, then
started nfsd you'd be in a bad way until you either
restarted gssd or rebooted the system.  This change
fixes that by setting the kernel state to "" when
gssd exits.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293446 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r293042:
kib [Fri, 8 Jan 2016 10:35:57 +0000 (10:35 +0000)]
MFC r293042:
Minor style cleanup.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293420 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r291545: make the number of fasttrap probes and the size of the trace points...
stas [Fri, 8 Jan 2016 03:45:28 +0000 (03:45 +0000)]
MFC r291545: make the number of fasttrap probes and the size of the trace points hash table
tunable via sysctl or kernel tunables.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293413 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC: r292982
araujo [Fri, 8 Jan 2016 03:02:19 +0000 (03:02 +0000)]
MFC: r292982

Remove unused variable after r292981 to unbreak the build.

MFC: r292981

Clean up unused-but-set-variable spotted by gcc-4.9.

Reviewed by: ngie
Approved by: rodrigc (mentor)
Sponsored by: gandi.net
Differential Revision: https://reviews.freebsd.org/D4773

git-svn-id: svn://svn.freebsd.org/base/stable/10@293412 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC: r292980
araujo [Fri, 8 Jan 2016 02:59:56 +0000 (02:59 +0000)]
MFC: r292980

Clean up unused-but-set-variable spotted by gcc4.9.

Reviewed by: ngie
Approved by: rodrigc (mentor)
Sponsored by: gandi.net
Differential Revision: https://reviews.freebsd.org/D4774

git-svn-id: svn://svn.freebsd.org/base/stable/10@293411 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC: r292972
araujo [Fri, 8 Jan 2016 02:58:10 +0000 (02:58 +0000)]
MFC: r292972

Wrap using #ifdef 'notyet' those variables and statements not yet
implemented to lower the compiler warnings.

It fix the case of unused-but-set-variable spotted by gcc4.9.

Reviewed by: ngie
Approved by: rodrigc (mentor)
Sponsored by: gandi.net
Differential Revision: https://reviews.freebsd.org/D4775

git-svn-id: svn://svn.freebsd.org/base/stable/10@293410 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC: r292971
araujo [Fri, 8 Jan 2016 02:56:21 +0000 (02:56 +0000)]
MFC: r292971

Clean up unused-but-set-variable spotted by gcc-4.9.

Reviewed by: ngie
Approved by: rodrigc (mentor)
Sponsored by: gandi.net
Differential Revision: https://reviews.freebsd.org/D4776

git-svn-id: svn://svn.freebsd.org/base/stable/10@293409 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC: r292970
araujo [Fri, 8 Jan 2016 02:54:21 +0000 (02:54 +0000)]
MFC: r292970

Clean up unused-but-set-variable spotted by gcc-4.9.

Reviewed by: ngie
Approved by: rodrigc (mentor)
Sponsored by: gandi.net
Differential Revision: https://reviews.freebsd.org/D4777

git-svn-id: svn://svn.freebsd.org/base/stable/10@293408 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC: r292969
araujo [Fri, 8 Jan 2016 02:52:04 +0000 (02:52 +0000)]
MFC: r292969

Clean up unused-but-set-variable spotted by gcc-4.9.

Reviewed by: ngie
Approved by: rodrigc (mentor)
Sponsored by: gandi.net
Differential Revision: https://reviews.freebsd.org/D4778

git-svn-id: svn://svn.freebsd.org/base/stable/10@293407 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r277938 (by hiren): make syncookie_mac() use 'tcp_seq irs' in computing hash.
stas [Fri, 8 Jan 2016 00:46:28 +0000 (00:46 +0000)]
MFC r277938 (by hiren): make syncookie_mac() use 'tcp_seq irs' in computing hash.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293402 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r292047: RPC: populate local address for rendezvous transporter.
stas [Fri, 8 Jan 2016 00:21:55 +0000 (00:21 +0000)]
MFC r292047: RPC: populate local address for rendezvous transporter.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293401 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r291941:
bdrewery [Thu, 7 Jan 2016 23:26:16 +0000 (23:26 +0000)]
MFC r291941:

  Replace unneeded manual dependency on header by adding it to SRCS.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293396 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMerge r293282 from head:
glebius [Thu, 7 Jan 2016 23:10:44 +0000 (23:10 +0000)]
Merge r293282 from head:
 Provide knob NO_INSTALLEXTRAKERNELS. If defined, extra kernels in KERNCONF
 won't be installed, only the first one would.

Turn NO_INSTALLEXTRAKERNELS=yes on stable/10 to preserve original
behaviour of not installing additional kernels built.

Reported & tested by: Trond Endrestøl <Trond.Endrestol fagskolen.gjovik.no>
Reported & tested by: dhw

git-svn-id: svn://svn.freebsd.org/base/stable/10@293391 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r291611:
bdrewery [Thu, 7 Jan 2016 22:06:05 +0000 (22:06 +0000)]
MFC r291611:

  Add NO_INSTALLKERNEL to undo the assumption that the first KERNCONF will be
  installed as "kernel".  This is relevant for packaging of the kernel when not
  wanting a default "kernel.txz".

git-svn-id: svn://svn.freebsd.org/base/stable/10@293376 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r291610:
bdrewery [Thu, 7 Jan 2016 22:05:04 +0000 (22:05 +0000)]
MFC r291610:

  Allow storing package(world|kernel) tarballs into a different location at
  PACKAGEDIR.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293375 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFH r292836:
wollman [Thu, 7 Jan 2016 20:43:45 +0000 (20:43 +0000)]
MFH r292836:

    in6_if2idlen: treat bridge(4) interfaces like other Ethernet interfaces

    bridge(4) interfaces have an if_type of IFT_BRIDGE, rather than
    IFT_ETHER, even though they only support Ethernet-style links.  This
    caused in6_if2idlen to emit an "unknown link type (209)" warning to
    the console every time it was called.  Add IFT_BRIDGE to the case
    statement in the appropriate place, indicating that it uses the same
    IPv6 address format as other Ethernet-like interfaces.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293358 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r280808 by andrew: Reorder sys/boot/Makefile for the efi loader move
emaste [Thu, 7 Jan 2016 20:34:06 +0000 (20:34 +0000)]
MFC r280808 by andrew: Reorder sys/boot/Makefile for the efi loader move

As these will depend on ficl having been built, and are set via
bsd.arch.inc.mk we need to place this after ficl.

As Makefile.amd64 is now late enough we can add the i386 directory to
this.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293353 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r281524 by andrew@: Use MACHINE in the efi loader when it is what we mean
emaste [Thu, 7 Jan 2016 20:10:49 +0000 (20:10 +0000)]
MFC r281524 by andrew@: Use MACHINE in the efi loader when it is what we mean

It may not be the same as MACHINE_CPUARCH, it just happened to be the
case the architectures this code currently supports.

Fixes build failure reported by Oliver Pinter.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293347 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC: 292394
gnn [Thu, 7 Jan 2016 19:52:17 +0000 (19:52 +0000)]
MFC: 292394

Switch the IPsec related statistics to using the built in sysctl
variable set rather than reading from kernel memory.
This also makes the -z (zero) flag work correctly

Sponsored by: Rubicon Communications, LLC (Netgate)

git-svn-id: svn://svn.freebsd.org/base/stable/10@293344 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r291377: vidfont: with vt(4) omit size from vidcontrol -f
emaste [Thu, 7 Jan 2016 17:03:26 +0000 (17:03 +0000)]
MFC r291377: vidfont: with vt(4) omit size from vidcontrol -f

When using syscons, vidfont extracts the font size from the filename
passes it to vidcontrol -f. In vt(4) mode the size argument is not
required, and some of the fonts in /usr/share/vt/fonts do not have the
size in the filename, which caused vidfont to fail. Thus, just omit the
size argument in vt(4) mode.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293335 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r291691: newvers: Honour SOURCE_DATE_EPOCH for build reproducibility
emaste [Thu, 7 Jan 2016 17:00:35 +0000 (17:00 +0000)]
MFC r291691: newvers: Honour SOURCE_DATE_EPOCH for build reproducibility

One reason the kernel does not build reproducibly is that it includes
a timestamp in the version string. SOURCE_DATE_EPOCH provides a standard
method to address this: it should be set to the last modification time
of the source, and build processes use the specified timestamp instead
of the "current" date and time.

This change uses SOURCE_DATE_EPOCH if it is set; how it gets set needs
to be addressed elsewhere.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293333 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r292676:
jtl [Thu, 7 Jan 2016 15:37:17 +0000 (15:37 +0000)]
MFC r292676:

Only allow one PT_INTERP ELF program header. This also fixes a potential
memory leak for interp_buf.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293318 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r292705: rtld: remove old XXX comment missed in r35529
emaste [Thu, 7 Jan 2016 14:52:32 +0000 (14:52 +0000)]
MFC r292705: rtld: remove old XXX comment missed in r35529

git-svn-id: svn://svn.freebsd.org/base/stable/10@293317 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r292440:
mjg [Thu, 7 Jan 2016 12:08:15 +0000 (12:08 +0000)]
MFC r292440:

proc: fix a race which could result in dereference of bad p_pgrp pointer on
fork

During fork p_starcopy - p_endcopy area of a process is populated with bcopy
with only proc lock held. Another forking thread can find such a process and
proceed to access p_pgrp included in said area.

Fix the problem by moving the field outside. It is being properly assigned
later.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293314 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287649:
markj [Thu, 7 Jan 2016 07:21:37 +0000 (07:21 +0000)]
MFC r287649:
Use a common subroutine to fetch and zero protocol stats instead of
duplicating roughly similar code for each protocol.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293307 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoloader.efi: combine GetMemoryMap and ExitBootServices and retry on error
emaste [Thu, 7 Jan 2016 04:02:37 +0000 (04:02 +0000)]
loader.efi: combine GetMemoryMap and ExitBootServices and retry on error

MFC r292338: UEFI: combine GetMemoryMap and ExitBootServices and retry on error

The EFI memory map may change before or during the first
ExitBootServices call. In that case ExitBootServices returns an error,
and GetMemoryMap and ExitBootServices must be retried.

Glue together calls to GetMemoryMap(), ExitBootServices() and storage of
(now up-to-date) MODINFOMD_EFI_MAP metadata within a single function.

That new function - bi_add_efi_data_and_exit() - uses space previously
allocated in bi_load_efi_data() to store the memory map (it will fail if
that space is too short). It handles re-calling GetMemoryMap() once to
update the map key if necessary. Finally, if ExitBootServices() is
successful, it stores the memory map and its header as MODINFOMD_EFI_MAP
metadata.

ExitBootServices() calls are now done earlier, from within arch-
independent bi_load() code.

MFC r292442: loader.efi: show EFI error number, not full status value

EFI return values set the high bit to indicate an error. The log
messages changed here are printed only in the case of an error,
so including the error bit is redundant. Also switch to decimal to
match the error definitions (in sys/boot/efi/include/efierr.h).

MFC r292515: loader.efi: refresh size in GetMemoryMap retry loop

If ExitBootServices fails due to a changed efi_mapkey then GetMemoryMap
must be called again. In this case it is also possible for the memory
map to grow, so repeat the initial GetMemoryMap call to fetch the new
size.

Also roll bi_add_efi_data_and_exit into bi_load_efi_data as there's no
need for it to be a separate function.

PR: 202455
Relnotes: Yes
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@293304 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r281138: SMBIOS support for EFI
emaste [Thu, 7 Jan 2016 03:28:56 +0000 (03:28 +0000)]
MFC r281138: SMBIOS support for EFI

Restore smbios support lost in r293297

git-svn-id: svn://svn.freebsd.org/base/stable/10@293303 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoRemove old amd64 EFI directory
emaste [Thu, 7 Jan 2016 02:45:41 +0000 (02:45 +0000)]
Remove old amd64 EFI directory

git-svn-id: svn://svn.freebsd.org/base/stable/10@293302 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288372: Use EFI page size constants instead of hardcoding 4096
emaste [Thu, 7 Jan 2016 02:42:56 +0000 (02:42 +0000)]
MFC r288372: Use EFI page size constants instead of hardcoding 4096

git-svn-id: svn://svn.freebsd.org/base/stable/10@293301 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287934: Increase EFI staging size from 32MB to 48MB
emaste [Thu, 7 Jan 2016 02:41:57 +0000 (02:41 +0000)]
MFC r287934: Increase EFI staging size from 32MB to 48MB

The EFI boot loader allocates a single chunk of contiguous memory to
hold the kernel, modules, and any other loaded data.  This memory block
is relocated to the kernel's expected location during the transfer of
control from the loader to the kernel.

PR: 201679

git-svn-id: svn://svn.freebsd.org/base/stable/10@293300 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r292576: boot1.efi: show EFI error number, not full status value
emaste [Thu, 7 Jan 2016 02:37:17 +0000 (02:37 +0000)]
MFC r292576: boot1.efi: show EFI error number, not full status value

EFI return values set the high bit to indicate an error. The log
messages changed here are printed only in the case of an error,
so including the error bit is redundant. Also switch to decimal to
match the error definitions (in sys/boot/efi/include/efierr.h).

git-svn-id: svn://svn.freebsd.org/base/stable/10@293299 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r281000: Move i386/efi files to new home in efi/loader/arch/i386
emaste [Thu, 7 Jan 2016 02:33:28 +0000 (02:33 +0000)]
MFC r281000: Move i386/efi files to new home in efi/loader/arch/i386

This was not (and still is not) connected to the build, but the EFI
loader is in the process of being built for other than amd64 so these
files ought to live in their eventual MD location.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293298 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r280950: Move the efi loaders to be under sys/boot/efi
emaste [Thu, 7 Jan 2016 02:22:45 +0000 (02:22 +0000)]
MFC r280950: Move the efi loaders to be under sys/boot/efi

In HEAD this was done to support UEFI on arm64. Merging to stable/10 to
facilitate the merging of later UEFI changes.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293297 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC SVN revisions 292899,292996,292999-293000.
dteske [Thu, 7 Jan 2016 02:06:14 +0000 (02:06 +0000)]
MFC SVN revisions 292899,292996,292999-293000.

r292899: Fix stack leak introduced by SVN r97201
r292996: Remove debugging messages added by SVN r187143
r292999: Fix a memory leak
r293000: Remove supposition comment

git-svn-id: svn://svn.freebsd.org/base/stable/10@293296 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286368: Remove guards around overwriting loader.rc and menu.rc
dteske [Thu, 7 Jan 2016 01:50:50 +0000 (01:50 +0000)]
MFC r286368: Remove guards around overwriting loader.rc and menu.rc

There have been .local version of each for user modifications for some time
This allows users to receive future updates to these files

PR: 183765
Differential Revision: https://reviews.freebsd.org/D3176
Submitted by: Bertram Scharpf, Nikolai Lifanov (patch)
Reviewed by: dteske, loos, eadler
Approved by: bapt (mentor)
Relnotes: yes
Sponsored by: ScaleEngine Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@293294 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC SVN revisions 280922,285875,285882.
dteske [Thu, 7 Jan 2016 01:33:42 +0000 (01:33 +0000)]
MFC SVN revisions 280922,285875,285882.
r280922: Change contents of the exec variable in loader.conf (dteske/rpaulo)
r285875: Use double newlines consistently (trasz/foundation)
r285882: Use consistent spacing (trasz/foundation)

git-svn-id: svn://svn.freebsd.org/base/stable/10@293293 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r290693: Add support for "rc.conf.d" file(s).
dteske [Thu, 7 Jan 2016 00:53:07 +0000 (00:53 +0000)]
MFC r290693: Add support for "rc.conf.d" file(s).

Differential Revision: https://reviews.freebsd.org/D3551
Reviewed by: allanjude
Relnotes: yes

git-svn-id: svn://svn.freebsd.org/base/stable/10@293292 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f