]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoCommit a missing change from 299090
asomers [Mon, 23 May 2016 20:19:07 +0000 (20:19 +0000)]
Commit a missing change from 299090

tests/sys/kern/Makefile
Reenable a disabled compiler warning, the need for which was
eliminated by r299090.

Reviewed by: ngie
MFC after: 4 weeks
X-MFC-With: 299090
Sponsored by: Spectra Logic Corp

8 years agoMark the prefix and default router list sysctl handlers MPSAFE.
markj [Mon, 23 May 2016 20:18:11 +0000 (20:18 +0000)]
Mark the prefix and default router list sysctl handlers MPSAFE.

MFC after: 2 weeks

8 years agoAcquire the nd6 lock in the prefix list sysctl handler.
markj [Mon, 23 May 2016 20:15:08 +0000 (20:15 +0000)]
Acquire the nd6 lock in the prefix list sysctl handler.

The nd6 lock will be used to synchronize access to the NDP prefix list.

MFC after: 2 weeks
Tested by: Jason Wolfe (as part of a larger change)

8 years agoSpaces->tab in comment.
ian [Mon, 23 May 2016 20:13:17 +0000 (20:13 +0000)]
Spaces->tab in comment.

8 years agoOops, fix a paste-o commited in r300533.
ian [Mon, 23 May 2016 20:12:38 +0000 (20:12 +0000)]
Oops, fix a paste-o commited in r300533.

8 years agoUse the new(-ish) CP15_SCTLR macro to generate system control reg accesses
ian [Mon, 23 May 2016 20:07:17 +0000 (20:07 +0000)]
Use the new(-ish) CP15_SCTLR macro to generate system control reg accesses
where possible.  In the places that doesn't work (multi-line inline asm,
and places where the old armv4 cpufuncs mechanism is used), annotate the
accesses with a comment that includes SCTLR.  Now a grep -i sctlr can find
all the system control register manipulations.

No functional changes.

8 years agoFix ada(4) trim support quirk setting.
ken [Mon, 23 May 2016 19:52:08 +0000 (19:52 +0000)]
Fix ada(4) trim support quirk setting.

I broke broke the quirk in the ada(4) driver disabling NCQ trim support
in revision 300207.  The support flags were set before the quirks were
loaded.

sys/cam/ata/ata_da.c:
Call adasetflags() after loading quirks, so that we'll set the
flags accurately.

Sponsored by: Spectra Logic

8 years agontb_hw(4): Only record the first three MSIX vectors
cem [Mon, 23 May 2016 19:46:58 +0000 (19:46 +0000)]
ntb_hw(4): Only record the first three MSIX vectors

Don't overrun the msix_data array by reading the (unused) link state
interrupt information.

Reported by: mav (earlier version)
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6489

8 years agoINTRNG - support new interrupt mapping type INTR_MAP_DATA_GPIO
skra [Mon, 23 May 2016 18:16:21 +0000 (18:16 +0000)]
INTRNG - support new interrupt mapping type INTR_MAP_DATA_GPIO
introduced in r298738.

Reviewed by: ian

8 years agoINTRNG - use gpio generic interrupt modes definitions added in r298738.
skra [Mon, 23 May 2016 18:12:52 +0000 (18:12 +0000)]
INTRNG - use gpio generic interrupt modes definitions added in r298738.

Reviewed by: ian

8 years agoProperly allow META_MODE to be set from environment.
bdrewery [Mon, 23 May 2016 17:27:42 +0000 (17:27 +0000)]
Properly allow META_MODE to be set from environment.

Sponsored by: EMC / Isilon Storage Division

8 years agoUse sed(1) to determine cc version rather than tail(1) since it is already in ITOOLS.
bdrewery [Mon, 23 May 2016 17:11:32 +0000 (17:11 +0000)]
Use sed(1) to determine cc version rather than tail(1) since it is already in ITOOLS.

This fixes 'tail: not found' warnings in installworld after r300351.

Sponsored by: EMC / Isilon Storage Division

8 years agoDocument r298998, OpenSSL updated to 1.0.2h.
skreuzer [Mon, 23 May 2016 17:06:46 +0000 (17:06 +0000)]
Document r298998, OpenSSL updated to  1.0.2h.

Approved by: gjb@ (implicit with re@ hat on)

