]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agolibpmc: bring pmu_util closer in line with style(9)
mmacy [Wed, 30 May 2018 03:40:02 +0000 (03:40 +0000)]
libpmc: bring pmu_util closer in line with style(9)

6 years agoepoch(9): make epoch closer to style(9)
mmacy [Wed, 30 May 2018 03:39:57 +0000 (03:39 +0000)]
epoch(9): make epoch closer to style(9)

6 years agoMake opal_pci driver work with POWER9
jhibbits [Wed, 30 May 2018 03:00:57 +0000 (03:00 +0000)]
Make opal_pci driver work with POWER9

Summary:
Coupled with r334365, this makes PCI work on POWER9.  There is still more to
do to fully exploit the hardware capabilities, but this is sufficient to
enable USB and ethernet controllers on a POWER9 Talos II system.

Reviewed by: nwhitehorn, leitao
Differential Revision: https://reviews.freebsd.org/D15566

6 years agoCache the phandle of the PCI node in opal_pci_attach
jhibbits [Wed, 30 May 2018 02:47:23 +0000 (02:47 +0000)]
Cache the phandle of the PCI node in opal_pci_attach

Simple cleanup, no functional change.  This is related to the fixups needed
for POWER9 support.

6 years agoRestrict PCIe maxslots to 0, instead of PCI_SLOTMAX
jhibbits [Wed, 30 May 2018 02:41:47 +0000 (02:41 +0000)]
Restrict PCIe maxslots to 0, instead of PCI_SLOTMAX

Summary:
PCIe only permits 1 device on an endpoint, so some devices ignore the device
part of B:D:F probing.  Although ARI likely fixes this, not all platforms
support ARI completely or correctly, so some devices end up showing up 32
times on the bus.

This was found during bringup of POWER9/Talos, and has been tested on POWER9
and POWER8 hardware.

Reviewed by: leitao
Differential Revision: https://reviews.freebsd.org/D15461

6 years agoRemove the mlx5 driver from LINT kernel config for 32-bit PPC
rpokala [Wed, 30 May 2018 02:26:36 +0000 (02:26 +0000)]
Remove the mlx5 driver from LINT kernel config for 32-bit PPC

The mlx5 driver requires 64-bit atomics, which are not supported on 32-bit
PPC. Exclude that driver from the LINT kernel config.

Submitted by: hps (but I re-worded the comment)
Reported by: rpokala
Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D15611

6 years agoelfdump: chase ABI tag note name change from r232832
emaste [Wed, 30 May 2018 01:16:50 +0000 (01:16 +0000)]
elfdump: chase ABI tag note name change from r232832

r232832 changed the ABI tag note name from .note.ABI-tag to .note.tag.
Follow suit in elfdump.

Elfdump's note parsing is very basic and should be significantly
reworked, but for now just restore the broken functionality.

PR: 228290
Submitted by: martin at lispworks.com
MFC after: 1 week

6 years agoTemporarily disconnect audit tests
emaste [Wed, 30 May 2018 00:36:58 +0000 (00:36 +0000)]
Temporarily disconnect audit tests

Audit tests added in r334360 broke the build on a number of archs.
Remove the subdir from the top level tests/sys/Makefile until they're
fixed.

6 years agopmc: don't break build with format issues
mmacy [Wed, 30 May 2018 00:06:17 +0000 (00:06 +0000)]
pmc: don't break build with format issues

6 years agoAdd initial set of tests for audit(4)
asomers [Tue, 29 May 2018 23:08:33 +0000 (23:08 +0000)]
Add initial set of tests for audit(4)

This change includes the framework for testing the auditability of various
syscalls, and includes changes for the first 12.  The tests will start
auditd(8) if needed, though they'll be much faster if it's already running.
The syscalls tested in this commit include mkdir(2), mkdirat(2), mknod(2),
mknodat(2), mkfifo(2), mkfifoat(2), link(2), linkat(2), symlink(2),
symlinkat(2), rename(2), and renameat(2).

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15286

6 years agodwatch(1): Fix "-t test" for post-processing profiles
dteske [Tue, 29 May 2018 22:36:37 +0000 (22:36 +0000)]
dwatch(1): Fix "-t test" for post-processing profiles

Profiles that perform post-processing of the DTrace output were
dropping the "-t test" option on the floor. Fix handling of this
option for said profiles.

X-MFC-to: stable/11
X-MFC-with: r334261-334262
Sponsored by: Smule, Inc.

6 years agoiflib: mark irq allocation name parameter as constant
shurd [Tue, 29 May 2018 21:56:39 +0000 (21:56 +0000)]
iflib: mark irq allocation name parameter as constant

The *name parameter passed to iflib_irq_alloc_generic and
iflib_softirq_alloc_generic is never modified. Many places in code pass
string literals and thus should not be modified.

