]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoDocument r282613, nc(1) update to OpenBSD 5.7's version.
gjb [Mon, 13 Jul 2015 15:44:45 +0000 (15:44 +0000)]
Document r282613, nc(1) update to OpenBSD 5.7's version.

Sponsored by: The FreeBSD Foundation

8 years agoFix revision for zoneinfo update.
gjb [Mon, 13 Jul 2015 15:44:42 +0000 (15:44 +0000)]
Fix revision for zoneinfo update.

Sponsored by: The FreeBSD Foundation

8 years agoDocument r284398, tzdata update to 2015e.
gjb [Mon, 13 Jul 2015 15:44:40 +0000 (15:44 +0000)]
Document r284398, tzdata update to 2015e.

Sponsored by: The FreeBSD Foundation

8 years agoDocument r282608, date(1) update for compatibility with GNU.
gjb [Mon, 13 Jul 2015 15:44:37 +0000 (15:44 +0000)]
Document r282608, date(1) update for compatibility with GNU.

Sponsored by: The FreeBSD Foundation

8 years agoMarkup fixes.
brueffer [Mon, 13 Jul 2015 15:26:03 +0000 (15:26 +0000)]
Markup fixes.

8 years agoUnify port database use for target and initiator roles.
mav [Mon, 13 Jul 2015 15:11:05 +0000 (15:11 +0000)]
Unify port database use for target and initiator roles.

Aside from cleaner and more consistent code, this allows ports to be both
target and initiator same time, and easily switch from any role to any.

Sponsored by: iXsystems, Inc.

8 years agoFix a typo and duplicate word.
brueffer [Mon, 13 Jul 2015 14:25:15 +0000 (14:25 +0000)]
Fix a typo and duplicate word.

8 years agoDon't claim c99 is a wrapper around gcc; it's a wrapper around the system cc.
brueffer [Mon, 13 Jul 2015 14:13:15 +0000 (14:13 +0000)]
Don't claim c99 is a wrapper around gcc; it's a wrapper around the system cc.

PR: 201303
Submitted by: Bruce Cran
MFC after: 1 week

8 years agoset the refcount for the structure (dropped by mistake in the last commit).
luigi [Mon, 13 Jul 2015 10:23:52 +0000 (10:23 +0000)]
set the refcount for the structure (dropped by mistake in the last commit).

8 years agoAllow again periodic scripts to be run from command-line.
jlh [Mon, 13 Jul 2015 10:15:01 +0000 (10:15 +0000)]
Allow again periodic scripts to be run from command-line.

PR: 188109
Submitted by: Jason Unovitch
MFC after: 1 week

8 years agoReally fix -o
bapt [Mon, 13 Jul 2015 09:12:05 +0000 (09:12 +0000)]
Really fix -o

8 years agoAdd regression tests to ensure we keep allowing creating users with uid0
bapt [Mon, 13 Jul 2015 09:09:09 +0000 (09:09 +0000)]
Add regression tests to ensure we keep allowing creating users with uid0

8 years agoRegression fix: allow to create users with uid0
bapt [Mon, 13 Jul 2015 09:08:27 +0000 (09:08 +0000)]
Regression fix: allow to create users with uid0

Reported by: Jan Mikkelsen <janm@transactionware.com>

8 years agoFix logic of check duplicates that has been inverted
bapt [Mon, 13 Jul 2015 09:07:38 +0000 (09:07 +0000)]
Fix logic of check duplicates that has been inverted

8 years agoRework the read routines to keep the PRNG sources happy. These work
markm [Mon, 13 Jul 2015 08:38:21 +0000 (08:38 +0000)]
Rework the read routines to keep the PRNG sources happy. These work
in units of crypto blocks, so must have adequate space to write.
This means needing to be careful about buffers and keeping track
of external read request length.

Approved by: so (/dev/random blanket)

8 years agoPrevent potential integer overflow
bapt [Mon, 13 Jul 2015 05:59:41 +0000 (05:59 +0000)]
Prevent potential integer overflow

PR: 192971
Submitted by: David Carlier <david.carlier@hardenedbsd.org>

8 years agoPrevent potential integer overflow
bapt [Mon, 13 Jul 2015 05:56:27 +0000 (05:56 +0000)]
Prevent potential integer overflow

PR: 192971
Submitted by: David Carlier <david.carlier@hardenedbsd.org>

8 years agoFixes the RF switch state polling by comparing with the revision of the
adrian [Mon, 13 Jul 2015 05:13:39 +0000 (05:13 +0000)]
Fixes the RF switch state polling by comparing with the revision of the
PHY instead of the revision of the RADIO.

This fixes the RF switch state polling.

This is from DragonflyBSD, Commit 202e28d1f65e9f35df6032400df3242a3bafb483

