]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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.

6 years agoAdd manual page for the sctp DTrace provider.
dteske [Sun, 27 May 2018 18:43:14 +0000 (18:43 +0000)]
Add manual page for the sctp DTrace provider.

Sponsored by: Smule, Inc.

6 years agopmcstat: suppress uninitialized warning of event
mmacy [Sun, 27 May 2018 17:49:27 +0000 (17:49 +0000)]
pmcstat: suppress uninitialized warning of event

6 years agoMake the cfumass rc script support USB template 10.
trasz [Sun, 27 May 2018 10:48:21 +0000 (10:48 +0000)]
Make the cfumass rc script support USB template 10.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

6 years agoin_pcbladdr: remove debug code that snuck in with ifa epoch conversion r334118
mmacy [Sun, 27 May 2018 06:47:09 +0000 (06:47 +0000)]
in_pcbladdr: remove debug code that snuck in with ifa epoch conversion r334118

6 years agoFix the sleep event for layout recall.
rmacklem [Sat, 26 May 2018 23:02:15 +0000 (23:02 +0000)]
Fix the sleep event for layout recall.

The sleep for I/O completion during an NFSv4.1 pNFS layout recall used
the wrong event value and could result in the "[nfscl]" thread hung
for the mount.
This patch fixes the event to be the correct.
This bug will only affect NFSv4.1 pnfs mounts and only when the server
does a layout recall callback, so it won't affect many. Without the patch,
a mount without the "pnfs" option will avoid the problem.
Found during testing of the pNFS server.

MFC after: 1 week

6 years agosrc.conf: use more natural language for @generated
eadler [Sat, 26 May 2018 21:14:49 +0000 (21:14 +0000)]
src.conf: use more natural language for @generated

Requested by: emaste

6 years agopmu-events: re-delete after re-addition by revert
mmacy [Sat, 26 May 2018 19:38:31 +0000 (19:38 +0000)]
pmu-events: re-delete after re-addition by revert

6 years agopmc(3)/hwpmc(4): update supported Intel processors to rely fully on the
mmacy [Sat, 26 May 2018 19:29:19 +0000 (19:29 +0000)]
pmc(3)/hwpmc(4): update supported Intel processors to rely fully on the
vendor provided pmu-events tables and sundry cleanups.

The vendor pmu-events tables provide counter descriptions, default
sample rates, event, umask, and flag values for all the counter
configuration permutations. Using this gives us:

- much simpler kernel code for the MD component
- helpful long and short event descriptions
- simpler user code
- sample rates that won't overload the system

Update man page with newer sample types and remove unused sample type.

6 years agoRevert r334242 "pmc(3)/hwpmc(4): update supported Intel processors to rely fully...
mmacy [Sat, 26 May 2018 19:26:19 +0000 (19:26 +0000)]
Revert r334242 "pmc(3)/hwpmc(4): update supported Intel processors to rely fully on the"
because of squash commit messages

6 years agopmc(3)/hwpmc(4): update supported Intel processors to rely fully on the
mmacy [Sat, 26 May 2018 18:12:50 +0000 (18:12 +0000)]
pmc(3)/hwpmc(4): update supported Intel processors to rely fully on the
vendor provided pmu-events tables and sundry cleanups.

The vendor pmu-events tables provide counter descriptions, default
sample rates, event, umask, and flag values for all the counter
configuration permutations. Using this gives us:

- much simpler kernel code for the MD component
- helpful long and short event descriptions
- simpler user code
- sample rates that won't overload the system

Update man page with newer sample types and remove unused sample type.

Squashed commit of the following:

commit 4459d43eff815bec08ccc5533dbe5de846f03128
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Sat May 26 00:06:31 2018 -0700

    libpmc: fix pmu function signatures for non amd64

commit a2cb8bbc586c65d41f9b291430a2261ec67b59fe
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 22:38:11 2018 -0700

    pmcstat: fix indentation of usage

commit f686954b15ff56a833ac80404898977cb80a265b
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 22:19:49 2018 -0700

    pmclog(3): add callchain and pmcallocatedyn, remove pcsample

commit 73e13a0d2e9498c81c150d14d022050cee7511bb
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 22:19:00 2018 -0700

    pmclog.h: GC pcsample field

