]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoYank crufty INTR_FILTER option
cem [Thu, 24 May 2018 17:06:00 +0000 (17:06 +0000)]
Yank crufty INTR_FILTER option

It was introduced to the tree in r169320 and r169321 in May 2007.

It never got much use and never became a kernel default.  The code
duplicates the default path quite a bit, with slight modifications.  Just
yank out the cruft.  Whatever goals were being aimed for can probably be met
within the existing framework, without a flag day option.

Mostly mechanical change: 'unifdef -m -UINTR_FILTER'.

Reviewed by: mmacy
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D15546

6 years agoexect() was removed in 2018, not 2017.
brooks [Thu, 24 May 2018 17:05:41 +0000 (17:05 +0000)]
exect() was removed in 2018, not 2017.

6 years agoDon't implement break(2) at all on aarch64 and riscv.
brooks [Thu, 24 May 2018 17:04:27 +0000 (17:04 +0000)]
Don't implement break(2) at all on aarch64 and riscv.

This should have been done when they were removed from libc, but was
overlooked in the runup to 11.0.  No users should exist.

Approved by: andrew
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15539

6 years agoif_muge: Add LAN78xx family USB ids but attach only to LAN7800
emaste [Thu, 24 May 2018 16:34:06 +0000 (16:34 +0000)]
if_muge: Add LAN78xx family USB ids but attach only to LAN7800

This driver was developed for the LAN7800 and the register-compatible
LAN7515 and has only been tested on those devices.  Adding support for
other members of the family should be straightforward, once we have
devices to test.

With this change the driver will probe but fail to attach due to the
Chip ID check, but will leave a hint leading to the driver that needs
work.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D15537

6 years agoWe can't release the refcount outside of the periph lock.
imp [Thu, 24 May 2018 16:31:18 +0000 (16:31 +0000)]
We can't release the refcount outside of the periph lock.

We're dropping the periph lock then dropping the refcount. However,
that violates the locking protocol and is racy. This seems to be
the cause of weird occasional panics with a bogus assert.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D15517

6 years agoAvoid two suword() calls per auxarg entry.
brooks [Thu, 24 May 2018 16:25:18 +0000 (16:25 +0000)]
Avoid two suword() calls per auxarg entry.

Instead, construct an auxargs array and copy it out all at once.

Use an array of Elf_Auxinfo rather than pairs of Elf_Addr * to represent
the array. This is the correct type where pairs of words just happend
to work. To reduce the size of the diff, AUXARGS_ENTRY is altered to act
on this array rather than introducing a new macro.

Return errors on copyout() and suword() failures and handle them in the
caller.

Incidentally fixes AT_RANDOM and AT_EXECFN in 32-bit linux on amd64
which incorrectly used AUXARG_ENTRY instead of AUXARGS_ENTRY_32
(now removed due to the use of proper types).

Reviewed by: kib
Comments from: emaste, jhb
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15485

6 years agoRemove physmap from the arm64 machdep.h. This was missed in r334162.
andrew [Thu, 24 May 2018 16:07:47 +0000 (16:07 +0000)]
Remove physmap from the arm64 machdep.h. This was missed in r334162.

6 years agoAdd Peraso Technologies, Inc. to the list.
bz [Thu, 24 May 2018 15:47:15 +0000 (15:47 +0000)]
Add Peraso Technologies, Inc. to the list.

Sponsored by: Turing Robotic Industries

6 years agoAllow us to read the physmap data into our own array and use this to build
andrew [Thu, 24 May 2018 15:32:49 +0000 (15:32 +0000)]
Allow us to read the physmap data into our own array and use this to build
the DMAP region on arm64.

We already have the needed information to build these tables, we just need
to extract it. This significantly simplifies the code.

Obtained from: ABT Systems Ltd
Sponsored by: Turing Robotic Industries

6 years agoTry to be consistent and spell "vnet" lower case like all the
bz [Thu, 24 May 2018 15:31:05 +0000 (15:31 +0000)]
Try to be consistent and spell "vnet" lower case like all the
other options (and as we do on command line).

Sponsored by: iXsystems, Inc.

6 years agoImprove the KASSERT to also have the prison pointer.
bz [Thu, 24 May 2018 15:28:21 +0000 (15:28 +0000)]
Improve the KASSERT to also have the prison pointer.
Helpful when debugging from ddb.

Sponsored by: iXsystems, Inc.