Obtained from: DragonflyBSD

8 years agoBump version after 4.2.8p3 import.
delphij [Sun, 12 Jul 2015 23:32:23 +0000 (23:32 +0000)]
Bump version after 4.2.8p3 import.

Note: currently 'mkver' script is using hardcoded knowledge and always
emits -a in the version string, a more through solution would be to generate
the script with something that we own.

8 years agoEnsure skeldir is abolute path (relatively to the rootdir)
bapt [Sun, 12 Jul 2015 22:08:58 +0000 (22:08 +0000)]
Ensure skeldir is abolute path (relatively to the rootdir)

8 years agopw -R <rootdir> userdel can now cleanup installation
bapt [Sun, 12 Jul 2015 21:43:57 +0000 (21:43 +0000)]
pw -R <rootdir> userdel can now cleanup installation

Rewrite rm_r to use *at function, allowing to remove home directories along with
users. only crontabs and at(1) installation are not removed

Relnotes: yes

8 years agoRework the home directory creation and copy or the skel content to use *at
bapt [Sun, 12 Jul 2015 20:29:51 +0000 (20:29 +0000)]
Rework the home directory creation and copy or the skel content to use *at
functions

This allows to simplify the code a bit for -R by not having to keep modifying
path and also prepare the code to improve support -R in userdel

While here, add regression tests for the functionality

8 years agoAdd PRINTF_BUFR_SIZE=128 to avoid interleaved output.
ian [Sun, 12 Jul 2015 19:58:12 +0000 (19:58 +0000)]
Add PRINTF_BUFR_SIZE=128 to avoid interleaved output.

8 years agoCorrect the description of MADV_DONTNEED. Specifically, after using
alc [Sun, 12 Jul 2015 19:18:19 +0000 (19:18 +0000)]
Correct the description of MADV_DONTNEED.  Specifically, after using
MADV_DONTNEED, while pages faults on the affected address range are more
likely to occur, they are not guaranteed to occur.

MFC after: 3 days

8 years agoDo not mount /var/log and /var/tmp as md(4)-backed devices.
gjb [Sun, 12 Jul 2015 19:17:05 +0000 (19:17 +0000)]
Do not mount /var/log and /var/tmp as md(4)-backed devices.

Discussed with: ian
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

8 years agoRemove excess copyright lines propogated by copy/paste
allanjude [Sun, 12 Jul 2015 19:16:19 +0000 (19:16 +0000)]
Remove excess copyright lines propogated by copy/paste

Approved by: trasz

8 years agoSince r284198, ls(1) just always depends libxo(3), not only in case of
marius [Sun, 12 Jul 2015 18:40:31 +0000 (18:40 +0000)]
Since r284198, ls(1) just always depends libxo(3), not only in case of
MK_LS_COLORS or !RELEASE_CRUNCH.

8 years agoUse the monotonic (uptime) counter rather than time-of-day to measure elapsed
ian [Sun, 12 Jul 2015 18:38:17 +0000 (18:38 +0000)]
Use the monotonic (uptime) counter rather than time-of-day to measure elapsed
time between ntp_adjtime() clock offset adjustments.  This eliminates spurious
frequency steering after a large clock step (such as a 1970->2015 step on a
system with no battery-backed clock hardware).

This problem was discovered after the import of ntpd 4.2.8, which does things
in a slightly different (but still correct) order than the 4.2.4 we had
previously.  In particular, 4.2.4 would step the clock then immediately after
use ntp_adjtime() to set the frequency and offset to zero, which captured the
post-step time-of-day as a side effect.  In 4.2.8, ntpd sets frequency and
offset to zero before any initial clock step, capturing the time as 1970-ish,
then when it next calls ntp_adjtime() it's with a non-zero offset measurement.
This non-zero value gets multiplied by the apparent 45-year interval, which
blows up into a completely bogus frequency steer.  That gets clamped to
500ppm, but that's still enough to make the clock drift so fast that ntpd has
to keep stepping it every few minutes to compensate.

8 years agoAdd ARM64TODO comments to ACPI PCI stubs
zbb [Sun, 12 Jul 2015 18:32:16 +0000 (18:32 +0000)]
Add ARM64TODO comments to ACPI PCI stubs

This will make searching for missing functionalities easier.