8 years agoOnly export and re-import the root pool if installing on MBR
allanjude [Mon, 23 May 2016 17:04:13 +0000 (17:04 +0000)]
Only export and re-import the root pool if installing on MBR

This step is required in order to dd the boot2 bits into the ZFS partition

Sponsored by: ScaleEngine Inc.

8 years agoCorrect an error in a comment: One of the conditions for page allocation
alc [Mon, 23 May 2016 16:59:05 +0000 (16:59 +0000)]
Correct an error in a comment: One of the conditions for page allocation
is actually the opposite of that stated in the comment.

Remove an unnecessary assignment.  Use an assertion to document the fact
that no assignment is needed.

Rewrite another comment to clarify that the page is not completely valid.

Reviewed by: kib

8 years agoFix missing pool name in zfs set command
allanjude [Mon, 23 May 2016 16:49:26 +0000 (16:49 +0000)]
Fix missing pool name in zfs set command

8 years agoMove binutils handling after src.opts.mk.
bdrewery [Mon, 23 May 2016 16:24:34 +0000 (16:24 +0000)]
Move binutils handling after src.opts.mk.

This fixes the arm64 build after r300348.

Sponsored by: EMC / Isilon Storage Division

8 years agoImplement "atomic_long_add_unless()" in the LinuxKPI and fix the
hselasky [Mon, 23 May 2016 16:19:51 +0000 (16:19 +0000)]
Implement "atomic_long_add_unless()" in the LinuxKPI and fix the
implementation of "atomic_long_inc_not_zero()".

Found by: ngie @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoDocument r296190, openresolv updated to 3.7.3.
skreuzer [Mon, 23 May 2016 15:44:39 +0000 (15:44 +0000)]
Document r296190, openresolv updated to 3.7.3.

Approved by: gjb@ (implicit with re@ hat on)

8 years agoDocument r298161, sqlite3 updated to 3.12.1.
skreuzer [Mon, 23 May 2016 15:37:12 +0000 (15:37 +0000)]
Document r298161, sqlite3 updated to 3.12.1.

Approved by: gjb@ (implicit with re@ hat on)

8 years agoDocument r298192, file(1) updated to 5.26.
skreuzer [Mon, 23 May 2016 15:33:56 +0000 (15:33 +0000)]
Document r298192, file(1) updated to 5.26.

Approved by: gjb@ (implicit with re@ hat on)

8 years agoAdd the needed hwpmc hooks to subr_intr.c. This is needed for the correct
andrew [Mon, 23 May 2016 15:26:35 +0000 (15:26 +0000)]
Add the needed hwpmc hooks to subr_intr.c. This is needed for the correct
operation of hwpmc on, for example, arm64 with intrng.

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

8 years agoFix error in bsdinstall where additional filesystems cannot be mounted
allanjude [Mon, 23 May 2016 15:11:01 +0000 (15:11 +0000)]
Fix error in bsdinstall where additional filesystems cannot be mounted

Do not set canmount=noauto on the boot environment at create time, because
this causes / to not be mounted, and since the chroot is read only, new
mountpoints cannot be created.

The property is set later, when other properties are adjusted

Reported by: HardenedBSD
Sponsored by: ScaleEngine Inc.

8 years agopf: Fix more ICMP mistranslation
kp [Mon, 23 May 2016 13:59:48 +0000 (13:59 +0000)]
pf: Fix more ICMP mistranslation

In the default case fix the substitution of the destination address.

PR: 201519
Submitted by: Max <maximos@als.nnov.ru>
MFC after: 1 week

8 years agoA missing definition needed by ktime_to_ms().
hselasky [Mon, 23 May 2016 13:19:20 +0000 (13:19 +0000)]
A missing definition needed by ktime_to_ms().

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoFix some data types and add "inline" keyword for __reg_op() function.
hselasky [Mon, 23 May 2016 13:18:15 +0000 (13:18 +0000)]
Fix some data types and add "inline" keyword for __reg_op() function.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agosfxge(4): cleanup: remove unused EFX preempt macros
arybchik [Mon, 23 May 2016 13:17:37 +0000 (13:17 +0000)]
sfxge(4): cleanup: remove unused EFX preempt macros