6 years agoAF_UNIX: assert that we're not acquiring the same lock
mmacy [Thu, 24 May 2018 15:28:16 +0000 (15:28 +0000)]
AF_UNIX: assert that we're not acquiring the same lock

6 years agoAdd function to wait for USB ethernet attach to complete.
hselasky [Thu, 24 May 2018 15:24:42 +0000 (15:24 +0000)]
Add function to wait for USB ethernet attach to complete.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoPrint the physmem tables under a verbose boot.
andrew [Thu, 24 May 2018 15:07:53 +0000 (15:07 +0000)]
Print the physmem tables under a verbose boot.

Obtained from: ABT Systems Ltd
Sponsored by: Turing Robotic Industries

6 years agoremove All Rights Reserved from new libpmcstat file
mmacy [Thu, 24 May 2018 15:04:44 +0000 (15:04 +0000)]
remove All Rights Reserved from new libpmcstat file

6 years agoExclude memory from the /reserved-memory mappings with the no-map property
andrew [Thu, 24 May 2018 14:55:50 +0000 (14:55 +0000)]
Exclude memory from the /reserved-memory mappings with the no-map property
set. This memory must not be mapped by the operating system other than
under control of the device driver.

Obtained from: ABT Systems Ltd
Sponsored by: Turing Robotic Industries

6 years agoSplit the active and inactive queue scans into separate subroutines.
markj [Thu, 24 May 2018 14:16:22 +0000 (14:16 +0000)]
Split the active and inactive queue scans into separate subroutines.

The scans are largely independent, so this helps make the code
marginally neater, and makes it easier to incorporate feedback from the
active queue scan into the page daemon control loop.

Improve some comments while here.  No functional change intended.

Reviewed by: alc, kib
Differential Revision: https://reviews.freebsd.org/D15490

6 years agoRestore arm, riscv, sparc64, and mips to UNIVERSE after r334128
emaste [Thu, 24 May 2018 14:01:22 +0000 (14:01 +0000)]
Restore arm, riscv, sparc64, and mips to UNIVERSE after r334128

6 years agocxgbe(4): Report IFCAP_TXRTLMT to kernels built with RATELIMIT if the
np [Thu, 24 May 2018 10:55:26 +0000 (10:55 +0000)]
cxgbe(4): Report IFCAP_TXRTLMT to kernels built with RATELIMIT if the
firmware has provisioned resources for this feature.

Sponsored by: Chelsio Communications

6 years agoxen/pvh: allocate dbg_stack
royger [Thu, 24 May 2018 10:22:57 +0000 (10:22 +0000)]
xen/pvh: allocate dbg_stack

Or else init_secondary will hit a page fault (or write garbage
somewhere).

Sponsored by: Citrix Systems R&D

6 years agoxen/evtchn: fix LOR in evtchn device
royger [Thu, 24 May 2018 10:20:42 +0000 (10:20 +0000)]
xen/evtchn: fix LOR in evtchn device

Remove the device from the list before unbinding it. Doing it in this
order allows calling xen_intr_unbind without holding the bind_mutex
lock.

Sponsored by: Citrix Systems R&D

6 years agoxen-blkback: don't unbind the interrupt while holding the lock
royger [Thu, 24 May 2018 10:19:54 +0000 (10:19 +0000)]
xen-blkback: don't unbind the interrupt while holding the lock

There's no need to perform the interrupt unbind while holding the
blkback lock, and doing so leads to the following LOR:

lock order reversal: (sleepable after non-sleepable)
 1st 0xfffff8000802fe90 xbbd1 (xbbd1) @ /usr/src/sys/dev/xen/blkback/blkback.c:3423
 2nd 0xffffffff81fdf890 intrsrc (intrsrc) @ /usr/src/sys/x86/x86/intr_machdep.c:224
stack backtrace:
#0 0xffffffff80bdd993 at witness_debugger+0x73
#1 0xffffffff80bdd814 at witness_checkorder+0xe34
#2 0xffffffff80b7d798 at _sx_xlock+0x68
#3 0xffffffff811b3913 at intr_remove_handler+0x43
#4 0xffffffff811c63ef at xen_intr_unbind+0x10f
#5 0xffffffff80a12ecf at xbb_disconnect+0x2f
#6 0xffffffff80a12e54 at xbb_shutdown+0x1e4
#7 0xffffffff80a10be4 at xbb_frontend_changed+0x54
#8 0xffffffff80ed66a4 at xenbusb_back_otherend_changed+0x14
#9 0xffffffff80a2a382 at xenwatch_thread+0x182
#10 0xffffffff80b34164 at fork_exit+0x84
#11 0xffffffff8101ec9e at fork_trampoline+0xe