8 years ago* Address review (and add a bit myself).
markm [Sun, 12 Jul 2015 18:14:38 +0000 (18:14 +0000)]
* Address review (and add a bit myself).
 - Tweek man page.
 - Remove all mention of RANDOM_FORTUNA. If the system owner wants YARROW or DUMMY, they ask for it, otherwise they get FORTUNA.
 - Tidy up headers a bit.
 - Tidy up declarations a bit.
 - Make static in a couple of places where needed.
 - Move Yarrow/Fortuna SYSINIT/SYSUNINIT to randomdev.c, moving us towards a single file where the algorithm context is used.
 - Get rid of random_*_process_buffer() functions. They were only used in one place each, and are better subsumed into those places.
 - Remove *_post_read() functions as they are stubs everywhere.
 - Assert against buffer size illegalities.
 - Clean up some silly code in the randomdev_read() routine.
 - Make the harvesting more consistent.
 - Make some requested argument name changes.
 - Tidy up and clarify a few comments.
 - Make some requested comment changes.
 - Make some requested macro changes.

* NOTE: the thing calling itself a 'unit test' is not yet a proper
  unit test, but it helps me ensure things work. It may be a proper
  unit test at some time in the future, but for now please don't make
  any assumptions or hold any expectations.

Differential Revision: https://reviews.freebsd.org/D2025
Approved by: so (/dev/random blanket)

8 years agoImplement stubs for ACPI PCI routines
zbb [Sun, 12 Jul 2015 17:28:31 +0000 (17:28 +0000)]
Implement stubs for ACPI PCI routines

ACPI driver requires special functions to be provided by machdep code.
Add temporary stubs to satisfy the compiler when both "pci" and "acpi"
are enabled in the kernel configuration file.

Reviewed by:   andrew
Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3028

8 years agoRun a shell in the jail when no command is specified.
jamie [Sun, 12 Jul 2015 17:03:50 +0000 (17:03 +0000)]
Run a shell in the jail when no command is specified.
Add a new flag, -l, for a clean environment, same as jail(8) exec.clean.
Change the GET_USER_INFO macro into a function.

PR: 201300
Submitted by: Willem Jan Withagen
MFC after: 3 days

8 years agoAdd minimum regression tests for pw -R
bapt [Sun, 12 Jul 2015 09:42:10 +0000 (09:42 +0000)]
Add minimum regression tests for pw -R

8 years agoAdd new include path for sha256.h
rodrigc [Sun, 12 Jul 2015 03:39:36 +0000 (03:39 +0000)]
Add new include path for sha256.h

This fixes the bootstrap build on FreeBSD 10.

Submitted by: andrew

8 years agoTry to unbreak the build after r285390 removing the obsolete static
bz [Sun, 12 Jul 2015 00:26:22 +0000 (00:26 +0000)]
Try to unbreak the build after r285390 removing the obsolete static
declaration.

8 years agoMake getarg return NULL if args is NULL
bapt [Sun, 12 Jul 2015 00:02:43 +0000 (00:02 +0000)]
Make getarg return NULL if args is NULL

8 years agoFix regression: ensure when try to create the group and the user with the same
bapt [Sat, 11 Jul 2015 23:56:55 +0000 (23:56 +0000)]
Fix regression: ensure when try to create the group and the user with the same
id if possible and nothing in particular was specified

8 years agoRemove now unused variable
bapt [Sat, 11 Jul 2015 23:17:13 +0000 (23:17 +0000)]
Remove now unused variable

8 years agoReplace custom string array with stringlist(3)
bapt [Sat, 11 Jul 2015 23:07:17 +0000 (23:07 +0000)]
Replace custom string array with stringlist(3)

8 years agoRework groupmod modification:
bapt [Sat, 11 Jul 2015 22:35:07 +0000 (22:35 +0000)]
Rework groupmod modification:

Use gr_add(3) when possible to avoid code duplication.
Use a simpler logic to delete members of a group

8 years agoRemove unused argument from pm_passwd
bapt [Sat, 11 Jul 2015 21:12:28 +0000 (21:12 +0000)]
Remove unused argument from pm_passwd

8 years agocheck the gecos format early: at the moment the -c option is parsed
bapt [Sat, 11 Jul 2015 21:09:50 +0000 (21:09 +0000)]
check the gecos format early: at the moment the -c option is parsed

8 years agoReturn the FDT node of the GPIO controller to gpiobus. It is used by the
loos [Sat, 11 Jul 2015 21:09:43 +0000 (21:09 +0000)]
Return the FDT node of the GPIO controller to gpiobus.  It is used by the
children of gpiobus.

8 years agoRemove useless use of goto
bapt [Sat, 11 Jul 2015 20:18:34 +0000 (20:18 +0000)]
Remove useless use of goto

8 years agoIsolate pw lock/unlock into a separate function
bapt [Sat, 11 Jul 2015 20:10:12 +0000 (20:10 +0000)]
Isolate pw lock/unlock into a separate function

8 years agoImplement normal and abnormal process termination.
ed [Sat, 11 Jul 2015 19:41:31 +0000 (19:41 +0000)]
Implement normal and abnormal process termination.