Mark the *name parameter as a const char * instead, so that we enforce
that the name is not modified before passing to bus_describe_intr()

Submitted by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed by: kmacy
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D15343

6 years agodumpon(8)
sbruno [Tue, 29 May 2018 21:52:13 +0000 (21:52 +0000)]
dumpon(8)
- fix the WITHOUT_CRYPTO buildworld case.  Its rare, but some of us do
  build this way.

Sponsored by: Limelight Networks

6 years agoRevert second chunk of r333860. The warning from gcc is false positive. The
glebius [Tue, 29 May 2018 21:45:15 +0000 (21:45 +0000)]
Revert second chunk of r333860. The warning from gcc is false positive. The
npages won't be ever used in no space case.

6 years agolibpmc: silence scan-build warnings
mmacy [Tue, 29 May 2018 21:02:13 +0000 (21:02 +0000)]
libpmc: silence scan-build warnings

6 years agopmc: silence scan-build warnings
mmacy [Tue, 29 May 2018 21:02:08 +0000 (21:02 +0000)]
pmc: silence scan-build warnings

6 years agopmc_annotate: adhere to the API
vangyzen [Tue, 29 May 2018 20:30:46 +0000 (20:30 +0000)]
pmc_annotate: adhere to the API

If the 'mode' parameter was invalid, pmc_annotate() would
return EINVAL instead of setting errno and returning -1.

Sponsored by: Dell EMC

6 years agopmc: Add new sub-command structured "pmc" utility
mmacy [Tue, 29 May 2018 20:28:34 +0000 (20:28 +0000)]
pmc: Add new sub-command structured "pmc" utility

This will manage pmc functionality with a more
manageable structure of subcommands rather than the
gradually accreted spaghetti logic of overlapping flags
that exists in pmcstat.

This is intended to ultimately have all the same functionality
as pmcannotate+pmccontrol+pmcstat. Currently it just has
"stat" and "system-stat" - counters for the process itself and counters
for the system as a whole respectively (i.e. system-stat includes kernel
threads). Note that the rusage results (page faults/context switches/
user/sys) for stat-system will not account for the system as a whole -
only for the child process specified on the command line.

Implementing stat was suggested by mjg@ and the output is based on that
from Linux's "perf stat".

% pmc stat -- make -j32 buildkernel -DNO_MODULES  -ss > /dev/null
         9598393  page faults           #       0.674 M/sec
          387085  voluntary csw         #       0.027 M/sec
          106989  involuntary csw       #       0.008 M/sec
   2763965982317  cycles
   2542953049760  instructions          #       0.920 inst/cycle
    511562750157  branches
     12917006881  branch-misses         #       2.525%
     17944429878  cache-references      #       0.007 refs/inst
      2205119560  cache-misses          #       12.289%
           43.74  real                  #       2019.72% cpu
          795.09  user                  #       1817.72% cpu
           88.35  sys                   #       202.00% cpu

% make -j32 buildkernel -DNO_MODULES  -ss > /dev/null &
% sudo pmc stat-system cat
^C             103  page faults         #       0.811 M/sec
               4  voluntary csw         #       0.031 M/sec
               0  involuntary csw       #       0.000 M/sec
   2843639070514  cycles
   2606171217438  instructions          #       0.916 inst/cycle
    522450422783  branches
     13092862839  branch-misses         #       2.506%
     18592101113  cache-references      #       0.007 refs/inst
      2562878667  cache-misses          #       13.785%
           44.85  real                  #       0.00% cpu
            0.00  user                  #       0.00% cpu
            0.00  sys                   #       0.00% cpu

6 years agolibpmc: don't return -1 on success in pmc_allocate
mmacy [Tue, 29 May 2018 20:09:35 +0000 (20:09 +0000)]
libpmc: don't return -1 on success in pmc_allocate

6 years agoCorrect pointer subtraction in KASSERT().
brooks [Tue, 29 May 2018 20:03:24 +0000 (20:03 +0000)]
Correct pointer subtraction in KASSERT().

The assertion would never fire without truly spectacular future
programming errors.

Reported by: Coverity
CID: 1391370
Sponsored by: DARPA, AFRL

6 years agolibpmc: don't leak string in error case either
mmacy [Tue, 29 May 2018 19:07:00 +0000 (19:07 +0000)]
libpmc: don't leak string in error case either

Reported by: vangyzen@

6 years agolibpmc: remove fixed counter diagnostic
mmacy [Tue, 29 May 2018 18:30:37 +0000 (18:30 +0000)]
libpmc: remove fixed counter diagnostic

6 years agolibpmc: free allocated string on return from pmc_allocate
mmacy [Tue, 29 May 2018 18:26:12 +0000 (18:26 +0000)]
libpmc: free allocated string on return from pmc_allocate