The EFSYS_PREEMPT_DISABLE() and EFSYS_PREEMPT_ENABLE() macros
were used to ensure correct timing of I2C operations. The APIs
for I2C operations have been removed, so these macros have no
callers.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week

8 years agoBuild iscsid(8) with ICL_KERNEL_PROXY defined by default, as required
trasz [Mon, 23 May 2016 12:58:24 +0000 (12:58 +0000)]
Build iscsid(8) with ICL_KERNEL_PROXY defined by default, as required
for iSER.

Obtained from: Mellanox Technologies
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoImplement ror32() in the LinuxKPI.
hselasky [Mon, 23 May 2016 12:53:17 +0000 (12:53 +0000)]
Implement ror32() in the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoDefine more copy to/from userspace functions in the LinuxKPI.
hselasky [Mon, 23 May 2016 12:52:22 +0000 (12:52 +0000)]
Define more copy to/from userspace functions in the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agopf: Fix ICMP translation
kp [Mon, 23 May 2016 12:41:29 +0000 (12:41 +0000)]
pf: Fix ICMP translation

Fix ICMP source address rewriting in rdr scenarios.

PR: 201519
Submitted by: Max <maximos@als.nnov.ru>
MFC after: 1 week

8 years agoAdd more printf() related functions to the LinuxKPI.
hselasky [Mon, 23 May 2016 12:35:07 +0000 (12:35 +0000)]
Add more printf() related functions to the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoSet an invalid IRQ number when no PCI IRQ is available in the LinuxKPI.
hselasky [Mon, 23 May 2016 12:13:16 +0000 (12:13 +0000)]
Set an invalid IRQ number when no PCI IRQ is available in the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoAdd more ktime related functions to the LinuxKPI.
hselasky [Mon, 23 May 2016 12:10:28 +0000 (12:10 +0000)]
Add more ktime related functions to the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoImplement "kref_put_mutex()" for the LinuxKPI.
hselasky [Mon, 23 May 2016 12:06:34 +0000 (12:06 +0000)]
Implement "kref_put_mutex()" for the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoAdd more list_xxx() functions to the LinuxKPI.
hselasky [Mon, 23 May 2016 12:03:40 +0000 (12:03 +0000)]
Add more list_xxx() functions to the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoMake header file standalone by including definitions for needed
hselasky [Mon, 23 May 2016 11:57:23 +0000 (11:57 +0000)]
Make header file standalone by including definitions for needed
linux_wait_xxx() functions.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoImplement "_outb()" to the LinuxKPI for i386 and amd64 only.
hselasky [Mon, 23 May 2016 11:53:00 +0000 (11:53 +0000)]
Implement "_outb()" to the LinuxKPI for i386 and amd64 only.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoAdd support for "cdev_add_ext()" to the LinuxKPI.
hselasky [Mon, 23 May 2016 11:50:05 +0000 (11:50 +0000)]
Add support for "cdev_add_ext()" to the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoAdd more GFP related defines to the LinuxKPI.
hselasky [Mon, 23 May 2016 11:47:54 +0000 (11:47 +0000)]
Add more GFP related defines to the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoAdd support for atomic_long_inc_not_zero() to the LinuxKPI.
hselasky [Mon, 23 May 2016 11:44:46 +0000 (11:44 +0000)]
Add support for atomic_long_inc_not_zero() to the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoAdd support for atomic_long_inc_not_zero() to the LinuxKPI.
hselasky [Mon, 23 May 2016 11:41:35 +0000 (11:41 +0000)]
Add support for atomic_long_inc_not_zero() to the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoUse DELAY() instead of _sleep() when SCHEDULER_STOPPED() is set inside
hselasky [Mon, 23 May 2016 10:31:54 +0000 (10:31 +0000)]
Use DELAY() instead of _sleep() when SCHEDULER_STOPPED() is set inside
pause_sbt(). This allows pause() to continue working during a panic()
which is not invoking KDB. This is useful when debugging graphics
drivers using the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week

8 years agohyperv/vmbus: Move IDT vector to vmbus_softc
sephe [Mon, 23 May 2016 07:32:34 +0000 (07:32 +0000)]
hyperv/vmbus: Move IDT vector to vmbus_softc

Prepare to get rid of the hv_setup_arg.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6449