CloudABI does not provide an explicit kill() system call, for the reason
that there is no access to the global process namespace. Instead, it
offers a raise() system call that can at least be used to terminate the
process abnormally.

CloudABI does not support installing signal handlers. CloudABI's raise()
system call should behave as if the default policy is set up. Call into
kern_sigaction(SIG_DFL) before calling sys_kill() to force this.

Obtained from: https://github.com/NuxiNL/freebsd

8 years agohomedir can only be populate during useradd
bapt [Sat, 11 Jul 2015 19:14:09 +0000 (19:14 +0000)]
homedir can only be populate during useradd

8 years agoMake a separate groupdel/userdel from the main function
bapt [Sat, 11 Jul 2015 19:07:47 +0000 (19:07 +0000)]
Make a separate groupdel/userdel from the main function

8 years agoUse FDDUP_NORMAL instead of hardcoding value 0.
ed [Sat, 11 Jul 2015 18:53:30 +0000 (18:53 +0000)]
Use FDDUP_NORMAL instead of hardcoding value 0.

Proposed by: mjg

8 years agoAdd missing function parameter.
ed [Sat, 11 Jul 2015 18:39:16 +0000 (18:39 +0000)]
Add missing function parameter.

A function parameter got added in r285356, meaning that the call to
kern_dup() needs to be patched up.

8 years agoMake separate functions to show users and groups
bapt [Sat, 11 Jul 2015 18:09:27 +0000 (18:09 +0000)]
Make separate functions to show users and groups

8 years agocpu_number and cpu_swapout are never used, and only defined in powerpc.
jhibbits [Sat, 11 Jul 2015 17:33:50 +0000 (17:33 +0000)]
cpu_number and cpu_swapout are never used, and only defined in powerpc.

8 years agoMove the quiet flag into the configuration structure
bapt [Sat, 11 Jul 2015 17:01:08 +0000 (17:01 +0000)]
Move the quiet flag into the configuration structure

8 years agoSeparate usernext/groupnext from the main functions
bapt [Sat, 11 Jul 2015 16:58:47 +0000 (16:58 +0000)]
Separate usernext/groupnext from the main functions

8 years agolinprocfs: vref the vnode passed to vn_fullpath
mjg [Sat, 11 Jul 2015 16:44:28 +0000 (16:44 +0000)]
linprocfs: vref the vnode passed to vn_fullpath

8 years agovfs: always clear VI_OWEINACT in consumers bumping v_usecount
mjg [Sat, 11 Jul 2015 16:28:55 +0000 (16:28 +0000)]
vfs: always clear VI_OWEINACT in consumers bumping v_usecount

Previously vputx would detect the condition and clear the flag.

With this change it is invalid to have both v_usecount > 0 and the flag
set. Assert the condition is met in all revlevant places.

Reviewed by: kib

8 years agovfs: move si_usecount manipulation to dedicated functions
mjg [Sat, 11 Jul 2015 16:28:12 +0000 (16:28 +0000)]
vfs: move si_usecount manipulation to dedicated functions

Reviewed by: kib

8 years agoCreate a dedicated function for ensuring that cdir and rdir are populated.
mjg [Sat, 11 Jul 2015 16:22:48 +0000 (16:22 +0000)]
Create a dedicated function for ensuring that cdir and rdir are populated.

Previously several places were doing it on its own, partially
incorrectly (e.g. without the filedesc locked) or even actively harmful
by populating jdir or assigning rootvnode without vrefing it.

Reviewed by: kib

8 years agoMove chdir/chroot-related fdp manipulation to kern_descrip.c
mjg [Sat, 11 Jul 2015 16:19:11 +0000 (16:19 +0000)]
Move chdir/chroot-related fdp manipulation to kern_descrip.c

Prefix exported functions with pwd_.

Deduplicate some code by adding a helper for setting fd_cdir.

Reviewed by: kib

8 years agoAlways send a SIGSEGV on a map failure. Use the code to tell the reason
andrew [Sat, 11 Jul 2015 16:02:06 +0000 (16:02 +0000)]
Always send a SIGSEGV on a map failure. Use the code to tell the reason
for the signal.

Sponsored by: ABT Systems Ltd

8 years agoRegenerate syscalls.
adrian [Sat, 11 Jul 2015 15:22:11 +0000 (15:22 +0000)]
Regenerate syscalls.

8 years agoAdd an initial NUMA affinity/policy configuration for threads and processes.
adrian [Sat, 11 Jul 2015 15:21:37 +0000 (15:21 +0000)]
Add an initial NUMA affinity/policy configuration for threads and processes.