Reported by: Coverity
CID: 1391359

6 years agohwpmc: don't enter epoch section across mmap hook
mmacy [Tue, 29 May 2018 18:03:48 +0000 (18:03 +0000)]
hwpmc: don't enter epoch section across mmap hook

6 years agoiflib: hold context lock across detach for drivers that need it
mmacy [Tue, 29 May 2018 18:03:43 +0000 (18:03 +0000)]
iflib: hold context lock across detach for drivers that need it

6 years agoCorrect pointer subtraction in KASSERT().
brooks [Tue, 29 May 2018 17:49:03 +0000 (17:49 +0000)]
Correct pointer subtraction in KASSERT().

The assertion would never fire without truly spectacular future
programming errors.

Reported by: Coverity
CID: 13913671391368
Sponsored by: DARPA, AFRL

6 years agoIncrease the number of fdt memory regions we support to 16. Some SoCs have
andrew [Tue, 29 May 2018 17:44:40 +0000 (17:44 +0000)]
Increase the number of fdt memory regions we support to 16. Some SoCs have
many excluded regions causing a buffer overflow in the early boot code if
this value is too small.

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

6 years agoadd support for console resuming, implement it for uart, use on x86
avg [Tue, 29 May 2018 16:16:24 +0000 (16:16 +0000)]
add support for console resuming, implement it for uart, use on x86

This change adds a new optional console method cn_resume and a kernel
console interface cnresume.  Consoles that may need to re-initialize
their hardware after suspend (e.g., because firmware does not care to do
it) will implement cn_resume.  Note that it is called in rather early
environment not unlike early boot, so the same restrictions apply.
Platform specific code, for platforms that support hardware suspend,
should call cnresume early after resume, before any console output is
expected.

This change fixes a problem with a system of mine failing to resume when
a serial console is used.  I found that the serial port was in a strange
configuration and an attempt to write to it likely resulted in an
infinite loop.

To avoid adding cn_resume method to every console driver, CONSOLE_DRIVER
macro has been extended to support optional methods.

Reviewed by: imp, mav
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D15552

6 years agoThe extension for zstd-compressed files is ".zst".
markj [Tue, 29 May 2018 16:04:53 +0000 (16:04 +0000)]
The extension for zstd-compressed files is ".zst".

Reported by: manu

6 years agofix x86 UP build broken by r334204, TSC resynchronization
avg [Tue, 29 May 2018 16:03:53 +0000 (16:03 +0000)]
fix x86 UP build broken by r334204, TSC resynchronization

Reported by: bde
MFC after: 1 week
X-MFC with: r334204

6 years agoswitch amd64 memstick installer images to MBR
emaste [Tue, 29 May 2018 15:06:13 +0000 (15:06 +0000)]
switch amd64 memstick installer images to MBR

A good number of BIOSes have trouble booting from GPT in non-UEFI mode.
This is commonly reported with Lenovo desktops and laptops (including
X220, X230, T430, and E31) and Dell systems.  Although UEFI is the
preferred amd64 boot method on recent hardware, older hardware does not
support UEFI, a user may wish to boot via BIOS/CSM, and some systems
that support UEFI fail to boot FreeBSD via UEFI (such as an old
AMD FX-6100 that I have).

With this change amd64 memsticks remain dual-mode (booting from either
UEFI or CSM); the partitioning type is just switched from GPT to MBR.

The "vestigial swap partition" in the GPT scheme was added in r265017 to
work around some issue with loader's GPT support, so we should not need
it when using MBR.

There is some concern that future UEFI systems may not boot from MBR,
but I am not aware of any today.  In any case the likely path forward
for our installers is to migrate to CD/USB combo images, and if it
becomes necessary introduce a separate memstick specifically for the
MBR BIOS/CSM case.

PR: 227954
Reviewed by: gjb, imp, tsoome
MFC after: 3 days
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D15599

6 years ago[usbdevs] add several GENESYS product ids
eadler [Tue, 29 May 2018 14:40:50 +0000 (14:40 +0000)]
[usbdevs] add several GENESYS product ids

Add USB product ID for two GENESYS LOGIC ICs, found in DELOCK
In-Desk-Hub 61991

PR: 228489
Submitted by: "Harald Schmalzbauer" <bugzilla.freebsd@omnilan.de>
MFC After: 3 weeks

6 years ago[usbdevs] add AMD vendor ids
eadler [Tue, 29 May 2018 14:37:48 +0000 (14:37 +0000)]
[usbdevs] add AMD vendor ids

- also more fully spell the name of ATI for ATI2

6 years ago[usbdevs] add misig letters
eadler [Tue, 29 May 2018 14:08:06 +0000 (14:08 +0000)]
[usbdevs] add misig letters