Reported by:    Nathan Friess <nathan.friess@gmail.com>
Sponsored by:   Citrix Systems R&D

6 years agodev/xenstore: prevent transaction hijacking
royger [Thu, 24 May 2018 10:18:31 +0000 (10:18 +0000)]
dev/xenstore: prevent transaction hijacking

The user-space xenstore device is currently lacking a check to make
sure that the caller is only using transaction ids currently assigned
to it. This allows users of the xenstore device to hijack transactions
not started by them, although the scope is limited to transactions
started by the same domain.

Tested by:      Nathan Friess <nathan.friess@gmail.com>
Sponsored by:   Citrix Systems R&D

6 years agocxgbe(4): Data path for rate-limited tx.
np [Thu, 24 May 2018 10:18:14 +0000 (10:18 +0000)]
cxgbe(4): Data path for rate-limited tx.

This is hardware support for the SO_MAX_PACING_RATE sockopt (see
setsockopt(2)), which is available in kernels built with "options
RATELIMIT".

Relnotes: Yes
Sponsored by: Chelsio Communications

6 years agodev/xenstore: add support for watches
royger [Thu, 24 May 2018 10:17:49 +0000 (10:17 +0000)]
dev/xenstore: add support for watches

Allow user-space applications to register watches using the xenstore
device.  This is needed in order to run toolstack operations on
domains different than the one where xenstore is running (in which
case the device is not used, since the connection to xenstore is done
using a plain socket).

Tested by:      Nathan Friess <nathan.friess@gmail.com>
Sponsored by:   Citrix Systems R&D

6 years agoxenstore: don't wait with the PCATCH flag
royger [Thu, 24 May 2018 10:17:03 +0000 (10:17 +0000)]
xenstore: don't wait with the PCATCH flag

Due to the current synchronous xenstore implementation in FreeBSD, we
cannot return from xs_read_reply without reading a reply, or else the
ring gets out of sync and the next request will read the previous
reply and crash due to the type mismatch. A proper solution involves
making use of the req_id field in the message and allowing multiple
in-flight messages at the same time on the ring.

Remove the PCATCH flag so that signals don't interrupt the wait.

Tested by:      Nathan Friess <nathan.friess@gmail.com>
Sponsored by:   Citrix Systems R&D

6 years agoxenstore: remove the suspend sx lock
royger [Thu, 24 May 2018 10:16:11 +0000 (10:16 +0000)]
xenstore: remove the suspend sx lock

There's no need to prevent suspend while doing xenstore transactions,
callers of transactions are supposed to be prepared for a transaction
to fail.

This fixes a bug that could be triggered from the xenstore user-space
device, since starting a transaction from user-space would result in
returning there with a sx lock held, that causes a WITNESS check to
trigger.

Tested by:      Nathan Friess <nathan.friess@gmail.com>
Sponsored by:   Citrix Systems R&D

6 years agocxgbe/t4_tom: ABORT_RPL_RSS is a shared CPL and t4_tom shouldn't remove
np [Thu, 24 May 2018 08:32:02 +0000 (08:32 +0000)]
cxgbe/t4_tom: ABORT_RPL_RSS is a shared CPL and t4_tom shouldn't remove
the global handler when it's being unloaded.

6 years agocxgbe(4): Make FW4_ACK a shared CPL. ETHOFLD in the base driver will
np [Thu, 24 May 2018 08:21:43 +0000 (08:21 +0000)]
cxgbe(4): Make FW4_ACK a shared CPL.  ETHOFLD in the base driver will
use it for per-flow rate limiting.

Sponsored by: Chelsio Communications

6 years agocxgbe(4): Fix range checks in is_etid.
np [Thu, 24 May 2018 08:02:11 +0000 (08:02 +0000)]
cxgbe(4): Fix range checks in is_etid.

6 years agocxgbe(4): Slightly simpler needs_<foo> functions.
np [Thu, 24 May 2018 07:38:46 +0000 (07:38 +0000)]
cxgbe(4): Slightly simpler needs_<foo> functions.

6 years agopmcstat: add usage strings for -L and -I
mmacy [Thu, 24 May 2018 07:18:49 +0000 (07:18 +0000)]
pmcstat: add usage strings for -L and -I

6 years agolibpmcstat: import aliases table and bug fixes
mmacy [Thu, 24 May 2018 06:47:40 +0000 (06:47 +0000)]
libpmcstat: import aliases table and bug fixes