This is based on work done by jeff@ and jhb@, as well as the numa.diff
patch that has been circulating when someone asks for first-touch NUMA
on -10 or -11.

* Introduce a simple set of VM policy and iterator types.
* tie the policy types into the vm_phys path for now, mirroring how
  the initial first-touch allocation work was enabled.
* add syscalls to control changing thread and process defaults.
* add a global NUMA VM domain policy.
* implement a simple cascade policy order - if a thread policy exists, use it;
  if a process policy exists, use it; use the default policy.
* processes inherit policies from their parent processes, threads inherit
  policies from their parent threads.
* add a simple tool (numactl) to query and modify default thread/process
  policities.
* add documentation for the new syscalls, for numa and for numactl.
* re-enable first touch NUMA again by default, as now policies can be
  set in a variety of methods.

This is only relevant for very specific workloads.

This doesn't pretend to be a final NUMA solution.

The previous defaults in -HEAD (with MAXMEMDOM set) can be achieved by
'sysctl vm.default_policy=rr'.

This is only relevant if MAXMEMDOM is set to something other than 1.
Ie, if you're using GENERIC or a modified kernel with non-NUMA, then
this is a glorified no-op for you.

Thank you to Norse Corp for giving me access to rather large
(for FreeBSD!) NUMA machines in order to develop and verify this.

Thank you to Dell for providing me with dual socket sandybridge
and westmere v3 hardware to do NUMA development with.

Thank you to Scott Long at Netflix for providing me with access
to the two-socket, four-domain haswell v3 hardware.

Thank you to Peter Holm for running the stress testing suite
against the NUMA branch during various stages of development!

Tested:

* MIPS (regression testing; non-NUMA)
* i386 (regression testing; non-NUMA GENERIC)
* amd64 (regression testing; non-NUMA GENERIC)
* westmere, 2 socket (thankyou norse!)
* sandy bridge, 2 socket (thankyou dell!)
* ivy bridge, 2 socket (thankyou norse!)
* westmere-EX, 4 socket / 1TB RAM (thankyou norse!)
* haswell, 2 socket (thankyou norse!)
* haswell v3, 2 socket (thankyou dell)
* haswell v3, 2x18 core (thankyou scott long / netflix!)

* Peter Holm ran a stress test suite on this work and found one
  issue, but has not been able to verify it (it doesn't look NUMA
  related, and he only saw it once over many testing runs.)

* I've tested bhyve instances running in fixed NUMA domains and cpusets;
  all seems to work correctly.

Verified:

* intel-pcm - pcm-numa.x and pcm-memory.x, whilst selecting different
  NUMA policies for processes under test.

Review:

This was reviewed through phabricator (https://reviews.freebsd.org/D2559)
as well as privately and via emails to freebsd-arch@.  The git history
with specific attributes is available at https://github.com/erikarn/freebsd/
in the NUMA branch (https://github.com/erikarn/freebsd/compare/local/adrian_numa_policy).

This has been reviewed by a number of people (stas, rpaulo, kib, ngie,
wblock) but not achieved a clear consensus.  My hope is that with further
exposure and testing more functionality can be implemented and evaluated.

Notes:

* The VM doesn't handle unbalanced domains very well, and if you have an overly
  unbalanced memory setup whilst under high memory pressure, VM page allocation
  may fail leading to a kernel panic.  This was a problem in the past, but it's
  much more easily triggered now with these tools.

* This work only controls the path through vm_phys; it doesn't yet strongly/predictably
  affect contigmalloc, KVA placement, UMA, etc.  So, driver placement of memory
  isn't really guaranteed in any way.  That's next on my plate.

Sponsored by: Norse Corp, Inc.; Dell

8 years agoSince sh(1) now supports mulitbyte (only UTF-8) clarify the related BUGS
bapt [Sat, 11 Jul 2015 13:07:50 +0000 (13:07 +0000)]
Since sh(1) now supports mulitbyte (only UTF-8) clarify the related BUGS
section in wordexp(3) manual page

Discussed with: jilles

8 years agosh(1): libedit has supported multibyte encodings for a while.
jilles [Sat, 11 Jul 2015 13:07:26 +0000 (13:07 +0000)]
sh(1): libedit has supported multibyte encodings for a while.

8 years agoDo not allow creation of the dirty buffers for the dead buffer
kib [Sat, 11 Jul 2015 11:21:56 +0000 (11:21 +0000)]
Do not allow creation of the dirty buffers for the dead buffer
objects, i.e. for buffer objects which vnode was reclaimed.  Buffer
cache cannot write such buffers.  Return the error and discard the
buffer immediately on write attempt.

BO_DIRTY now always set during vnode reclamation, since it is used not
only for the INVARIANTS checks.  Do allow placement of the clean
buffers on dead bufobj list, otherwise filesystems cannot use bufcache
at all after the devvp reclaim.

Reported and tested by: trasz
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agosome additional improvements to the documentation...
jmg [Sat, 11 Jul 2015 04:20:56 +0000 (04:20 +0000)]
some additional improvements to the documentation...

Sponsored by: Netflix, Inc.

8 years agoComplete the move that was started w/ r263218.. For some reason I
jmg [Sat, 11 Jul 2015 03:12:34 +0000 (03:12 +0000)]
Complete the move that was started w/ r263218..  For some reason I
didn't delete the files, so that means we need to bring the changes in
r282726 to the correct files..

make tinderbox completed with this patch...

8 years agoSpoil even can happen for some time now even on providers opened exclusively
pjd [Fri, 10 Jul 2015 19:27:19 +0000 (19:27 +0000)]
Spoil even can happen for some time now even on providers opened exclusively
(on the media change event). Update GELI to handle that situation.

PR: 201185
Submitted by: Matthew D. Fuller

8 years agoassorted algorithmic fixes from Paolo Valente (one of my qfq coauthors):
luigi [Fri, 10 Jul 2015 19:24:36 +0000 (19:24 +0000)]
assorted algorithmic fixes from Paolo Valente (one of my qfq coauthors):
- use 1ULL to avoid shift truncations
- recompute the sum of weight dynamically to provide better fairness
- fix an erroneous constant in the computation of the slot
- preserve timestamp correctness when the old timestamp is stale.

8 years agoone more warning suppression when compiling the test code in userspace.
luigi [Fri, 10 Jul 2015 19:18:49 +0000 (19:18 +0000)]
one more warning suppression when compiling the test code in userspace.

8 years agoadd code to compute fairness indexes;
luigi [Fri, 10 Jul 2015 18:10:40 +0000 (18:10 +0000)]
add code to compute fairness indexes;
cleanups to remove compile warnings.

8 years agostaticize functions only used in netmap.c
luigi [Fri, 10 Jul 2015 16:05:24 +0000 (16:05 +0000)]
staticize functions only used in netmap.c
(detected by jenkins run with gcc 4.9)

Update documentation on the use of netmap_priv_d,
rename the refcount and use the same structure in
FreeBSD and linux

No functional changes.

8 years agoAdd missing const keyword to kern_sigaction()'s 'act' parameter.
ed [Fri, 10 Jul 2015 14:39:46 +0000 (14:39 +0000)]
Add missing const keyword to kern_sigaction()'s 'act' parameter.

This structure is not modified by the function. Also add const to
sigact_flag_test(), as it is called by kern_sigaction().

8 years agofd: further cleanup of kern_dup
mjg [Fri, 10 Jul 2015 13:54:03 +0000 (13:54 +0000)]
fd: further cleanup of kern_dup

- make mode enum start from 0 so that the assertion covers all cases [1]
- rename prefix _CLOEXEC flag with _FLAG
- postpone fhold on the old file descriptor, which eliminates the need to fdrop
  in error cases.
- fixup FDDUP_FCNTL check missed in the previous commit

This removes 'fp == oldfde->fde_file' assertion which had little value. kern_dup
only calls fd-related functions which cannot drop the lock or a whole lot of
races would be introduced.

Noted by: kib [1]

8 years agofd: split kern_dup flags argument into actual flags and a mode
mjg [Fri, 10 Jul 2015 11:01:30 +0000 (11:01 +0000)]
fd: split kern_dup flags argument into actual flags and a mode

Tidy up the code inside to switch on the mode.

8 years agoConvert between abridged (from FXSAVE) and unabridged (from FSAVE)
kib [Fri, 10 Jul 2015 09:20:13 +0000 (09:20 +0000)]
Convert between abridged (from FXSAVE) and unabridged (from FSAVE)
versions of the x87 tags.  The conversion is naive, used abridged tag
is converted to valid unabridged, without additional checks for zero
and special values.

Noted by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoDuplicate the copyright from the i386/i386/machdep.c into
kib [Fri, 10 Jul 2015 09:15:06 +0000 (09:15 +0000)]
Duplicate the copyright from the i386/i386/machdep.c into
i386/include/frame.h after a code was moved from machdep.c to frame.h
in r284925.

Use include guards style similar to other guards.

Noted by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoChange the mb() use in the sched_ult tdq_notify() and sched_idletd()
kib [Fri, 10 Jul 2015 08:54:12 +0000 (08:54 +0000)]
Change the mb() use in the sched_ult tdq_notify() and sched_idletd()
to more C11-ish atomic_thread_fence_seq_cst().

Note that on PowerPC, which currently uses lwsync for mb(), the change
actually fixes the missed store/load barrier, intended by r271604 [*].

Reviewed by: alc
Noted by: alc [*]
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

8 years agoAdd support for makecontext. This supports up to 8 arguments as this
andrew [Fri, 10 Jul 2015 08:36:22 +0000 (08:36 +0000)]
Add support for makecontext. This supports up to 8 arguments as this
simplifies the code, these can be passed in registers.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoadd netmap dependency when compiled as a module
luigi [Fri, 10 Jul 2015 07:13:14 +0000 (07:13 +0000)]
add netmap dependency when compiled as a module

8 years agoLet listen() return EDESTADDRREQ when not bound.
ed [Fri, 10 Jul 2015 06:47:14 +0000 (06:47 +0000)]
Let listen() return EDESTADDRREQ when not bound.

We currently return EINVAL when calling listen() on a UNIX socket that
has not been bound to a pathname. If my interpretation of POSIX is
correct, we should return EDESTADDRREQ: "The socket is not bound to a
local address, and the protocol does not support listening on an unbound
socket."

Return EDESTADDRREQ instead when not bound and not connected.

Differential Revision: https://reviews.freebsd.org/D3038
Reviewed by: gnn, network

8 years agoSync netmap sources with the version in our private tree.
luigi [Fri, 10 Jul 2015 05:51:36 +0000 (05:51 +0000)]
Sync netmap sources with the version in our private tree.
This commit contains large contributions from Giuseppe Lettieri and
Stefano Garzarella, is partly supported by grants from Verisign and Cisco,
and brings in the following:

- fix zerocopy monitor ports and introduce copying monitor ports
  (the latter are lower performance but give access to all traffic
  in parallel with the application)

- exclusive open mode, useful to implement solutions that recover
  from crashes of the main netmap client (suggested by Patrick Kelsey)

- revised memory allocator in preparation for the 'passthrough mode'
  (ptnetmap) recently presented at bsdcan. ptnetmap is described in
        S. Garzarella, G. Lettieri, L. Rizzo;
        Virtual device passthrough for high speed VM networking,
        ACM/IEEE ANCS 2015, Oakland (CA) May 2015
        http://info.iet.unipi.it/~luigi/research.html

- fix rx CRC handing on ixl

- add module dependencies for netmap when building drivers as modules

- minor simplifications to device-specific routines (*txsync, *rxsync)

- general code cleanup (remove unused variables, introduce macros
  to access rings and remove duplicate code,

Applications do not need to be recompiled, unless of course
they want to use the new features (monitors and exclusive open).

Those willing to try this code on stable/10 can just update the
sys/dev/netmap/*, sys/net/netmap* with the version in HEAD
and apply the small patches to individual device drivers.

MFC after: 1 month
Sponsored by: (partly) Verisign, Cisco

8 years agorev.284898 removed _SHLIBDIRPREFIX so we need to reconstruct its value
luigi [Fri, 10 Jul 2015 05:07:18 +0000 (05:07 +0000)]
rev.284898 removed _SHLIBDIRPREFIX so we need to reconstruct its value
to properly locate libraries created in the buildworld phase.

8 years agoSummary: Fix LINT build. The names of the new AES modes were not
gnn [Fri, 10 Jul 2015 02:23:50 +0000 (02:23 +0000)]
Summary: Fix LINT build.  The names of the new AES modes were not
correctly used under the REGRESSION kernel option.

8 years agoFix swapped copyin(9) arguments in cxgb's iwch_arm_cq() function.
dim [Thu, 9 Jul 2015 22:13:23 +0000 (22:13 +0000)]
Fix swapped copyin(9) arguments in cxgb's iwch_arm_cq() function.
Detected by clang 3.7.0 with the warning:

sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c:309:18: error: variable
'rptr' is uninitialized when used here [-Werror,-Wuninitialized]
                chp->cq.rptr = rptr;
                               ^~~~

MFC after: 1 week

8 years agoRename zfs nvpair files to not colidate with our nvlist.
oshogbo [Thu, 9 Jul 2015 21:53:40 +0000 (21:53 +0000)]
Rename zfs nvpair files to not colidate with our nvlist.

PR: 201356
Approved by: pjd (mentor)

8 years agoRemove checks for __ARM_EABI__, we only build for EABI now.
andrew [Thu, 9 Jul 2015 21:02:40 +0000 (21:02 +0000)]
Remove checks for __ARM_EABI__, we only build for EABI now.

Sponsored by: ABT Systems Ltd

8 years agoAdd support for __aeabi_memclr4, clang 3.7 calls it.
andrew [Thu, 9 Jul 2015 20:54:38 +0000 (20:54 +0000)]
Add support for __aeabi_memclr4, clang 3.7 calls it.

Sponsored by: ABT Systems Ltd

9 years agoAdd support for AES modes to IPSec. These modes work both in software only
gnn [Thu, 9 Jul 2015 18:16:35 +0000 (18:16 +0000)]
Add support for AES modes to IPSec.  These modes work both in software only
mode and with hardware support on systems that have AESNI instructions.

Differential Revision: D2936
Reviewed by: jmg, eri, cognet
Sponsored by: Rubicon Communications (Netgate)

9 years agoClear the carry bit on the saved program state register when asked to
andrew [Thu, 9 Jul 2015 17:26:56 +0000 (17:26 +0000)]
Clear the carry bit on the saved program state register when asked to
clear the return value, it's used to indicate an error.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

9 years agoDocument r285329, OpenSSL update to 1.0.1p.
gjb [Thu, 9 Jul 2015 17:24:54 +0000 (17:24 +0000)]
Document r285329, OpenSSL update to 1.0.1p.

Sponsored by: The FreeBSD Foundation

9 years agovfs: cosmetic changes to namei and namei_handle_root
mjg [Thu, 9 Jul 2015 17:17:26 +0000 (17:17 +0000)]
vfs: cosmetic changes to namei and namei_handle_root

- don't initialize cnp during declaration
- don't test error/!error, compare to 0 instead

9 years agoMerge OpenSSL 1.0.1p.
jkim [Thu, 9 Jul 2015 17:07:45 +0000 (17:07 +0000)]
Merge OpenSSL 1.0.1p.

9 years agoImport OpenSSL 1.0.1p.
jkim [Thu, 9 Jul 2015 16:41:34 +0000 (16:41 +0000)]
Import OpenSSL 1.0.1p.

9 years agovfs: simplify error handling in namei
mjg [Thu, 9 Jul 2015 16:32:58 +0000 (16:32 +0000)]
vfs: simplify error handling in namei

The logic is reorganised so that there is one exit point prior to the
lookup loop. This is an intermediate step to making audit logging
functions use found vnode instead of translating ni_dirfd on their own.

ni_startdir validation is removed. The only in-tree consumer is nfs
which already makes sure it is a directory.

Reviewed by: kib

9 years agoCorrect issue presented in r285051,
eri [Thu, 9 Jul 2015 16:28:36 +0000 (16:28 +0000)]
Correct issue presented in r285051,
apparently neither clang nor gcc complain about this.
But clang intis the var to NULL correctly while gcc on at least mips does not.
Correct the undefined behavior by initializing the variable properly.

PR: 201371
Differential Revision:  https://reviews.freebsd.org/D3036
Reviewed by: gnn
Approved by: gnn(mentor)

9 years agoincrease buffer size to significantly increase performance...
jmg [Thu, 9 Jul 2015 16:13:05 +0000 (16:13 +0000)]
increase buffer size to significantly increase performance...

see:
https://docs.freebsd.org/cgi/mid.cgi?20150513080342.GE37063@funkthat.com

for benchmarks...

9 years agoAdd implementations for some of the CloudABI file descriptor system calls.
ed [Thu, 9 Jul 2015 16:07:01 +0000 (16:07 +0000)]
Add implementations for some of the CloudABI file descriptor system calls.

All of the CloudABI system calls that operate on file descriptors of an
arbitrary type are prefixed with fd_. This change adds wrappers for
most of these system calls around their FreeBSD equivalents.

The dup2() system call present on CloudABI deviates from POSIX, in the
sense that it can only be used to replace existing file descriptor. It
cannot be used to create new ones. The reason for this is that this is
inherently thread-unsafe. Furthermore, there is no need on CloudABI to
use fixed file descriptor numbers. File descriptors 0, 1 and 2 have no
special meaning.

This change exposes the kern_dup() through <sys/syscallsubr.h> and puts
the FDDUP_* flags in <sys/filedesc.h>. It then adds a new flag,
FDDUP_MUSTREPLACE to force that file descriptors are replaced -- not
allocated.

Differential Revision: https://reviews.freebsd.org/D3035
Reviewed by: mjg

9 years agofd: prepare do_dup for being exported
mjg [Thu, 9 Jul 2015 15:19:45 +0000 (15:19 +0000)]
fd: prepare do_dup for being exported

- rename it to kern_dup.
- prefix flags with FD
- assert that correct flags were passed

9 years agovfs: avoid spurious vref/vrele for absolute lookups
mjg [Thu, 9 Jul 2015 15:06:58 +0000 (15:06 +0000)]
vfs: avoid spurious vref/vrele for absolute lookups

namei used to vref fd_cdir, which was immediatley vrele'd on entry to
the loop.

Check for absolute lookup and vref the right vnode the first time.

Reviewed by: kib