6 years ago[usbdevs] add several intel product identifiers
eadler [Tue, 29 May 2018 14:04:58 +0000 (14:04 +0000)]
[usbdevs] add several intel product identifiers

6 years agoAdd support for hardware rate limiting to mlx5en(4).
hselasky [Tue, 29 May 2018 14:04:57 +0000 (14:04 +0000)]
Add support for hardware rate limiting to mlx5en(4).

The hardware rate limiting feature is enabled by the RATELIMIT kernel
option. Please refer to ifconfig(8) and the txrtlmt option and the
SO_MAX_PACING_RATE set socket option for more information. This
feature is compatible with hardware transmit send offload, TSO.

A set of sysctl(8) knobs under dev.mce.<N>.rate_limit are provided to
setup the ratelimit table and also to fine tune various rate limit
related parameters.

Sponsored by: Mellanox Technologies

6 years ago[usbdevs] Add USB product ID for Philips SPC N900 CCD Webcam
eadler [Tue, 29 May 2018 14:04:50 +0000 (14:04 +0000)]
[usbdevs] Add USB product ID for Philips SPC N900 CCD Webcam

PR: 228488
Submitted by: "Harald Schmalzbauer" <bugzilla.freebsd@omnilan.de>

6 years agoOn ThunderX2 we need to be careful to only map the memory the firmware
andrew [Tue, 29 May 2018 13:52:25 +0000 (13:52 +0000)]
On ThunderX2 we need to be careful to only map the memory the firmware
lists in the EFI memory map. As such we need to reduce the mappings to
restrict them to not be the full 1G block. For now reduce this to a 2M
block, however this may be further restricted to be 4k page aligned as
other SoCs may require.

This allows ThunderX2 to boot reliably to userspace without performing
any speculative memory accesses to invalid physical memory.

This is a recommit of r334035 now that we can access the EFI Runtime data
through the DMAP region.

Tested by: tuexen
Sponsored by: DARPA, AFRL

6 years agoFix 32-bit buildworld for i386 after r334320.
hselasky [Tue, 29 May 2018 13:43:16 +0000 (13:43 +0000)]
Fix 32-bit buildworld for i386 after r334320.

The 64-bit atomics defined for i386 are currently only available in
the kernel space.

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

6 years agoFix an inverted conditional in the netrc code, which would ignore the
des [Tue, 29 May 2018 13:07:36 +0000 (13:07 +0000)]
Fix an inverted conditional in the netrc code, which would ignore the
value of $HOME and always use the home directory from the passwd
database, unless $HOME was unset, in which case it would use (null).

While there, clean up handling of netrcfd and add debugging aids.

MFC after: 3 weeks

6 years agoRemove empty encap_init() function.
ae [Tue, 29 May 2018 12:32:08 +0000 (12:32 +0000)]
Remove empty encap_init() function.

MFC after: 2 weeks

6 years agoImplement atomic_add_64() and atomic_subtract_64() for the i386 target.
hselasky [Tue, 29 May 2018 11:59:02 +0000 (11:59 +0000)]
Implement atomic_add_64() and atomic_subtract_64() for the i386 target.

While at it add missing _acq_ and _rel_ variants for 64-bit atomic
operations under i386.

Reviewed by: kib @
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoFix a few (but far from all) style issues.
des [Tue, 29 May 2018 10:29:43 +0000 (10:29 +0000)]
Fix a few (but far from all) style issues.

MFC after: 3 weeks

6 years agoMFV r333668:
slavash [Tue, 29 May 2018 10:29:04 +0000 (10:29 +0000)]
MFV r333668:

Vendor import two upstream commits:
c1bb8784abd3ca978e376b0d10e324db0491237b
9c4af7213cc2543a1f5586d8f2c19f86aa0cbe72

When using tcpdump -I -i wlanN and wlanN is not a monitor mode VAP,
tcpdump will print an error message saying rfmon is not supported.

Give a concise explanation as to how one might solve this problem by
creating a monitor mode VAP.

MFC after:      1 month
Approved by:    hselasky (mentor), kib (mentor)
Sponsored by:   Mellanox Technologies

6 years agoUse __VA_ARGS__ to simplify the DEBUG macro.
des [Tue, 29 May 2018 10:28:20 +0000 (10:28 +0000)]
Use __VA_ARGS__ to simplify the DEBUG macro.

MFC after: 3 weeks

6 years agoteken: Fix `sequences` header which was crossing the 80-col boundary
dumbbell [Tue, 29 May 2018 08:41:44 +0000 (08:41 +0000)]
teken: Fix `sequences` header which was crossing the 80-col boundary

Also, the commented line's columns for `DECID` were not re-aligned in
r334302.