8 years agohyperv/vmbus: Get rid of vmbus_devp
sephe [Mon, 23 May 2016 07:23:19 +0000 (07:23 +0000)]
hyperv/vmbus: Get rid of vmbus_devp

While I'm here, nuke useless print in vmbus_attach().

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6447

8 years agohyperv/vmbus: Declare Synic message and event w/ proper types
sephe [Mon, 23 May 2016 07:14:04 +0000 (07:14 +0000)]
hyperv/vmbus: Declare Synic message and event w/ proper types

Avoid ugly casts.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6446

8 years agohyperv: Move Hypercall setup to an early place.
sephe [Mon, 23 May 2016 07:06:53 +0000 (07:06 +0000)]
hyperv: Move Hypercall setup to an early place.

It does not belong to the vmbus.

While I'm here rework the Hypercall setup, e.g. use busdma(9)
and avoid bit fields.

Discussed with: Jun Su <junsu microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6445

8 years agohyperv/hn: Use hyperv busdma(9) helper.
sephe [Mon, 23 May 2016 06:52:42 +0000 (06:52 +0000)]
hyperv/hn: Use hyperv busdma(9) helper.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6444

8 years agohyperv: Add helpers for busdma(9) operation
sephe [Mon, 23 May 2016 06:35:11 +0000 (06:35 +0000)]
hyperv: Add helpers for busdma(9) operation

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6443

8 years ago[siba] update device ids.
adrian [Mon, 23 May 2016 05:52:47 +0000 (05:52 +0000)]
[siba] update device ids.

Tested:

* BCM4322 11abgn, STA mode

8 years agohyperv: Move guest id setup to early place
sephe [Mon, 23 May 2016 05:11:38 +0000 (05:11 +0000)]
hyperv: Move guest id setup to early place

And
- Rework the guest id composition.
- Nuke useless saved guest_id.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6430

8 years ago[bwn] convert another PHY-N workaround to the freebsd bwn format.
adrian [Mon, 23 May 2016 04:17:27 +0000 (04:17 +0000)]
[bwn] convert another PHY-N workaround to the freebsd bwn format.

These were hidden behind an #ifdef that we weren't setting.

I don't have the hardware in question to check.

8 years agoAdd a note on how to update a self-hosted armv6hf system to the entry
ian [Mon, 23 May 2016 04:07:41 +0000 (04:07 +0000)]
Add a note on how to update a self-hosted armv6hf system to the entry
describing the armv6hf->armv6 change.

8 years ago[nvram2env] fix nvram2env to scan all of memory, not 1/4th
adrian [Mon, 23 May 2016 03:51:15 +0000 (03:51 +0000)]
[nvram2env] fix nvram2env to scan all of memory, not 1/4th

The variable "size" stores number of words (4bytes). But the loop over
memory uses size as number of bytes to scan memory. As result it fetches
only 1/4th of memory.

This patch solves this problem and nvram2env fetches all NVRAM variables.

Test plan:

Pre-requisites: any MIPS board with ASCII-based NVRAM mapped into memory

* Add "device nvram2env" into kernel configuration
* Specify hints: base is mandatory (according to nvram2env(4))

hint.nvram.0.base=0x1c7f8000 (it's valid address for Asus RT-N53 with
flags = 0x4)

* Build & load kernel with bootverbose

Actual result: only part of nvram variables are found
Expected result: all variables are found

Submitted by: Michael Zhilin <mizhka@gmail.com>
Differential Revision: https://reviews.freebsd.org/D6466

8 years ago[bhnd] Add support for querying the attachment type of the bhnd bus.
adrian [Mon, 23 May 2016 03:47:44 +0000 (03:47 +0000)]
[bhnd] Add support for querying the attachment type of the bhnd bus.

This adds a BHND_BUS_GET_ATTACH_TYPE(); the primary use-case is to let
chipc make a coarse-grained determination as to whether UART, SPI, etc
drivers ought to be attached, and on fullmac devices, whether a real
CPU driver ought to be skipped for the ARM core, etc.

Tested:

* BCM4331 (BHND)
* BCM4312 (SIBA)

Submitted by: Landon Fuller <landonf@landonf.org>
Differential Revision: https://reviews.freebsd.org/D6492