commit 3e93ffd65da641fa657539dad3c48e281f8b5798
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 22:05:57 2018 -0700

    hwpmc: make Intel core CPUs use external event tables

commit 634f5fae1e1644ac324003136c66cd9c619d1c93
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 22:00:06 2018 -0700

    pmclog: update log record types, bump PMC_MAJOR
    - explicitly make log record types a multiple of 8 bytes
    - hook in pmu event types for pmc_allocate records
    - remove references to no longer PCSAMPLE record

commit 83d84fcd2d65bdf6ddcb2e155a22f0cfa2a9c225
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 21:52:10 2018 -0700

    libpmc: add support for having vendor table driven pmc_allocate

commit 9e6ad63c40c2fce8404847ace5078ca6cb33a736
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 19:11:33 2018 -0700

    hwpmc_core: add accessors for EVSEL & UMASK, make IAP_UMASK useful to user

commit 859dceb93daa6419a48c794db99b6758e5b041c9
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 19:09:45 2018 -0700

    pmcstat: update usage and man page as well as make -L consistent with pmccontrol

commit 79c7d8597e28c2eb13f5f9113e65ec2792ca57b1
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 18:07:03 2018 -0700

    pmu_util: add support for all current intel event keywords

commit d8089c7f6a6c8527f38324252b1ffb47004694c6
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 17:45:00 2018 -0700

    add description for new arguments

commit 058336740bab53c62ec88a3a026ea848cf3878c6
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 17:38:15 2018 -0700

    libpmc: move pmu_events table and pmu_utils out of libpmcstat so that they can be used by pmc_allocate

commit 049b66b382e2f833c3f47bc8df9e750cb265709f
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 16:12:41 2018 -0700

    pmcstat: hook pmu_events counter description utility routines in

commit f5e01e7b37a691dc045e1aa16b3ebdd162515de8
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 16:11:59 2018 -0700

    pmu_events: add utility routines for listing counters and their descriptions

commit cba4d4f8907f772279f86f18f915e0d74d33ac56
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 16:09:50 2018 -0700

    pmu-events: expand out skylake regex to simplify string matches

6 years agokern_cpuset: fix small leak on error path
vangyzen [Sat, 26 May 2018 14:23:11 +0000 (14:23 +0000)]
kern_cpuset: fix small leak on error path

The "mask" was leaked on some error paths.

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

6 years agoif_hn: fix use of uninitialized variable
vangyzen [Sat, 26 May 2018 14:14:56 +0000 (14:14 +0000)]
if_hn: fix use of uninitialized variable

omcast was used without being initialized in the non-multicast case.
The only effect was that the interface's multicast output counter could be
incorrect.

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

6 years agokdb_trap: Fix use of uninitialized data
vangyzen [Sat, 26 May 2018 14:01:44 +0000 (14:01 +0000)]
kdb_trap: Fix use of uninitialized data

In some cases, other_cpus was used without being initialized.
Thankfully, it was harmless.

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

6 years agoRevert r333493, which was a temporary fix for 11.2-RELEASE, and instead
trasz [Sat, 26 May 2018 11:13:17 +0000 (11:13 +0000)]
Revert r333493, which was a temporary fix for 11.2-RELEASE, and instead
switch the default kldxref_enable to YES.

The reason is that it's required for every image that's being cross-built,
as kldxref(8) cannot handle files for non-native architectures.  For the
one that is not - amd64 - having it on by default doesn't change anything;
the script is noop if the linker.hints already exists.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agokldstat: align "Size" to the right
eadler [Sat, 26 May 2018 05:15:07 +0000 (05:15 +0000)]
kldstat: align "Size" to the right

This change also makes alignment and spacing an explicit number rather
than a bunch of spaces.

Reviewed by: mmacy
Requested by: Yuri Pankov <yuripv@yuripv.net>

6 years agoOn POWER9 clear the HID0_RADIX before enabling the page tables
jhibbits [Sat, 26 May 2018 04:33:19 +0000 (04:33 +0000)]
On POWER9 clear the HID0_RADIX before enabling the page tables