6 years agopmcstat top mode + -I - use fully qualified address
mmacy [Thu, 24 May 2018 06:47:04 +0000 (06:47 +0000)]
pmcstat top mode + -I - use fully qualified address

6 years agocxgbe(4): Make sure that the egress queue's cidx is updated periodically
np [Thu, 24 May 2018 06:44:06 +0000 (06:44 +0000)]
cxgbe(4): Make sure that the egress queue's cidx is updated periodically
when the driver is writing WRs using start_wrq_wr/commit_wrq_wr all the
time.

Sponsored by: Chelsio Communications

6 years agopmcstat: don't compare signed and unsigned
mmacy [Thu, 24 May 2018 04:43:40 +0000 (04:43 +0000)]
pmcstat: don't compare signed and unsigned

6 years agofix !amd64 signature for pmu_sample_rate_get
mmacy [Thu, 24 May 2018 04:38:17 +0000 (04:38 +0000)]
fix !amd64 signature for pmu_sample_rate_get

6 years agotake NUMA out
mmacy [Thu, 24 May 2018 04:31:53 +0000 (04:31 +0000)]
take NUMA out

6 years agolibpmcstat: compile in events based on json description
mmacy [Thu, 24 May 2018 04:30:06 +0000 (04:30 +0000)]
libpmcstat: compile in events based on json description

6 years agodevd: drop WARNS back down to 3 until 6 actually works with GCC
mmacy [Thu, 24 May 2018 01:12:06 +0000 (01:12 +0000)]
devd: drop WARNS back down to 3 until 6 actually works with GCC

6 years agoconvert allocations to INVARIANTS M_ZERO
mmacy [Thu, 24 May 2018 01:04:56 +0000 (01:04 +0000)]
convert allocations to INVARIANTS M_ZERO

6 years agomalloc: Add flag for conditionally zeroing for INVARIANTS builds
mmacy [Thu, 24 May 2018 01:03:31 +0000 (01:03 +0000)]
malloc: Add flag for conditionally zeroing for INVARIANTS builds

6 years agoCatch up two more places to the V_ifnet change to a CK_STAILQ.
jhb [Thu, 24 May 2018 00:06:55 +0000 (00:06 +0000)]
Catch up two more places to the V_ifnet change to a CK_STAILQ.

6 years agox86: stop unconditionally clearing PSL_T on the trace trap.
kib [Wed, 23 May 2018 21:39:29 +0000 (21:39 +0000)]
x86: stop unconditionally clearing PSL_T on the trace trap.

We certainly should clear PSL_T when calling the SIGTRAP signal
handler, which is already done by all x86 sendsig(9) ABI code.  On the
other hand, there is no obvious reason why PSL_T needs to be cleared
when returning from the signal handler.  For instance, Linux allows
userspace to set PSL_T and keep tracing enabled for the desired
period.  There are userspace programs which would use PSL_T if we make
it possible, for instance sbcl.

Remember if PSL_T was set by PT_STEP or PT_SETSTEP by mean of TDB_STEP
flag, and only clear it when the flag is set.