Reported by: bde

6 years agort_getifa_fib: don't use ifa but info->rti_ifa
mmacy [Tue, 29 May 2018 07:14:57 +0000 (07:14 +0000)]
rt_getifa_fib: don't use ifa but info->rti_ifa

Reported by: kp

6 years agolibpmc: add support for using fixed function counters
mmacy [Tue, 29 May 2018 04:23:21 +0000 (04:23 +0000)]
libpmc: add support for using fixed function counters

6 years agolibpmc: export names of counters for stat mode, make get_by_idx name consistent with...
mmacy [Tue, 29 May 2018 04:23:16 +0000 (04:23 +0000)]
libpmc: export names of counters for stat mode, make get_by_idx name consistent with others

6 years agohwpmc: don't incrorrectly strip the ANY flag
mmacy [Tue, 29 May 2018 04:04:06 +0000 (04:04 +0000)]
hwpmc: don't incrorrectly strip the ANY flag

6 years agoTeach ufs_module.c about bsd labels and probe 'a' partition.
imp [Tue, 29 May 2018 03:58:29 +0000 (03:58 +0000)]
Teach ufs_module.c about bsd labels and probe 'a' partition.

If the check for a UFS partition at offset 0 on the disk fails, check
to see if there's a BSD disklabel at block 1 (standard) or at offset
512 (install images assume 512 sector size). If found, probe for UFS
on the 'a' partition.

This fixes UEFI booting images from a BSD labeled MBR slice when the
'a' partiton isn't at offset 0. This is a stop-gap fix since we plan
on removing boot1.efi in FreeBSD 12. We can't easily do that for 11.2,
however, hence the short MFC window.

Tested by: emaste@
MFC After: 3 days
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D15598

6 years agoBump the date on man pages in r334306
vangyzen [Tue, 29 May 2018 02:41:32 +0000 (02:41 +0000)]
Bump the date on man pages in r334306

It seems a shame to ruin the patina of the June 4, 1993 date
on abort.3, especially since it still matched the date of
the SCCS ID, but those are the rules.

Reported by: araujo
MFC after: 3 days
Sponsored by: Dell EMC

6 years agoSimplify macros EFPRINTF and EFFLUSH. [0]
araujo [Tue, 29 May 2018 01:46:00 +0000 (01:46 +0000)]
Simplify macros EFPRINTF and EFFLUSH. [0]
Also stdarg(3) says that each invocation of va_start() must be paired
with a corresponding invocation of va_end() in the same function. [1]

Reported by: Coverity
CID: 1194318[0] and 1194332[1]
Discussed with: jhb
MFC after: 4 weeks.
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D15548

6 years agoCross-reference abort2(2) from a few man pages
vangyzen [Tue, 29 May 2018 01:16:00 +0000 (01:16 +0000)]
Cross-reference abort2(2) from a few man pages

I didn't know abort2 existed until it was mentioned on a mailing list.
Mention it in related pages so others can find it easily.

MFC after: 3 days
Sponsored by: Dell EMC

6 years agoroute: fix missed ref adds
mmacy [Tue, 29 May 2018 00:53:53 +0000 (00:53 +0000)]
route: fix missed ref adds
 - ensure that we bump the ifa ref whenever we add a reference
 - defer freeing epoch protected references until after the if_purgaddrs
   loop

6 years agohwpmc: add class field to identify which class a pmc came frome
mmacy [Tue, 29 May 2018 00:19:23 +0000 (00:19 +0000)]
hwpmc: add class field to identify which class a pmc came frome

6 years agosysrc(8): Test variable names for invalid characters
dteske [Mon, 28 May 2018 23:34:23 +0000 (23:34 +0000)]
sysrc(8): Test variable names for invalid characters

PR: bin/187461
Reported by: ebay@looksharp.net
MFC after: 4 weeks
X-MFC-to: stable/11 (after 11.2-R)
Sponsored by: Smule, Inc.

6 years agoteken: Sort DECSCUSR alphabetically
dumbbell [Mon, 28 May 2018 23:20:08 +0000 (23:20 +0000)]
teken: Sort DECSCUSR alphabetically

While here, align columns again.

Reported by: bde

6 years agohwpmc: make pmc class specification work to enable fixed function counters
mmacy [Mon, 28 May 2018 23:17:57 +0000 (23:17 +0000)]
hwpmc: make pmc class specification work to enable fixed function counters

6 years agohwmpc: fix brain-damaged handling of thread descriptor freeing
mmacy [Mon, 28 May 2018 23:16:39 +0000 (23:16 +0000)]
hwmpc: fix brain-damaged handling of thread descriptor freeing