POWER9 supports Radix page tables in addition to Hashed page tables.  When
Radix page tables are in use, the TLB is cut in half, so that half of the
TLB is used for the page walk cache.  This is the default behavior, however
FreeBSD currently does not support Radix tables.  Clear this bit so that we
can use the full TLB.  Do this in the MMU logic so that configuration can be
localized to the specific translation format.  Once we do support Radix
tables, the setup for that will be localized to the Radix MMU kobj.

6 years agoFix a typo missed in r334232
jhibbits [Sat, 26 May 2018 04:24:25 +0000 (04:24 +0000)]
Fix a typo missed in r334232

6 years agoUse pmap_enter(..., psind=1) in vm_fault_populate() on amd64. While
alc [Sat, 26 May 2018 02:59:34 +0000 (02:59 +0000)]
Use pmap_enter(..., psind=1) in vm_fault_populate() on amd64.  While
superpage mappings were already being created by automatic promotion in
vm_fault_populate(), this change reduces the cost of creating those
mappings.  Essentially, one pmap_enter(..., psind=1) call takes the place
of 512 pmap_enter(..., psind=0) calls, and that one pmap_enter(...,
psind=1) call eliminates the allocation of a page table page.

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

6 years agoCorrect a typo for opal temperature sensor type constant
jhibbits [Sat, 26 May 2018 02:45:41 +0000 (02:45 +0000)]
Correct a typo for opal temperature sensor type constant

6 years agoiflib: Add new shared flag: IFLIB_ADMIN_ALWAYS_RUN
erj [Sat, 26 May 2018 00:46:08 +0000 (00:46 +0000)]
iflib: Add new shared flag: IFLIB_ADMIN_ALWAYS_RUN

ixl(4)'s nvmupdate utility expects the nvmupdate process to run
while the interface is down; these nvm update commands use the
admin queue, so the admin queue needs to be able to generate
interrupts and be processed while the interface is down.

So add a flag that ixl(4) sets that lets the entire admin task
run even when the interface is marked down/IFF_DRV_RUNNING isn't set.

With this change, nvmupdate should function like it did pre-iflib.

Reviewed by: gallatin@, sbruno@
MFC after: 1 week
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D15575

6 years agoOnly crop the VPN on POWER4 and derivatives for TLBIE operations
jhibbits [Sat, 26 May 2018 00:41:50 +0000 (00:41 +0000)]
Only crop the VPN on POWER4 and derivatives for TLBIE operations

Summary:
PowerISA 2.03 and later require bits 14:65 in the RB register argument,
which is the full value of the vpn argument post-shift.  Only POWER4, POWER4+,
and PPC970* need the upper 16 bits cropped.

With this change FreeBSD can boot to multi-user on POWER9.

Reviewed by: nwhitehorn
Differential Revision: https://reviews.freebsd.org/D15581

6 years agoMETA_MODE: Fix trying to rebuild jevents due to missing .meta file.
bdrewery [Fri, 25 May 2018 21:46:53 +0000 (21:46 +0000)]
META_MODE: Fix trying to rebuild jevents due to missing .meta file.

The tool is built separately in buildworld in a subdirectory rather than
how other build-tools are done.  Subdirectory builds in lib/libpmcstat
remain broken since the tool cannot be auto-built from here.

6 years agoUse proper BTOOLSPATH for build-tools path.
bdrewery [Fri, 25 May 2018 21:46:49 +0000 (21:46 +0000)]
Use proper BTOOLSPATH for build-tools path.

6 years agoCleanup style
bdrewery [Fri, 25 May 2018 21:46:07 +0000 (21:46 +0000)]
Cleanup style

6 years agoSupport -DNO_CLEAN builds across r334223+r334224.
brooks [Fri, 25 May 2018 20:42:28 +0000 (20:42 +0000)]
Support -DNO_CLEAN builds across r334223+r334224.

6 years agoRegen after r334223: make vadvise compat freebsd11.
brooks [Fri, 25 May 2018 20:41:26 +0000 (20:41 +0000)]
Regen after r334223: make vadvise compat freebsd11.

6 years agoMake vadvise compat freebsd11.
brooks [Fri, 25 May 2018 20:40:23 +0000 (20:40 +0000)]
Make vadvise compat freebsd11.