8 years ago[ixl] fix build for RSS.
adrian [Mon, 23 May 2016 03:46:36 +0000 (03:46 +0000)]
[ixl] fix build for RSS.

Untested.

8 years ago[bhnd] Fix DEFINE_CLASS_(2|3) multiple inheritance support.
adrian [Mon, 23 May 2016 03:29:43 +0000 (03:29 +0000)]
[bhnd] Fix DEFINE_CLASS_(2|3) multiple inheritance support.

This diff updates DEFINE_CLASS_2/_3 to support the specification of class
name separately from the class variable name, bringing them into sync
with their API documentation, as well as the behavior of DEFINE_CLASS_0/_1.

Nothing in the tree currently uses the _2/_3 variants, and I can't
find any references to the API outside of commits to the kobj.h
header itself; given the limitation that currently exists, I'd
be surprised if they've ever been used.

Submitted by: Landon Fuller <landonf@landonf.org>
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D6491

8 years agoHopefully fix Coverity CID 1008328 (Out-of-bounds write) in /bin/sh.
truckman [Mon, 23 May 2016 01:01:23 +0000 (01:01 +0000)]
Hopefully fix Coverity CID 1008328 (Out-of-bounds write) in /bin/sh.

Replace the magic constant 127 in the loop interation count with
"PROMPTLEN - 1".

gethostname() is not guaranteed to NUL terminate the destination
string if it is too short. Decrease the length passed to gethostname()
by one, and add a NUL at the end of the buffer to make sure the
following loop to find the end of the name properly terminates.

The default: case is the likely cause of Coverity CID 1008328.  If
i is 126 at the top of the loop interation where the default case
is triggered, i will be incremented to 127 by the default case,
then incremented to 128 at the top of the loop before being compared
to 127 (PROMPTLENT - 1) and terminating the loop. Then the NUL
termination code after the loop will write to ps[128].  Fix by
checking for overflow before incrementing the index and storing the
second character in the buffer.

These fixes are not guaranteed to satisfy Coverity. The code that
increments i in the 'h'/'H' and 'w'/'W' cases may be beyond its
capability to analyze, but the code appears to be safe.

Reported by: Coverity
CID: 1008328
Reviewed by: jilles, cem
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D6482

8 years agoMark swap-related proc sysctls as not requiring Giant.
kib [Sun, 22 May 2016 23:28:23 +0000 (23:28 +0000)]
Mark swap-related proc sysctls as not requiring Giant.

Reviewed by: alc (as part of larger patch)
Sponsored by: The FreeBSD Foundation

8 years agoReplace hand-made exclusive lock, protecting against parallel
kib [Sun, 22 May 2016 23:25:01 +0000 (23:25 +0000)]
Replace hand-made exclusive lock, protecting against parallel
swapon/swapoff invocations, with sx.

Reviewed by: alc (as part of larger patch)
Sponsored by: The FreeBSD Foundation

8 years agoRestore the translation of armv6hf->arm when generating MACHINE_CPUARCH.
ian [Sun, 22 May 2016 21:31:20 +0000 (21:31 +0000)]
Restore the translation of armv6hf->arm when generating MACHINE_CPUARCH.
It turns out we need to leave this in place for a while so that people
running self-hosting armv6hf systems can do the builds necessary to update
to armv6 (which is now hardfloat by default).

8 years agobsdinstall/zfsboot GPT+BIOS+GELI installs now make use of GELIBOOT
allanjude [Sun, 22 May 2016 20:31:52 +0000 (20:31 +0000)]
bsdinstall/zfsboot GPT+BIOS+GELI installs now make use of GELIBOOT

In this configuration, a separate bootpool is not required.
This allows ZFS Boot Environments to be used with GELI encrypted ZFS pools.

Support for GPT+EFI+GELI is planned for the future.

Tested by: Joseph Mingrone, HardenedBSD
Relnotes: yes
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D5869

8 years agognugrep: Update the configuration.
pfg [Sun, 22 May 2016 20:17:55 +0000 (20:17 +0000)]
gnugrep: Update the configuration.

The only effect is that it will use our native iconv(3).

Relnotes: yes

8 years agourtwn: cleanup some unused code in urtwn_tx_data().
avos [Sun, 22 May 2016 20:12:07 +0000 (20:12 +0000)]
urtwn: cleanup some unused code in urtwn_tx_data().