6 years agowitness/hwpmc: fix locking order for pmc locks
mmacy [Mon, 28 May 2018 23:14:38 +0000 (23:14 +0000)]
witness/hwpmc: fix locking order for pmc locks

6 years agohwpmc_logging.c: don't call wakeup_one with thread lock held, don't
mmacy [Mon, 28 May 2018 23:12:26 +0000 (23:12 +0000)]
hwpmc_logging.c: don't call wakeup_one with thread lock held, don't
malloc(M_WAITOK) in an epoch section

6 years agoarm64: fix atomic_fcmpset_16
manu [Mon, 28 May 2018 21:05:00 +0000 (21:05 +0000)]
arm64: fix atomic_fcmpset_16

newval needs to be uint16_t

Reported by: andrew

6 years agoFix "Bad tailq" panic when auditing auditon(A_SETCLASS, ...)
asomers [Mon, 28 May 2018 20:47:39 +0000 (20:47 +0000)]
Fix "Bad tailq" panic when auditing auditon(A_SETCLASS, ...)

Due to an oversight in r195280, auditon(A_SETCLASS, ...) would cause a tailq
element to get added to the tailq twice, resulting in a circular tailq. This
panics when INVARIANTS are on.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D15381

6 years agoarm64: Add atomic_fcmpset_8 and atomic_fcmpset_16
manu [Mon, 28 May 2018 20:29:03 +0000 (20:29 +0000)]
arm64: Add atomic_fcmpset_8 and atomic_fcmpset_16

Reviewed by: cognet

6 years agoif_muge: Add GMII enable (vs RGMII) bit
emaste [Mon, 28 May 2018 20:06:40 +0000 (20:06 +0000)]
if_muge: Add GMII enable (vs RGMII) bit

The GMII control bit ETH_MAC_CR_GMII_EN_ is not documented in
LAN78xx datasheets, but from the permissively licensed header provided
by Microchip it is:

 #define ETH_MAC_CR_GMII_EN (0x00080000UL ) // GMII/RGMII Selection

6 years agoDescribe Fresco Logic FL1100 USB 3.0 controllers.
marius [Mon, 28 May 2018 19:55:51 +0000 (19:55 +0000)]
Describe Fresco Logic FL1100 USB 3.0 controllers.

6 years agoChange the default USB template from the current 0 to -1. The reason
trasz [Mon, 28 May 2018 18:34:16 +0000 (18:34 +0000)]
Change the default USB template from the current 0 to -1.  The reason
is that current one (mass storage device) doesn't work as it is - it
needs to be set to 0 after the LUN is configured, which is what the
cfumass rc script does.  In other words: the current default does not
work, and to actually make it work it had to be set to -1 in
/boot/loader.conf.

Reviewed by: hselasky@
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

6 years agostrsep.3: don't silently ignore errors
emaste [Mon, 28 May 2018 18:29:15 +0000 (18:29 +0000)]
strsep.3: don't silently ignore errors

Reported by: bde
MFC with: r334275

6 years agoBump FreeBSD_version after r333517
dteske [Mon, 28 May 2018 17:47:32 +0000 (17:47 +0000)]
Bump FreeBSD_version after r333517

Sponsored by: Smule, Inc.

6 years agoCreate a new function to walk the EFI memory table & run a callback for
andrew [Mon, 28 May 2018 17:09:29 +0000 (17:09 +0000)]
Create a new function to walk the EFI memory table & run a callback for
each entry. We can then use this to ensure the RunTime data is mapped in
the DMAP, but not in phys_avail.

Sponsored by: DARPA, AFRL

6 years agoComplete removal of lmc(4)
zeising [Mon, 28 May 2018 17:08:37 +0000 (17:08 +0000)]
Complete removal of lmc(4)

The lmc(4) driver was removed in r333144 and relevant files added to
ObsoleteFiles.inc, however, include/sys/dev/lmc was not removed from mtree
and is recreated on every install.  Remove it from mtree.

Reviewed by: imp, emaste
Approved by: emaste
Differential Revision: https://reviews.freebsd.org/D15590

6 years agoAddendum to r334233. In vm_fault_populate(), since the page lock is held,
alc [Mon, 28 May 2018 16:23:39 +0000 (16:23 +0000)]
Addendum to r334233.  In vm_fault_populate(), since the page lock is held,
we must use vm_page_xunbusy_maybelocked() rather than vm_page_xunbusy() to
unbusy the page.

Reviewed by: kib
X-MFC with: r334233

6 years agoUse correct mask.
tuexen [Mon, 28 May 2018 13:31:47 +0000 (13:31 +0000)]
Use correct mask.
Introduced in https://svnweb.freebsd.org/changeset/base/333603.
Thanks to Irene Ruengler for testing and reporting the issue.

MFC after: 1 week
X-MFC-with: 333603