The vadvise syscall (aka ovadvise) is undocumented and has always been
implmented as returning EINVAL.  Put the syscall under COMPAT11 and
provide a userspace implementation.

Reviewed by: kib
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15557

6 years agortrequest1_fib: we need to always bump the ifaddr refcount when we take a reference...
mmacy [Fri, 25 May 2018 19:48:26 +0000 (19:48 +0000)]
rtrequest1_fib: we need to always bump the ifaddr refcount when we take a reference from
an rtentry. r334118 introduced a case when this was not done.

While we're here make the intent more obvious by moving the refcount
bump down to when we know we'll actually need it.

Reported by: markj

6 years agorc.subr: Support loading environmental variables from a file
feld [Fri, 25 May 2018 19:36:26 +0000 (19:36 +0000)]
rc.subr: Support loading environmental variables from a file

The current support for setting environment via foo_env="" in rc.conf is
not scalable and does not handle envs with spaces in the value. It seems
a common pattern for some newer software is to skip configuration files
altogether and rely on the env. This is well supported in systemd unit
files and may be the inspiration for this trend.

MFH: 1 week
Differential Revision: https://reviews.freebsd.org/D14453

6 years agoWe don't need check if str is NULL as free(3) will handle NULL
araujo [Fri, 25 May 2018 19:12:30 +0000 (19:12 +0000)]
We don't need check if str is NULL as free(3) will handle NULL
argument.

Reported by: kib@

6 years agoFix building GENERIC-MMCCAM on arm64
kibab [Fri, 25 May 2018 19:00:28 +0000 (19:00 +0000)]
Fix building GENERIC-MMCCAM on arm64

Since GENERIC includes quite a few drivers now, all MMC drivers should have
appropriate MMCCAM-related ifdefs and include opt_mmccam.h so that
those ifdefs are actually processed correctly.

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

6 years agocxgbe(4): Suppress a warning about code that is used only with options
np [Fri, 25 May 2018 18:57:41 +0000 (18:57 +0000)]
cxgbe(4): Suppress a warning about code that is used only with options
RATELIMIT.

Reported by: mmacy@

6 years agoAfter a long discussion about assert(3), we gonna use a HardenedBSD
araujo [Fri, 25 May 2018 18:54:40 +0000 (18:54 +0000)]
After a long discussion about assert(3), we gonna use a HardenedBSD
approach to chek strdup(3) memory allocation.

Submitted by: Shaw Webb <shawn.webb@hardenedbsd.org>
Reported by: brooks
Obtained from: HardenedBSD

6 years agopmcstat(8)
sbruno [Fri, 25 May 2018 18:11:13 +0000 (18:11 +0000)]
pmcstat(8)
- Document per thread filtering.

Submitted by: kbowling
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15549

6 years agoif_muge: Use lock assertion instead of broken locking in lan78xx_chip_init
emaste [Fri, 25 May 2018 17:31:43 +0000 (17:31 +0000)]
if_muge: Use lock assertion instead of broken locking in lan78xx_chip_init

Previously lan78xx_chip_init locked the driver's mutex if not already
locked, but unlocked it only in the case of error.  This provided a
fairly clear indication that the function is already called with the
lock held, so just replace it with a lock assertion.

Sponsored by: The FreeBSD Foundation

6 years agoif_muge: connect module to the build
emaste [Fri, 25 May 2018 17:29:29 +0000 (17:29 +0000)]
if_muge: connect module to the build

Supported Microchip devices:
- LAN7515 USB 2 hub and gigabit Ethernet controller w/ PHY
- LAN7800 USB 3.0 gigabit Ethernet controller w/ PHY

The LAN7515 is the Ethernet controller on the Raspberry Pi 3 B+.

This driver has some TODO items outstanding, but basic functionality
works.

Sponsored by: The FreeBSD Foundation

6 years agoOptimize i386 pmap_extract_and_hold().
kib [Fri, 25 May 2018 16:29:22 +0000 (16:29 +0000)]
Optimize i386 pmap_extract_and_hold().