- Drop unused 'subtype' variable.
- Remove obsolete comment (hardware crypto support was added in r292175).

8 years agourtwn: setup per-frame retry limit.
avos [Sun, 22 May 2016 19:43:40 +0000 (19:43 +0000)]
urtwn: setup per-frame retry limit.

Override global retry limit (which is set in R92C_RL) via per-frame
TX descriptor field. Obsoletes D3840 (should work better with 2+ vaps).

Tested with RTL8188EU and RTL8192CUS in STA mode (maxretry = [3-9]).

8 years agoRemove false claim. Giant is dropped by mi_startup() before passing
kib [Sun, 22 May 2016 19:25:53 +0000 (19:25 +0000)]
Remove false claim.  Giant is dropped by mi_startup() before passing
the control to swapper.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

8 years agoConvert proto family in both directions. The linux and native values for
dchagin [Sun, 22 May 2016 19:08:29 +0000 (19:08 +0000)]
Convert proto family in both directions. The linux and native values for
local and inet are identical, but for inet6 values differ.

PR: 155040
Reported by: Simon Walton
MFC after: 2 week

8 years agoWrap EXPAND(..) macro with a do-while(0) loop and put a single statement on each...
ngie [Sun, 22 May 2016 19:06:38 +0000 (19:06 +0000)]
Wrap EXPAND(..) macro with a do-while(0) loop and put a single statement on each line

As a positive side-effect, this eliminates the double semicolons reported by Coverity:
the macro contained a trailing semicolon, in addition to the semicolon placed on
each line where EXPAND(..) was called.

MFC after: 1 week
Reported by: Coverity
CID: 1194269
Sponsored by: EMC / Isilon Storage Division

8 years agoRemove a now unused global declaration of some sysentvec struct.
dchagin [Sun, 22 May 2016 19:04:34 +0000 (19:04 +0000)]
Remove a now unused global declaration of some sysentvec struct.

MFC after: 2 week

8 years agoFix humanized decoding of struct stat with respect to .st_mtim
ngie [Sun, 22 May 2016 18:20:45 +0000 (18:20 +0000)]
Fix humanized decoding of struct stat with respect to .st_mtim

st_mtim was being incorrectly described as "stime=", not "mtime=". This was
introduced with the original feature commit (r176471).

MFC after: 1 week
PR: 209699
Submitted by: naddy
Sponsored by: EMC / Isilon Storage Division

8 years agoRemove drop/reacquire of Giant around geom calls for cd9660 and udf.
kib [Sun, 22 May 2016 18:16:25 +0000 (18:16 +0000)]
Remove drop/reacquire of Giant around geom calls for cd9660 and udf.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoFix default ZFS layout to work better by default with sysutils/beadm
allanjude [Sun, 22 May 2016 16:24:21 +0000 (16:24 +0000)]
Fix default ZFS layout to work better by default with sysutils/beadm

The root file system is mounted early via vfs.root.mountfrom.
The canmount=noauto property only affects the zfs rc.d script.
This ensures that the 'default' BE is not mounted overtop of another BE when
one is selected from the beastie menu

Sponsored by: ScaleEngine Inc.

8 years agoImprove panic message by specifying on which cpu it really is.
ache [Sun, 22 May 2016 15:22:45 +0000 (15:22 +0000)]
Improve panic message by specifying on which cpu it really is.

8 years agoarc4random() returns 0 to (2**32)−1, use an alternative to initialize
kevlo [Sun, 22 May 2016 14:31:20 +0000 (14:31 +0000)]
arc4random() returns 0 to (2**32)−1, use an alternative to initialize
i_gen if it's zero rather than a divide by 2.

With inputs from  delphij, mckusick, rmacklem

Reviewed by: mckusick

8 years agondis(4): Undo unneeded workarounds in ndis' rand().
pfg [Sun, 22 May 2016 14:13:20 +0000 (14:13 +0000)]
ndis(4):  Undo unneeded workarounds in ndis' rand().

- Revert the change for seed(0) in r300384. I misunderstood the standard
and while our random() implementation in libkern may be improved, it
handles the seed(0) case fine.

Pointed out by: bde, ache