6 years agobktr: Support WinFast Tv2000 & PHILIPS FI1216
eadler [Mon, 28 May 2018 13:12:34 +0000 (13:12 +0000)]
bktr: Support WinFast Tv2000 & PHILIPS FI1216

- Add support for Leadtek WinFast Tv2000 XP bktr card
- Add support for PHILIPS FI1216

PR: 94369
Submitted by: Angelescu Ovidiu <mrhsaacdoh@yahoo.com>
Submitted on: 2006-03-11 19:30 UTC

6 years agobktr: remove references to removed things
eadler [Mon, 28 May 2018 12:50:36 +0000 (12:50 +0000)]
bktr: remove references to removed things

Neither the examples nor the misc/alevt exist anymore.

6 years agoThe schedule_timeout_killable() function should listen for signals
hselasky [Mon, 28 May 2018 11:26:40 +0000 (11:26 +0000)]
The schedule_timeout_killable() function should listen for signals
in the LinuxKPI.

Found by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoImplement wait_event_killable() in the LinuxKPI.
hselasky [Mon, 28 May 2018 10:54:24 +0000 (10:54 +0000)]
Implement wait_event_killable() in the LinuxKPI.

Requested by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoAllow TASK_PARKED bit being set when going to sleep in the LinuxKPI.
hselasky [Mon, 28 May 2018 10:51:39 +0000 (10:51 +0000)]
Allow TASK_PARKED bit being set when going to sleep in the LinuxKPI.

Found by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoBuildfix for GCC after r334277.
hselasky [Mon, 28 May 2018 09:41:44 +0000 (09:41 +0000)]
Buildfix for GCC after r334277.

MFC after: 1 month
Sponsored by: Mellanox Technologies

6 years agoTemporary disable SPDCACHE statistic accounting until proper fix will be
ae [Mon, 28 May 2018 09:23:28 +0000 (09:23 +0000)]
Temporary disable SPDCACHE statistic accounting until proper fix will be
committed. This fixes the kernel build without option IPSEC.

6 years agoMFV r333789: libpcap 1.9.0 (pre-release)
hselasky [Mon, 28 May 2018 08:12:18 +0000 (08:12 +0000)]
MFV r333789: libpcap 1.9.0 (pre-release)

MFC after: 1 month
Sponsored by: Mellanox Technologies

6 years agoRemove unnecessary free(string) from EXAMPLES.
araujo [Mon, 28 May 2018 06:01:02 +0000 (06:01 +0000)]
Remove unnecessary free(string) from EXAMPLES.

Reported by: se

6 years agoUpdate strsep(3) EXAMPLE section regards the usage of assert(3).
araujo [Mon, 28 May 2018 05:01:42 +0000 (05:01 +0000)]
Update strsep(3) EXAMPLE section regards the usage of assert(3).

As many people has pointed out, using assert(3) shall be not the best approach
to verify if strdup(3) has allocated memory to string.

Reviewed by: imp
MFC after: 4 weeks.
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D15594

6 years agoEliminate duplicate assertions. We assert at the start of vm_fault_hold()
alc [Mon, 28 May 2018 04:38:10 +0000 (04:38 +0000)]
Eliminate duplicate assertions.  We assert at the start of vm_fault_hold()
that the map entry is wired if the caller passes the flag VM_FAULT_WIRE.
Eliminate the same assertion, but spelled differently, at the end of
vm_fault_hold() and vm_fault_populate().  Repeat the assertion only if the
map is unlocked and the map lookup must be repeated.

Reviewed by: kib
MFC after: 10 days
Differential Revision: https://reviews.freebsd.org/D15582

6 years agocam nvme: fix array overrun
vangyzen [Mon, 28 May 2018 03:14:36 +0000 (03:14 +0000)]
cam nvme: fix array overrun

Fix a classic array overrun where the index could be one past the end.

Reported by: Coverity
CID: 1356596
MFC after: 3 days
Sponsored by: Dell EMC

6 years agobhyve: guarantee NUL termination
vangyzen [Mon, 28 May 2018 03:09:09 +0000 (03:09 +0000)]
bhyve: guarantee NUL termination

Use strlcpy to guarantee NUL termination of the path to a
virtio console socket.

Reported by: Coverity
CID: 1362874
Sponsored by: Dell EMC

6 years agobhyve: fix small memory leak in virtio console
vangyzen [Mon, 28 May 2018 03:05:01 +0000 (03:05 +0000)]
bhyve: fix small memory leak in virtio console

Reported by: Coverity
CID: 1363284
Sponsored by: Dell EMC

6 years agologger: fix memory leak and use-after-free
vangyzen [Mon, 28 May 2018 02:40:06 +0000 (02:40 +0000)]
logger: fix memory leak and use-after-free