In particular, stop using pmap_pte() to read non-promoted pte while
walking the page table.  pmap_pte() needs to shoot down the kernel
mapping globally which causes IPI broadcast.  Since
pmap_extract_and_hold() is used for slow copyin(9), it is very
significant hit for the 4/4 kernels.

Instead, create single purpose per-processor page frame and use it to
locally map page table page inside the critical section, to avoid
reuse of the frame by other thread if context switched.

Measurement demostrated very significant improvements in any load that
utilizes copyin/copyout.

Found and benchmarked by: bde
Sponsored by: The FreeBSD Foundation

6 years agoCleanup. Remove unused instruction and label.
kib [Fri, 25 May 2018 16:24:20 +0000 (16:24 +0000)]
Cleanup.  Remove unused instruction and label.

Tested by: bde
Sponsored by: The FreeBSD Foundation

6 years agoExtend show proc with reaper, sigparent, and vmspace information
bz [Fri, 25 May 2018 13:59:48 +0000 (13:59 +0000)]
Extend show proc with reaper, sigparent, and vmspace information
I have regularly needed the last couple of months.

Sponsored by: iXsystems, Inc.

6 years agorctl: correct use of "vmem" instead of "vmemoryuse"
eadler [Fri, 25 May 2018 13:40:07 +0000 (13:40 +0000)]
rctl: correct use of "vmem" instead of "vmemoryuse"

Submitted by: Jamie Landeg-Jones <jamie@catflap.org>
PR: 228482
MFC after: 1 month

6 years agoAdd time2posix and posix2time to time.h
eadler [Fri, 25 May 2018 13:40:05 +0000 (13:40 +0000)]
Add time2posix and posix2time to time.h

These are documented in `time2posix.3` but the symbols are not actually
visible. Since these are not POSIX hide them behind _BSD_VISIBLE.

Reviewed by: wollman
Differential Revision: https://reviews.freebsd.org/D15530

6 years agoAdd myself (arrowd) to share/misc/committers-ports.dot
arrowd [Fri, 25 May 2018 11:49:21 +0000 (11:49 +0000)]
Add myself (arrowd) to share/misc/committers-ports.dot

Approved by: tcberner (mentor)

6 years agoxen: remove dead code from gnttab.h
royger [Fri, 25 May 2018 08:44:00 +0000 (08:44 +0000)]
xen: remove dead code from gnttab.h

This code was left over when it was imported from Linux. The original
committer thought that those functions would be implemented, so the
prototypes where left in place. Delete them at once.

Submitted by: pratyush
Reviewed by: royger
Differential Review: https://reviews.freebsd.org/D15553

6 years agore-synchronize TSC-s on SMP systems after resume, if necessary
avg [Fri, 25 May 2018 07:33:20 +0000 (07:33 +0000)]
re-synchronize TSC-s on SMP systems after resume, if necessary

The TSC-s are checked and synchronized only if they were good
originally.  That is, invariant, synchronized, etc.

This is necessary on an AMD-based system where after a wakeup from STR I
see that BSP clock differs from AP clocks by a count that roughly
corresponds to one second.  The APs are in sync with each other.  Not
sure if this is a hardware quirk or a firmware bug.

This is what I see after a resume with this change:
    SMP: passed TSC synchronization test after adjustment
    acpi_timer0: restoring timecounter, ACPI-fast -> TSC-low

Reviewed by: kib
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D15551

6 years agofix zfs_getpages crash when called from sendfile, followup to r329363
avg [Fri, 25 May 2018 07:29:52 +0000 (07:29 +0000)]
fix zfs_getpages crash when called from sendfile, followup to r329363

It turns out that sendfile_swapin() has an optimization where it may
insert pointers to bogus_page into the page array that it passes to
VOP_GETPAGES.  That happens to work with buffer cache, because it
extensively uses bogus_page internally, so it has the necessary checks.
However, ZFS did not expect bogus_page as VOP_GETPAGES(9) does not
document such a (ab)use of bogus_page.

So, this commit adds checks and handling of bogus_page.

I expect that use of bogus_page with VOP_GETPAGES will get documented
sooner rather than later.

Reported by: Andrew Reilly <areilly@bigpond.net.au>, delphij
Tested by: Andrew Reilly <areilly@bigpond.net.au>
Requested by: many
MFC after: 1 week