8 years agoFix the deciKelvin to Celsius conversion in kernel.
loos [Sun, 22 May 2016 13:58:32 +0000 (13:58 +0000)]
Fix the deciKelvin to Celsius conversion in kernel.

After r285994, sysctl(8) was fixed to use 273.15 instead of 273.20 as 0C
reference and as result, the temperature read in sysctl(8) now exibits a
+0.1C difference.

This commit fix the kernel references to match the reference value used in
sysctl(8) after r285994.

Sponsored by: Rubicon Communications (Netgate)

8 years agovfork(2): Mention some risks of calling vfork() from application code.
jilles [Sun, 22 May 2016 13:32:45 +0000 (13:32 +0000)]
vfork(2): Mention some risks of calling vfork() from application code.

MFC after: 1 week

8 years agoFix typo introduced by me (not the submitter) when fixing typos
bapt [Sun, 22 May 2016 13:10:48 +0000 (13:10 +0000)]
Fix typo introduced by me (not the submitter) when fixing typos

8 years agoFix typos in the comments
bapt [Sun, 22 May 2016 13:04:45 +0000 (13:04 +0000)]
Fix typos in the comments

Submitted by: cipherwraith666@gmail.com (via github)

8 years agoFix typo in comments for the zfsboot script
bapt [Sun, 22 May 2016 12:59:07 +0000 (12:59 +0000)]
Fix typo in comments for the zfsboot script

Submitted by: Colby Swandale <colby@taplaboratories.com.au> (via github)

8 years agoAdd a missing errno translation for SO_ERROR optname.
dchagin [Sun, 22 May 2016 12:49:08 +0000 (12:49 +0000)]
Add a missing errno translation for SO_ERROR optname.

PR: 135458
Reported by: Stefan Schmidt @ stadtbuch.de
MFC after: 1 week

8 years agoAdd macro to convert errno and use it when appropriate.
dchagin [Sun, 22 May 2016 12:46:34 +0000 (12:46 +0000)]
Add macro to convert errno and use it when appropriate.

MFC after: 1 week

8 years agoFor future use move futex timeout code to the separate function and
dchagin [Sun, 22 May 2016 12:37:40 +0000 (12:37 +0000)]
For future use move futex timeout code to the separate function and
switch to the high resolution sbintime_t.

MFC after: 1 week

8 years agoDue to lack the priority propagation feature replace sx by mutex. WIth this
dchagin [Sun, 22 May 2016 12:35:50 +0000 (12:35 +0000)]
Due to lack the priority propagation feature replace sx by mutex. WIth this
commit NPTL tests are ends in 1 minute faster.

MFC after: 1 week

8 years agoAdd my copyright as I rewrote most of the futex code. Minor style(9) cleanup
dchagin [Sun, 22 May 2016 12:28:55 +0000 (12:28 +0000)]
Add my copyright as I rewrote most of the futex code. Minor style(9) cleanup
while here.

MFC after: 1 week

8 years agoMinor style(9) cleanup, no functional changes.
dchagin [Sun, 22 May 2016 12:26:03 +0000 (12:26 +0000)]
Minor style(9) cleanup, no functional changes.

MFC after: 1 week

8 years agoINTRNG - implement pic_post_filter method. This method is fundamental
skra [Sun, 22 May 2016 11:42:34 +0000 (11:42 +0000)]
INTRNG - implement pic_post_filter method. This method is fundamental
one and must always be implemented for a PIC. There is no default for
it intentionally.

8 years agoFix some format strings to make them either correct or uniform.
skra [Sun, 22 May 2016 09:59:43 +0000 (09:59 +0000)]
Fix some format strings to make them either correct or uniform.
No functional change.

8 years agoStop dereferencing _end in crt1.c. This was only needed for brk/sbrk so is
andrew [Sun, 22 May 2016 08:20:30 +0000 (08:20 +0000)]
Stop dereferencing _end in crt1.c. This was only needed for brk/sbrk so is
no longer needed.

Sponsored by: ABT Systems Ltd

8 years ago1) POSIX prohibits printing errors to stderr here and require
ache [Sun, 22 May 2016 06:18:59 +0000 (06:18 +0000)]
1) POSIX prohibits printing errors to stderr here and require
returning NULL:

"Upon successful completion, initstate() and setstate() shall return a
pointer to the previous state array; otherwise, a null pointer shall
be returned.