Discussed with: Ali Mashtizadeh
Reviewed by: jhb (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D15054

6 years agoStop obliterating actual exception type for emulated traps from vm86.
kib [Wed, 23 May 2018 21:26:41 +0000 (21:26 +0000)]
Stop obliterating actual exception type for emulated traps from vm86.

Wording and reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D15054

6 years agoRevert r334081 (-Wmain) as it broke the build on gcc architectures
emaste [Wed, 23 May 2018 21:26:33 +0000 (21:26 +0000)]
Revert r334081 (-Wmain) as it broke the build on gcc architectures

6 years agoStyle.
kib [Wed, 23 May 2018 21:25:49 +0000 (21:25 +0000)]
Style.

Wording and reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D15054

6 years agoUDP: further performance improvements on tx
mmacy [Wed, 23 May 2018 21:02:14 +0000 (21:02 +0000)]
UDP: further performance improvements on tx

Cumulative throughput while running 64
  netperf -H $DUT -t UDP_STREAM -- -m 1
on a 2x8x2 SKL went from 1.1Mpps to 2.5Mpps

Single stream throughput increases from 910kpps to 1.18Mpps

Baseline:
https://people.freebsd.org/~mmacy/2018.05.11/udpsender2.svg

- Protect read access to global ifnet list with epoch
https://people.freebsd.org/~mmacy/2018.05.11/udpsender3.svg

- Protect short lived ifaddr references with epoch
https://people.freebsd.org/~mmacy/2018.05.11/udpsender4.svg

- Convert if_afdata read lock path to epoch
https://people.freebsd.org/~mmacy/2018.05.11/udpsender5.svg

A fix for the inpcbhash contention is pending sufficient time
on a canary at LLNW.

Reviewed by: gallatin
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15409

6 years agoudp: assign flowid to udp sockets round-robin
mmacy [Wed, 23 May 2018 20:50:09 +0000 (20:50 +0000)]
udp: assign flowid to udp sockets round-robin

On a 2x8x2 SKL this increases measured throughput with 64
netperf -H $DUT -t UDP_STREAM -- -m 1

from 590kpps to 1.1Mpps
before:
https://people.freebsd.org/~mmacy/2018.05.11/udpsender.svg
after:
https://people.freebsd.org/~mmacy/2018.05.11/udpsender2.svg

6 years agoCentralize USB device mode bus power reporting, and add
trasz [Wed, 23 May 2018 20:06:04 +0000 (20:06 +0000)]
Centralize USB device mode bus power reporting, and add
hw.usb.template_power sysctl to control it.

Reviewed by: hselasky@ (earlier version)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

6 years agopmc: bump PMC major version to reflect ABI breakage and make warning not require...
mmacy [Wed, 23 May 2018 19:55:47 +0000 (19:55 +0000)]
pmc: bump PMC major version to reflect ABI breakage and make warning not require verbose

6 years agoAdding myself to committers-src.dot and calendar.freebsd
luporl [Wed, 23 May 2018 19:17:17 +0000 (19:17 +0000)]
Adding myself to committers-src.dot and calendar.freebsd

Approved by: jhibbits (mentor)

6 years agoarm64: rockchip: Add proper armclock support
manu [Wed, 23 May 2018 19:07:03 +0000 (19:07 +0000)]
arm64: rockchip: Add proper armclock support

The core clock (armclk) on RockChip SoC is special.
It can derive it's clock from many PLLs but RockChip recommand to do it
from "apll" on old SoC and "npll" on new SoC. The reason for choosing npll
is that it's have less jitter and is more close to the arm core on the SoC.
r333314 added the core clock as a composite clock but due to it's specials
property we need to deal with it differently.
A new rk_clk_armclk type is added for this and it supports only the "npll"
as we don't run on old RockChip SoC that only have the "apll".
It will always reparent to "npll" and set the frequency according to a rate
table that is known to be good.
For now we set the "npll" to the desired frequency and just set the core clk
divider to 1 as its parent it just used for the core clk.

6 years agoNote that PT_SETSTEP is auto-cleared.
kib [Wed, 23 May 2018 17:55:30 +0000 (17:55 +0000)]
Note that PT_SETSTEP is auto-cleared.

Wording and reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D15054

6 years agohwppmc: set threadid in callchain records - second part of r334108
mmacy [Wed, 23 May 2018 17:44:29 +0000 (17:44 +0000)]
hwppmc: set threadid in callchain records - second part of r334108

6 years agoUPDATING: note that the pmc callchain ABI has changed
mmacy [Wed, 23 May 2018 17:30:23 +0000 (17:30 +0000)]
UPDATING: note that the pmc callchain ABI has changed

6 years agohwpmc: add thread id field to callchain and context switch records to allow filtering
mmacy [Wed, 23 May 2018 17:25:00 +0000 (17:25 +0000)]
hwpmc: add thread id field to callchain and context switch records to allow filtering
on thread in post-processing.

To generate stacks for just ${THREADID}:

pmcstat -R ${PREFIX}.pmcstat -L ${THREADID} -z100 -G ${PREFIX}.stacks

Sponsored by: Limelight Networks

6 years agoRemove references to the LIBC_SCCS and SYSLIBC_SCCS C macros.
jhb [Wed, 23 May 2018 17:05:12 +0000 (17:05 +0000)]
Remove references to the LIBC_SCCS and SYSLIBC_SCCS C macros.

This language dates back to when libthr was libc_r that included its own
syscalls and replaced libc entirely.  It hasn't been relevant for a long
time.

6 years agoUse __SCCSID() for SCCS IDs.
jhb [Wed, 23 May 2018 17:02:12 +0000 (17:02 +0000)]
Use __SCCSID() for SCCS IDs.

- Define NO__SCCSID in CFLAGS to preserve existing behavior of omitting
  SCCS IDs by default.
- While here, fix the $FreeBSD$ in pw_util.c to use __FBSDID.

6 years agoRevert r334090.
markj [Wed, 23 May 2018 17:01:28 +0000 (17:01 +0000)]
Revert r334090.

It causes the 32bit compat build of libmd to fail with:

libmd/rmd160c.c:86:9: error: 'ripemd160_block' macro redefined
#define ripemd160_block ripemd160_block_x86
        ^
libmd/ripemd.h:122:9: note: previous definition is here
#define ripemd160_block         _libmd_ripemd160_block

6 years agoepoch: allow for conditionally asserting that the epoch context fields
mmacy [Wed, 23 May 2018 17:00:05 +0000 (17:00 +0000)]
epoch: allow for conditionally asserting that the epoch context fields
are unused by zeroing on INVARIANTS builds

6 years agoSupport IBRS for i386.
kib [Wed, 23 May 2018 16:31:46 +0000 (16:31 +0000)]
Support IBRS for i386.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D15522

6 years agoSwitch calendar installs to use FILES and SYMLINKS instead of bare install(1)
brd [Wed, 23 May 2018 16:28:31 +0000 (16:28 +0000)]
Switch calendar installs to use FILES and SYMLINKS instead of bare install(1)

Also explicitly list each file to install so we don't silently add or miss
some.

Approved by: bapt (mentor)

6 years agoAdd GET_STACK_USAGE() for arm64.
markj [Wed, 23 May 2018 15:43:35 +0000 (15:43 +0000)]
Add GET_STACK_USAGE() for arm64.

Its absence meant that GEOM direct dispatch was disabled (the service
routines check the current thread's stack usage to determine whether
to hand off the request to a dedicated thread), and this change is
sufficient to enable direct dispatch by default.

Reviewed by: allanjude
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D15527

6 years agoDocument the return value of sbuf_bcat(9).
markj [Wed, 23 May 2018 15:26:56 +0000 (15:26 +0000)]
Document the return value of sbuf_bcat(9).

MFC after: 1 week

6 years agoAdd ready polling after PHY reset on VIA SATA controllers.
mav [Wed, 23 May 2018 15:22:58 +0000 (15:22 +0000)]
Add ready polling after PHY reset on VIA SATA controllers.

According to PR there are cases of controller hang if soft reset is
sent before device report ready status after the hard reset.

I don't think this patch is perfect, but it was reported as working
by the submitter, and I have neither the old hardware nor interest to
test some improved version, so just done some style cleaning.

PR: 183294
Submitted by: alexandre.martins@netasq.com
MFC after: 1 month

6 years agoAdding myself share/misc/committers-src.dot.
leitao [Wed, 23 May 2018 14:19:06 +0000 (14:19 +0000)]
Adding myself share/misc/committers-src.dot.

6 years agodevd: Move variable declaration to header
eadler [Wed, 23 May 2018 13:48:16 +0000 (13:48 +0000)]
devd: Move variable declaration to header

Reminder by: imp

6 years agoImprove MAC address uniqueness on if_epair(4).
pizzamig [Wed, 23 May 2018 13:10:57 +0000 (13:10 +0000)]
Improve MAC address uniqueness on if_epair(4).

As reported in PR184149, it can happen that epair devices can have the same
MAC address.
This solution is based on a 32-bit hash, obtained combining the if_index of
the a interface and the hostid.
If the hostid is zero, a random number is used.

PR: 184149
Reviewed by: wollman, eugen
Approved by: cognet
Differential Revision: https://reviews.freebsd.org/D15329

6 years agokldstat: align size to the right
eadler [Wed, 23 May 2018 12:10:16 +0000 (12:10 +0000)]
kldstat: align size to the right

This makes it easier to compare numbers directly.

PR: 215747
Submitted by: "Alexander von Gernler" <grunk@pestilenz.org>

6 years agomd5: perform compare case-insenstive
eadler [Wed, 23 May 2018 11:45:46 +0000 (11:45 +0000)]
md5: perform compare case-insenstive

md5 generates a md5 hash lowercase, but it might be provided in
uppercase. Allow this.

PR: 205598
Reported by: ohauer
MFC After: 2 weeks

6 years agolibmd: build with WARNS=1
eadler [Wed, 23 May 2018 11:20:16 +0000 (11:20 +0000)]
libmd: build with WARNS=1

- build with WARNS=1. This works without any changes
- remove two unused variables noticed at WARNS=2

6 years agodumpon: point to better kernel debug symbols.
eadler [Wed, 23 May 2018 10:45:32 +0000 (10:45 +0000)]
dumpon: point to better kernel debug symbols.

The objdir is temporary, and the current example points to GENERIC.
Instead point to the installed location of the debug symbols that are
supposed to match the kernel you are using.

PR: 223993
Submitted by: Trond.Endrestol@ximalas.info

6 years agotimedef: Update Czech timedef
eadler [Wed, 23 May 2018 10:39:02 +0000 (10:39 +0000)]
timedef: Update Czech timedef

This changes date format from 2015/05/12 to 05.12.2015.

PR: 200591
Submitted by: grafnetter@dekanat.mff.cuni.cz

6 years agoRemove incorrect owepreempt assertion added in r334062
mjg [Wed, 23 May 2018 10:13:17 +0000 (10:13 +0000)]
Remove incorrect owepreempt assertion added in r334062

Yet another preemption request hitting between the counter being 0
and the check being reached will result in the flag no longer being
set.

Note the situation was already present prior to r334062 and is harmless.

Reported by: pho
Reviewed by: kib

6 years agodevd: Unbreak build
eadler [Wed, 23 May 2018 10:03:09 +0000 (10:03 +0000)]
devd: Unbreak build

I'm not quite sure why this wasn't caught before. Most likely due to
some generated file not being properly cleaned.

Fix build by just hiding the warnings that `-i` was supposed to fix.

Tested with clang, gcc9, gcc7

6 years agompsutil: correct style
eadler [Wed, 23 May 2018 09:46:21 +0000 (09:46 +0000)]
mpsutil: correct style

Reported by: bapt

6 years agopthread_rwlock_unlock(3) returns 0 if successful, otherwise an error number
araujo [Wed, 23 May 2018 09:34:51 +0000 (09:34 +0000)]
pthread_rwlock_unlock(3) returns 0 if successful, otherwise an error number
will be returned to indicate the error, so I'm applying an assert(3) to do
a sanity check of the return value.

Reported by: Coverity CID: 13912351193654 and 1193651
Reviewed by: grehan
MFC after: 4 weeks.
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D15533

6 years agocut: Fix out of boundary write on illegal list argument
eadler [Wed, 23 May 2018 09:16:20 +0000 (09:16 +0000)]
cut: Fix out of boundary write on illegal list argument

It is possible to trigger an out of boundary write in cut if an invalid
range with autostart has been supplied.

PR: 227330
Submitted by: tobias@stoeckmann.org

6 years agoAdd missing file for WITH{OUT}_BSDINSTAL
eadler [Wed, 23 May 2018 09:02:31 +0000 (09:02 +0000)]
Add missing file for WITH{OUT}_BSDINSTAL

PR: 227805
Submitted by: Dmitry Wagin <dmitry.wagin@ya.ru>

6 years agobsd.sys.mk: add -Wmain to WARNS=1
eadler [Wed, 23 May 2018 08:35:55 +0000 (08:35 +0000)]
bsd.sys.mk: add -Wmain to WARNS=1

Even in very low "WARNS" conditions, 'main' ought to be reasonable.

6 years agobsd.sys.mk: add links and update a bit
eadler [Wed, 23 May 2018 07:54:58 +0000 (07:54 +0000)]
bsd.sys.mk: add links and update a bit

- add links to more modern resources
- remove 'k&r' which is unused in FreeBSD
- remove stray comment

6 years agodevd: allow build to complete using g++
eadler [Wed, 23 May 2018 07:44:50 +0000 (07:44 +0000)]
devd: allow build to complete using g++

6 years agodevd: compile at WARNS=6
eadler [Wed, 23 May 2018 07:39:05 +0000 (07:39 +0000)]
devd: compile at WARNS=6

Verified with "make universe TARGETS='amd64 arm arm64 i386 sparc64'"

6 years agodevd: correct two warnings
eadler [Wed, 23 May 2018 07:39:02 +0000 (07:39 +0000)]
devd: correct two warnings

- catching a polymorphic type by value
- "output between 16 and 95 bytes into a destination of size 80"

6 years agomrsas(4): Remove unneed extra arg from MR_LdBlockSizeGet().
eadler [Wed, 23 May 2018 07:39:00 +0000 (07:39 +0000)]
mrsas(4): Remove unneed extra arg from MR_LdBlockSizeGet().

Obtained From: DragonFly (482292f9859e1ceae4f35343c0a8eac4c4486d1)

6 years agompsutil: add missing braces
eadler [Wed, 23 May 2018 07:38:58 +0000 (07:38 +0000)]
mpsutil: add missing braces

Obtained from: DragonFly (c5d53f11a9510c5c79e196857a1200925fffacc8)

6 years agoBump FreeBSD_version after r333813
mmacy [Wed, 23 May 2018 06:15:55 +0000 (06:15 +0000)]
Bump FreeBSD_version after r333813

6 years agoREADME: Reduce the textdump; describe the project
eadler [Wed, 23 May 2018 04:09:01 +0000 (04:09 +0000)]
README: Reduce the textdump; describe the project

Rework the README to make it a little easier for new users. This is the
first file many will see when persuing the FreeBSD source code so

- remove some of the text describes how to build. This is better covered
in the linked documentation.
- add a small blurb for what FreeBSD is. Some users might find this
document through features such as github search so they may not even
know what the project is

generally, gear this file for the new, accidental, or casual user rather
than towards someone seeking fuller documentation.

6 years agoAdd the text '@generated' to src.conf.5
eadler [Wed, 23 May 2018 03:41:22 +0000 (03:41 +0000)]
Add the text '@generated' to src.conf.5

This is a cross-tool approach to identifying generated code. Some tools,
notably phabricator, handle this marker specially.  See
https://reviews.freebsd.org/differential/diff/42870/ for such an
example.

6 years agoWhoops, forgot to add this file in r334070.
wollman [Wed, 23 May 2018 02:54:28 +0000 (02:54 +0000)]
Whoops, forgot to add this file in r334070.

PR: 164049

6 years agoMove unsigned limits to a separate table/recognizer and display them
wollman [Wed, 23 May 2018 02:51:56 +0000 (02:51 +0000)]
Move unsigned limits to a separate table/recognizer and display them
using the appropriate (unsigned) format specification.  This prevents
integer overflow when ULLONG_MAX and (on some architectures) ULONG_MAX
are used to initialize an intmax_t and then displayed as the signed
value -1.  (A different approach was suggested in the bug report,
which I did not use.)  If other limits are defined to be unsigned,
they could be moved here.

PR: 164049
Reported by: Marcus Reid

6 years agokern_sendit: use pre-initialized rights
mmacy [Wed, 23 May 2018 01:48:09 +0000 (01:48 +0000)]
kern_sendit: use pre-initialized rights

6 years agoImport libxo-0.9.0:
phil [Wed, 23 May 2018 01:20:31 +0000 (01:20 +0000)]
Import libxo-0.9.0:
- Add xo_format_is_numeric() with improved logic to decide if format
  strings are numeric, so json output quotes them
- Convert docs to sphinx/rst
- update tests

Includes fix for PR 221676:
https://github.com/Juniper/libxo/commit/27d3021cc3cc8cfbe9ddee5930cd7a9afea8f68f#diff-5a0d468963477f7daedb8308c219dd80

PR:  221676
MFC after: 5 days

6 years agoTag libxo 0.9.0
phil [Wed, 23 May 2018 01:12:39 +0000 (01:12 +0000)]
Tag libxo 0.9.0

6 years agoImport libxo 0.9.0
phil [Wed, 23 May 2018 01:12:17 +0000 (01:12 +0000)]
Import libxo 0.9.0

6 years agoImplement initial MMC partitions support for MMCCAM.
kibab [Tue, 22 May 2018 22:16:49 +0000 (22:16 +0000)]
Implement initial MMC partitions support for MMCCAM.

For MMC cards, add partitions found on the card as separate disk(9) devices.
Don't do anything with RPMB partition for now.
Lots of code is copied almost 1:1 from the mmcsd.c in the old stack,
credits Marius Strobl (marius@FreeBSD.org)

Reviewed by: marius
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D12762

6 years agoFix UP build.
kib [Tue, 22 May 2018 20:50:19 +0000 (20:50 +0000)]
Fix UP build.

Reported by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoif_muge: only attach to LAN7800 Chip ID
emaste [Tue, 22 May 2018 20:00:56 +0000 (20:00 +0000)]
if_muge: only attach to LAN7800 Chip ID

This driver was developed for the LAN7800 and the register-compatible
LAN7515 (found on Raspberry Pi 3B+) and has only been tested on those
devices.

Sponsored by: The FreeBSD Foundation

6 years agoMove preemption handling out of critical_exit.
mjg [Tue, 22 May 2018 19:24:57 +0000 (19:24 +0000)]
Move preemption handling out of critical_exit.

In preperataion for making the enter/exit pair inline.

Reviewed by: kib