This one call to getaddrinfo() did not adhere to the common idiom
of storing the result into a second res0 variable, which is later freed.

Reported by: Coverity
CID: 1368069 1368071
Sponsored by: Dell EMC

6 years agodrm: fix memory leak on error path
vangyzen [Mon, 28 May 2018 02:34:38 +0000 (02:34 +0000)]
drm: fix memory leak on error path

Reported by: Coverity
CID: 1368753
MFC after: 3 days
Sponsored by: Dell EMC

6 years agofts_stat: fix buffer overrun on error path
vangyzen [Mon, 28 May 2018 02:31:49 +0000 (02:31 +0000)]
fts_stat: fix buffer overrun on error path

Reported by: Coverity
CID: 1375582
MFC after: 1 week
Sponsored by: Dell EMC

6 years agolibprocstat: fix memory leak
vangyzen [Mon, 28 May 2018 02:10:35 +0000 (02:10 +0000)]
libprocstat: fix memory leak

Free the rlimits array on the happy path in procstat_getrlimit_core().

Reported by: Coverity
CID: 1373328
Sponsored by: Dell EMC

6 years agoMake ALT_BREAK_TO_DEBUGGER work with OPAL console
jhibbits [Mon, 28 May 2018 01:59:48 +0000 (01:59 +0000)]
Make ALT_BREAK_TO_DEBUGGER work with OPAL console

Match other consoles by using the higher level cngetc() in the interrupt
handler, so that kdb_alt_break() can check for console break.

6 years agotcpdrop: ensure NUL termination of a string
vangyzen [Mon, 28 May 2018 01:58:49 +0000 (01:58 +0000)]
tcpdrop: ensure NUL termination of a string

strncpy did not guarantee NUL termination of the "stack" string.
Use strlcpy instead.  While I'm here, avoid unnecessary memset
and strnlen calls.

Reported by: Coverity
CID: 1381035
Sponsored by: Dell EMC

6 years agoPrint the full-width pointer values in hex.
jhibbits [Mon, 28 May 2018 00:19:08 +0000 (00:19 +0000)]
Print the full-width pointer values in hex.

PRI0ptrX is used to print a zero-padded hex value of the architecture's bitness,
so on 64-bit architectures it'll print the full 64 bit address.

6 years agodwatch(1): Eliminate ANSI dimming in developer mode
dteske [Sun, 27 May 2018 22:32:45 +0000 (22:32 +0000)]
dwatch(1): Eliminate ANSI dimming in developer mode

"Developer mode" (passing of "-dev" options), which enables debugging
features on compilation error, used to dim lines unrelated to error.

That proved distracting and feedback from testers also confirmed that
simply highlighting the line the compiler complains about is enough.

Sponsored by: Smule, Inc.

6 years agodwatch(1): Guard against error when given -t "*..."
dteske [Sun, 27 May 2018 22:27:47 +0000 (22:27 +0000)]
dwatch(1): Guard against error when given -t "*..."

dwatch allows you to customnize the predicate (condition) for when
information is displayed. The DTrace syntax for this is:

probe[, ...] /predicate/ { [actions] }

But if predicate is something like "*args[1]!=NULL" to test that
the first pointer in an array is non-NULL, the syntax produced is:

probe[, ...] /*arg1!=NULL/ { [actions] }

The issue being that "/*" is the beginning of a comment and thus
the following error is emitted:

dtrace: failed to compile script /dev/stdin:
line 535: /* encountered inside a comment

This patch adds whitespace around the argument given to -t,
producing:

probe[, ...] / *arg1!=NULL / { [actions] }

Sponsored by: Smule, Inc.

6 years agoMatch style of the other prototypes, and don't name the argument.
jhibbits [Sun, 27 May 2018 20:36:43 +0000 (20:36 +0000)]
Match style of the other prototypes, and don't name the argument.

6 years agoStop idle threads on power9 in the idle task until an interrupt.
jhibbits [Sun, 27 May 2018 20:24:24 +0000 (20:24 +0000)]
Stop idle threads on power9 in the idle task until an interrupt.

This reduces the CPU cycle wastage on power9, which is SMT4.  Any idle
thread that's spinning is simply starving working threads on the same core
of valuable resources.

This can be reduced further by taking more advantage of the PSSCR supported
states, as well as permitting state loss, as is currently done for power8.
The currently implemented stop state is the lowest latency, which may still
consume resources.

6 years agoRemove "All rights reserved" from dtrace_sctp(4) comments
dteske [Sun, 27 May 2018 19:27:34 +0000 (19:27 +0000)]
Remove "All rights reserved" from dtrace_sctp(4) comments

Copied from dtrace_tcp(4)

Reviewed by: rgrimes
Sponsored by: Smule, Inc.