Although some implementations of random() have written messages to
standard error, such implementations do not conform to POSIX.1-2008."

2) Move error detections earlier to prevent state modifying.

MFC after:      1 week

8 years agoSilence top(1) compiler warnings
ngie [Sun, 22 May 2016 04:17:00 +0000 (04:17 +0000)]
Silence top(1) compiler warnings

The contrib/top code is no longer maintained upstream (last pulled 16 years
ago). The K&R-style followed by the code spews -Wimplicit-int and -Wreturn-type
warnings, amongst others. This silences 131 warnings with as little modification
as possible by adding necessary return types, definitions, headers, and header
guards, and missing header includes.

The 5 warnings that remain are due to undeclared ncurses references. I didn't
include curses.h and term.h because there are several local functions and macros
that conflict with those definitions.

MFC after: 3 weeks
Reviewed by: cem, ngie
Submitted by: Randy Westlund <rwestlun@gmail.com>
Differential Revision: https://reviews.freebsd.org/D6468

8 years agoRemove a couple of extra blank lines.
loos [Sun, 22 May 2016 04:09:05 +0000 (04:09 +0000)]
Remove a couple of extra blank lines.

8 years agoSort and remove a couple of unnecessary headers.
loos [Sun, 22 May 2016 04:02:34 +0000 (04:02 +0000)]
Sort and remove a couple of unnecessary headers.

8 years agoGet rid of two consumers of gpiobus acquire/release.
loos [Sun, 22 May 2016 03:55:57 +0000 (03:55 +0000)]
Get rid of two consumers of gpiobus acquire/release.

The GPIO hardware should not be owned by a single device, this defeats any
chance of use of the GPIO controller as an interrupt source.

ow(4) is now the only consumer of this 'feature' before we can remove it
for good.

Discussed with: ian, bsdimp

8 years agoUse a better prefix for defines, return BUS_PROBE_DEFAULT for probe routine.
loos [Sun, 22 May 2016 03:34:18 +0000 (03:34 +0000)]
Use a better prefix for defines, return BUS_PROBE_DEFAULT for probe routine.

Refuse to attach if the number of given pins is not enough for our needs.

8 years agoFix probe routine to return BUS_PROBE_DEFAULT instead of BUS_PROBE_SPECIFIC.
loos [Sun, 22 May 2016 03:12:49 +0000 (03:12 +0000)]
Fix probe routine to return BUS_PROBE_DEFAULT instead of BUS_PROBE_SPECIFIC.

While here fix a few style(9) issues.

8 years agonis_rpcent: don't leak resultbuf from yp_first(..)/yp_next(..)
ngie [Sun, 22 May 2016 03:05:27 +0000 (03:05 +0000)]
nis_rpcent: don't leak resultbuf from yp_first(..)/yp_next(..)

If the buffer couldn't be adequately resized to accomodate an additional "\n",
it would leak resultbuf by breaking from the loop early

MFC after: 2 weeks
Reported by: Coverity
CID: 1016702
Sponsored by: EMC / Isilon Storage Division

8 years agoCall endnetconfig on nc_handle sooner to avoid leaking nc_handle if tmpnconf
ngie [Sun, 22 May 2016 02:53:17 +0000 (02:53 +0000)]
Call endnetconfig on nc_handle sooner to avoid leaking nc_handle if tmpnconf
was NULL

This would theoretically happen if the netconfig protocol family and protocol
semantics were never matched.

MFC after: 2 weeks
Reported by: Coverity
CID: 978179
Sponsored by: EMC / Isilon Storage Division

8 years agogetnetid(..): consistently fclose fd at the end of the function
ngie [Sun, 22 May 2016 02:24:38 +0000 (02:24 +0000)]
getnetid(..): consistently fclose fd at the end of the function

This mutes a false positive with cppcheck, but also helps eliminate future
potential issues with this variable

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoDon't leak `handle` if svc_tp_create(..) succeeds and allocating a new
ngie [Sun, 22 May 2016 02:02:18 +0000 (02:02 +0000)]
Don't leak `handle` if svc_tp_create(..) succeeds and allocating a new
struct xlist object fails

MFC after: 1 week
Reported by: Coverity
CID: 978277
Sponsored by: EMC / Isilon Storage Division