]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agocapsicum: propagate const correctness
mmacy [Sat, 19 May 2018 05:14:05 +0000 (05:14 +0000)]
capsicum: propagate const correctness

6 years agoback out DBGSET macro
mmacy [Sat, 19 May 2018 05:12:57 +0000 (05:12 +0000)]
back out DBGSET macro

6 years agointr: eliminate / annotate unused stack locals
mmacy [Sat, 19 May 2018 05:12:18 +0000 (05:12 +0000)]
intr: eliminate / annotate unused stack locals

6 years agosendfile: annotate unused value and ensure that npages is actually initialized
mmacy [Sat, 19 May 2018 05:10:51 +0000 (05:10 +0000)]
sendfile: annotate unused value and ensure that npages is actually initialized

6 years agoumtx: don't call umtxq_getchain unless the value is needed
mmacy [Sat, 19 May 2018 05:09:10 +0000 (05:09 +0000)]
umtx: don't call umtxq_getchain unless the value is needed

6 years agocpuset: revert and annotate instead
mmacy [Sat, 19 May 2018 05:07:31 +0000 (05:07 +0000)]
cpuset: revert and annotate instead

6 years agoconf: revert last change and annotate unused var instead
mmacy [Sat, 19 May 2018 05:07:03 +0000 (05:07 +0000)]
conf: revert last change and annotate unused var instead

6 years agokevent: annotate unused stack local
mmacy [Sat, 19 May 2018 05:06:18 +0000 (05:06 +0000)]
kevent: annotate unused stack local

6 years agolockf: annotate LOCKF_DEBUG only var
mmacy [Sat, 19 May 2018 05:04:38 +0000 (05:04 +0000)]
lockf: annotate LOCKF_DEBUG only var

6 years agocapsicum: annotate variable only used by debug
mmacy [Sat, 19 May 2018 05:02:40 +0000 (05:02 +0000)]
capsicum: annotate variable only used by debug

6 years agoturnstile / sleepqueue: annotate variables only used by debug builds
mmacy [Sat, 19 May 2018 05:00:16 +0000 (05:00 +0000)]
turnstile / sleepqueue: annotate variables only used by debug builds

6 years agovfs: annotate variables only used by debug builds as __unused
mmacy [Sat, 19 May 2018 04:59:39 +0000 (04:59 +0000)]
vfs: annotate variables only used by debug builds as __unused

6 years agoAdd SPR_HSRR0/SPR_HSRR1 definitions
jhibbits [Sat, 19 May 2018 04:56:10 +0000 (04:56 +0000)]
Add SPR_HSRR0/SPR_HSRR1 definitions

Reported by: Mark Millard
Pointy-hat to: jhibbits

6 years agotty: use __unused annotation instead to silence warnings
mmacy [Sat, 19 May 2018 04:48:26 +0000 (04:48 +0000)]
tty: use __unused annotation instead to silence warnings

6 years agoepoch: avoid warning when INVARIANTS is not enabled
mmacy [Sat, 19 May 2018 04:47:34 +0000 (04:47 +0000)]
epoch: avoid warning when INVARIANTS is not enabled

6 years agodisable set but not used on code that can't be changed
mmacy [Sat, 19 May 2018 04:46:34 +0000 (04:46 +0000)]
disable set but not used on code that can't be changed

6 years agomalloc: avoid possibly returning stack garbage if MALLOC_DEBUG is defined
mmacy [Sat, 19 May 2018 04:43:49 +0000 (04:43 +0000)]
malloc: avoid possibly returning stack garbage if MALLOC_DEBUG is defined

6 years agoAdd hypervisor trap handling, using HSRR0/HSRR1
jhibbits [Sat, 19 May 2018 04:21:50 +0000 (04:21 +0000)]
Add hypervisor trap handling, using HSRR0/HSRR1

Summary:
Some hypervisor exceptions on POWER architecture only save state to HSRR0/HSRR1.
Until we have bhyve on POWER, use a lightweight exception frontend which copies
HSRR0/HSRR1 into SRR0/SRR1, and run the normal trap handler.

The first user of this is the Hypervisor Virtualization Interrupt, which targets
the XIVE interrupt controller on POWER9.

Reviewed By: nwhitehorn
Differential Revision: https://reviews.freebsd.org/D15487

6 years agocpuset_thread0: avoid unused assignment on non debug build
mmacy [Sat, 19 May 2018 04:14:00 +0000 (04:14 +0000)]
cpuset_thread0: avoid unused assignment on non debug build

6 years agomake_dev: avoid unused assignments on non debug builds
mmacy [Sat, 19 May 2018 04:13:20 +0000 (04:13 +0000)]
make_dev: avoid unused assignments on non debug builds

6 years agomqueue: avoid unused variables
mmacy [Sat, 19 May 2018 04:10:53 +0000 (04:10 +0000)]
mqueue: avoid unused variables

6 years agophysio: avoid uninitialized variables
mmacy [Sat, 19 May 2018 04:09:58 +0000 (04:09 +0000)]
physio: avoid uninitialized variables

6 years agocache_lookup remove unused variable and initialize used
mmacy [Sat, 19 May 2018 04:08:11 +0000 (04:08 +0000)]
cache_lookup remove unused variable and initialize used

6 years agofilt_timerdetach: only assign to old if we're going to check it in
mmacy [Sat, 19 May 2018 04:07:00 +0000 (04:07 +0000)]
filt_timerdetach: only assign to old if we're going to check it in
a KASSERT

6 years agogetnextevent: put variable only used by KTR under ifdef KTR
mmacy [Sat, 19 May 2018 04:05:36 +0000 (04:05 +0000)]
getnextevent: put variable only used by KTR under ifdef KTR

6 years agosimplify control flow so that gcc knows we never pass save to curthread_pflags_restore
mmacy [Sat, 19 May 2018 04:04:44 +0000 (04:04 +0000)]
simplify control flow so that gcc knows we never pass save to curthread_pflags_restore
without initializing

6 years agotty: conditionally assign to ret value only used by MPASS statement
mmacy [Sat, 19 May 2018 04:02:29 +0000 (04:02 +0000)]
tty: conditionally assign to ret value only used by MPASS statement

6 years agopowerpc64: Add OPAL definitions
jhibbits [Sat, 19 May 2018 04:01:15 +0000 (04:01 +0000)]
powerpc64: Add OPAL definitions

Summary:
Add additional OPAL PCI definitions and expand the code to use them in order to
ease the OPAL interface process for new comers.

These definitions came directly from the OPAL code and they are the same for
both PHB3 (POWER8) and PHB4 (POWER9).

Submitted by: Breno Leitao
Differential Revision: https://reviews.freebsd.org/D15432

6 years agoremove unused locked variable in lockmgr_unlock_fast_path
mmacy [Sat, 19 May 2018 03:58:40 +0000 (03:58 +0000)]
remove unused locked variable in lockmgr_unlock_fast_path

6 years agosignotify: don't create a stack local that isn't used on non-debug builds
mmacy [Sat, 19 May 2018 03:57:41 +0000 (03:57 +0000)]
signotify: don't create a stack local that isn't used on non-debug builds

6 years agosysv_msg initialize saved_msgsz
mmacy [Sat, 19 May 2018 03:56:39 +0000 (03:56 +0000)]
sysv_msg initialize saved_msgsz

6 years agoremove unused variable
mmacy [Sat, 19 May 2018 03:55:42 +0000 (03:55 +0000)]
remove unused variable

6 years agofix uninitialized variable warning in reader locks
mmacy [Sat, 19 May 2018 03:52:55 +0000 (03:52 +0000)]
fix uninitialized variable warning in reader locks

6 years agoadd DBGSET macro to conditionally assign to a variable depending on INVARIANTS
mmacy [Sat, 19 May 2018 03:50:29 +0000 (03:50 +0000)]
add DBGSET macro to conditionally assign to a variable depending on INVARIANTS

6 years agofix uninitialized variable warning
mmacy [Sat, 19 May 2018 03:49:36 +0000 (03:49 +0000)]
fix uninitialized variable warning

6 years agosys_process.c fix set but not used warning
mmacy [Sat, 19 May 2018 03:48:35 +0000 (03:48 +0000)]
sys_process.c fix set but not used warning

6 years agosubr_epoch.c fix unused variable warnings
mmacy [Sat, 19 May 2018 03:47:37 +0000 (03:47 +0000)]
subr_epoch.c fix unused variable warnings

6 years agoFix a manual copy from the original diff for r333825
jhibbits [Sat, 19 May 2018 03:47:28 +0000 (03:47 +0000)]
Fix a manual copy from the original diff for r333825

The 'else' was in the original diff.

Submitted by: Breno Leitao

6 years agoAdd yet another option for gathering available memory
jhibbits [Sat, 19 May 2018 03:45:38 +0000 (03:45 +0000)]
Add yet another option for gathering available memory

On some POWER9 systems, 'reg' denotes the full memory in the system, while
'linux,usable-memory' denotes the usable memory.  Some memory is reserved for
NVLink usage, so is partitioned off.

Submitted by: Breno Leitao

6 years agoAdd some Hypervisor interrupt definitions
jhibbits [Sat, 19 May 2018 03:23:46 +0000 (03:23 +0000)]
Add some Hypervisor interrupt definitions

This mostly completes the interrupt definitions.  There are still some left out,
less likely to be used in the near term.

6 years agopidctrl Actually use the variables that we assign to as seatbelts to prevent divide
mmacy [Sat, 19 May 2018 02:17:18 +0000 (02:17 +0000)]
pidctrl Actually use the variables that we assign to as seatbelts to prevent divide
by zero

Reviewed by: jeffr

6 years agofix gcc8 unused variable and set but not used variable in unix sockets
mmacy [Sat, 19 May 2018 02:15:40 +0000 (02:15 +0000)]
fix gcc8 unused variable and set but not used variable in unix sockets
add copyright from lock rewrite while here

6 years agoMerge bmake-20180512
sjg [Sat, 19 May 2018 00:26:00 +0000 (00:26 +0000)]
Merge bmake-20180512

Skip polling job token pipe,
better handle sysV style includes with variables.

6 years agoSilence non-actionable warnings in vendor code
mmacy [Sat, 19 May 2018 00:04:01 +0000 (00:04 +0000)]
Silence non-actionable warnings in vendor code

We can't modify vendor code so there's no signal in warnings from it.
Similarly -Waddress-of-packed-member is not useful on networking code
as access to packed structures is fundamental to its operation.

6 years agoAnnotate td_pre_epoch_prio in struct thread
mmacy [Fri, 18 May 2018 23:17:49 +0000 (23:17 +0000)]
Annotate td_pre_epoch_prio in struct thread

Reported by: jhb

6 years agolockmgr: avoid atomic on unlock in the slow path
mjg [Fri, 18 May 2018 22:57:52 +0000 (22:57 +0000)]
lockmgr: avoid atomic on unlock in the slow path

The code is pretty much guaranteed not to be able to unlock.

This is a minor nit. The code still performs way too many reads.
The altered exclusive-locked condition is supposed to be always
true as well, to be cleaned up at a later date.

6 years agoStop claiming the device-side USB serial interfaces talk Hayes AT.
trasz [Fri, 18 May 2018 20:24:19 +0000 (20:24 +0000)]
Stop claiming the device-side USB serial interfaces talk Hayes AT.

There should be no functional difference.

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

6 years agoifnet: Replace if_addr_lock rwlock with epoch + mutex
mmacy [Fri, 18 May 2018 20:13:34 +0000 (20:13 +0000)]
ifnet: Replace if_addr_lock rwlock with epoch + mutex

Run on LLNW canaries and tested by pho@

gallatin:
Using a 14-core, 28-HTT single socket E5-2697 v3 with a 40GbE MLX5
based ConnectX 4-LX NIC, I see an almost 12% improvement in received
packet rate, and a larger improvement in bytes delivered all the way
to userspace.

When the host receiving 64 streams of netperf -H $DUT -t UDP_STREAM -- -m 1,
I see, using nstat -I mce0 1 before the patch:

InMpps OMpps  InGbs  OGbs err TCP Est %CPU syscalls csw     irq GBfree
4.98   0.00   4.42   0.00 4235592     33   83.80 4720653 2149771   1235 247.32
4.73   0.00   4.20   0.00 4025260     33   82.99 4724900 2139833   1204 247.32
4.72   0.00   4.20   0.00 4035252     33   82.14 4719162 2132023   1264 247.32
4.71   0.00   4.21   0.00 4073206     33   83.68 4744973 2123317   1347 247.32
4.72   0.00   4.21   0.00 4061118     33   80.82 4713615 2188091   1490 247.32
4.72   0.00   4.21   0.00 4051675     33   85.29 4727399 2109011   1205 247.32
4.73   0.00   4.21   0.00 4039056     33   84.65 4724735 2102603   1053 247.32

After the patch

InMpps OMpps  InGbs  OGbs err TCP Est %CPU syscalls csw     irq GBfree
5.43   0.00   4.20   0.00 3313143     33   84.96 5434214 1900162   2656 245.51
5.43   0.00   4.20   0.00 3308527     33   85.24 5439695 1809382   2521 245.51
5.42   0.00   4.19   0.00 3316778     33   87.54 5416028 1805835   2256 245.51
5.42   0.00   4.19   0.00 3317673     33   90.44 5426044 1763056   2332 245.51
5.42   0.00   4.19   0.00 3314839     33   88.11 5435732 1792218   2499 245.52
5.44   0.00   4.19   0.00 3293228     33   91.84 5426301 1668597   2121 245.52

Similarly, netperf reports 230Mb/s before the patch, and 270Mb/s after the patch

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

6 years agotag bmake-20180512
sjg [Fri, 18 May 2018 19:50:22 +0000 (19:50 +0000)]
tag bmake-20180512

6 years agoImport bmake-20180512
sjg [Fri, 18 May 2018 19:49:54 +0000 (19:49 +0000)]
Import bmake-20180512

Of relevance:

  o job.c: skip polling job token pipe
  o parse.c: be more cautious about detecting depenency line
    rather than sysV style include.

also in mk:

* dirdeps.mk: include local.dirdeps-build.mk when .MAKE.LEVEL > 0
  ie. we are building something.
* FILES: add dirdeps-options.mk to deal with optional DIRDEPS.
* ldorder.mk: describe how to use LDORDER_EXTERN_BARRIER
  if needed.

6 years agoBe more robust against garbage input on a TOE TLS TX socket.
jhb [Fri, 18 May 2018 19:09:11 +0000 (19:09 +0000)]
Be more robust against garbage input on a TOE TLS TX socket.

If a socket is closed or shutdown and a partial record (or what
appears to be a partial record) is waiting in the socket buffer,
discard the partial record and close the connection rather than
waiting forever for the rest of the record.

Reported by: Harsh Jain @ Chelsio
Sponsored by: Chelsio Communications

6 years agoepoch(9): allocate net epochs earlier in boot
mmacy [Fri, 18 May 2018 18:48:00 +0000 (18:48 +0000)]
epoch(9): allocate net epochs earlier in boot

6 years agoepoch(9): assert that epoch is allocated post-configure
mmacy [Fri, 18 May 2018 18:27:17 +0000 (18:27 +0000)]
epoch(9): assert that epoch is allocated post-configure

6 years agoepoch: move epoch variables to read mostly section
mmacy [Fri, 18 May 2018 17:58:15 +0000 (17:58 +0000)]
epoch: move epoch variables to read mostly section

6 years agoUse NULL for SYSINIT's last arg, which is a pointer type
emaste [Fri, 18 May 2018 17:58:09 +0000 (17:58 +0000)]
Use NULL for SYSINIT's last arg, which is a pointer type

Sponsored by: The FreeBSD Foundation

6 years agoamd64 GENERIC: correct whitespace on smartpqi entry
emaste [Fri, 18 May 2018 17:51:42 +0000 (17:51 +0000)]
amd64 GENERIC: correct whitespace on smartpqi entry

6 years agoUse sysrc(8) in the documentation rather than echoing things to rc.conf
nwhitehorn [Fri, 18 May 2018 17:46:40 +0000 (17:46 +0000)]
Use sysrc(8) in the documentation rather than echoing things to rc.conf
in order to encourage good habits.

PR: 228325
Submitted by: Mateusz Piotrowski
MFC after: 2 weeks

6 years agoFix math error in the computation of the free space after the last partition
nwhitehorn [Fri, 18 May 2018 17:43:15 +0000 (17:43 +0000)]
Fix math error in the computation of the free space after the last partition
on a disk. This resulted in one sector always remaining free at the end.

PR: bin/228322
Submitted by: Rikiya Yonemoto
MFC after: 2 weeks

6 years agoepoch(9): Make epochs non-preemptible by default
mmacy [Fri, 18 May 2018 17:29:43 +0000 (17:29 +0000)]
epoch(9): Make epochs non-preemptible by default

There are risks associated with waiting on a preemptible epoch section.
Change the name to make them not be the default and document the issue
under CAVEATS.

Reported by: markj

6 years agoQuiesce a couple pages of clang warnings with a cast. Duplicates
sbruno [Fri, 18 May 2018 17:23:23 +0000 (17:23 +0000)]
Quiesce a couple pages of clang warnings with a cast.  Duplicates
linux maintainer commit:

https://github.com/torvalds/linux/commit/627871b71c89a6ec12fbed75063f238e0c7127b2#diff-8c6ddb4c3ad69a6fb9f289475821db56

ar9300template_aphrodite.h:575:40: warning: implicit conversion from 'int'
  to 'u_int8_t' (aka 'unsigned char') changes value from 3495 to 167
  [-Wconstant-conversion]
            /* Data[8].ctl_edges[7].bChannel*/FREQ2FBIN(5795, 0)}
                                              ^~~~~~~~~~~~~~~~~~
ar9300eep.h:142:41: note: expanded from macro 'FREQ2FBIN'
    (((y) == HAL_FREQ_BAND_2GHZ) ? ((x) - 2300) : (((x) - 4800) / 5))

Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D15476

6 years agomuge(4): style and comment cleanup
emaste [Fri, 18 May 2018 17:07:59 +0000 (17:07 +0000)]
muge(4): style and comment cleanup

And tag some spots to revisit with XXX.

Sponsored by: The FreeBSD Foundation

6 years agoDon't increment addl_page_shortage for wired pages.
markj [Fri, 18 May 2018 16:59:58 +0000 (16:59 +0000)]
Don't increment addl_page_shortage for wired pages.

Such pages are dequeued as they're encountered during the inactive queue
scan, so by the time we get to the active queue scan, they should have
already been subtracted from the inactive queue length.

Reviewed by: alc
Differential Revision: https://reviews.freebsd.org/D15479

6 years agoBased on multiple sources including the State Gazette the last day of
imp [Fri, 18 May 2018 16:19:45 +0000 (16:19 +0000)]
Based on multiple sources including the State Gazette the last day of
Julian calendar in Bulgaria was 31.03.1916.

Submitted by: Konstantin Terziev
Pull Request: https://github.com/freebsd/freebsd/pull/142

(I independently confirmed the date and this was the right date to use for ncal)

6 years agomuge(4): sync register names with Microchip's lan7800.h
emaste [Fri, 18 May 2018 14:30:45 +0000 (14:30 +0000)]
muge(4): sync register names with Microchip's lan7800.h

Microchip provided a permissively-licensed lan78xx header, which has
an 'ETH_' prefix on most definitions.  Follow suit in our driver.

Sponsored by: The FreeBSD Foundation

6 years agoTeach pmcannotate about $TMPDIR and _PATH_TMP
gallatin [Fri, 18 May 2018 14:14:04 +0000 (14:14 +0000)]
Teach pmcannotate about $TMPDIR and _PATH_TMP

Convert pmcannotate to using $TMPDIR and _PATH_TMP rather than hard
coding /tmp for temporary files.  Pmcannotate sometimes needs quite a
lot of space to store the output from objdump, and will fail in odd
ways if that output is truncated due to lack of space in /tmp.

Reviewed by: jtl
Sponsored by: Netflix

6 years agobnxt(4)
sbruno [Fri, 18 May 2018 13:49:12 +0000 (13:49 +0000)]
bnxt(4)
- Fix HWRM warning message during HW LRO configuration.

Submitted by: bhargava.marreddy@broadcom.com
MFC after: 1 week
Sponsored by: Broadcom Limited
Differential Revision: https://reviews.freebsd.org/D15466

6 years agoInstead of ignoring the VFP registers, set the dumppcb's pcb_fpusaved
cognet [Fri, 18 May 2018 13:28:02 +0000 (13:28 +0000)]
Instead of ignoring the VFP registers, set the dumppcb's pcb_fpusaved
field, so that they are saved, as they may be used in the kernel, in the
EFI and the crypto code.

Reviewed by: andrew

6 years agoMake the name of option that toggles IFCAP_HWRXTSTMP capability to
ae [Fri, 18 May 2018 12:12:24 +0000 (12:12 +0000)]
Make the name of option that toggles IFCAP_HWRXTSTMP capability to
match the name of this capability. It was added recently and is not merged
to stable branch, so I hope it is not too late to change the name.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D15475

6 years agoEnable the Qualcomm MSM UART driver. This is needed for some Qualcomm
andrew [Fri, 18 May 2018 11:32:48 +0000 (11:32 +0000)]
Enable the Qualcomm MSM UART driver. This is needed for some Qualcomm
Snapdragon SoCs.

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

6 years agoamd64: tweak the read_frequently section
mjg [Fri, 18 May 2018 07:31:26 +0000 (07:31 +0000)]
amd64: tweak the read_frequently section

1. align to 128 bytes to avoid possible waste from the preceeding section
2. sort entries by alignment SORT_BY_ALIGNMENT, plugging the holes (most
entries are one byte in size, but they got interleaved with bigger ones)

Interestingly I was looking for a feature of the sort earlier and failed
to find it. It turns out the script was already utilizing sorting in other
places, so shame on me.

Thanks for Travis Geiselbrecht for pointing me at the feature.

6 years agoMFV r333779: xz 5.2.4.
delphij [Fri, 18 May 2018 06:10:16 +0000 (06:10 +0000)]
MFV r333779: xz 5.2.4.

MFC after: 2 weeks

6 years agocxgbe(4): Implement ifnet callbacks that deal with send tags.
np [Fri, 18 May 2018 06:09:15 +0000 (06:09 +0000)]
cxgbe(4): Implement ifnet callbacks that deal with send tags.

An etid (ethoffload tid) is allocated for a send tag and it acquires a
reference on the traffic class that matches the send parameters
associated with the tag.

Sponsored by: Chelsio Communications

6 years agoepoch(9): fix error in example and update API reference
mmacy [Fri, 18 May 2018 04:13:58 +0000 (04:13 +0000)]
epoch(9): fix error in example and update API reference

Submitted by: hps
Approved by: sbruno

6 years agonetmap: pull fix for 32-bit support from upstream
mmacy [Fri, 18 May 2018 03:38:17 +0000 (03:38 +0000)]
netmap: pull fix for 32-bit support from upstream

Approved by: sbruno

6 years agovt: add more cp437 mappings for vga textmode
emaste [Fri, 18 May 2018 02:58:26 +0000 (02:58 +0000)]
vt: add more cp437 mappings for vga textmode

In UTF-8 locales mandoc uses a number of characters outside of the Basic
Latin group, e.g. from general punctuation or miscellaneous mathematical
symbols, and these rendered as ? in text mode.

This change adds (char, replacement, code point, description):

    ¦ | U+00A6 Broken bar
    ✓ √ U+2713 Checkmark

Sponsored by:   The FreeBSD Foundation

6 years agoepoch: actually allocate the counters we've assigned sysctls too
mmacy [Fri, 18 May 2018 02:57:39 +0000 (02:57 +0000)]
epoch: actually allocate the counters we've assigned sysctls too

Approved by: sbruno

6 years agoepoch: add non-preemptible "critical" variant
mmacy [Fri, 18 May 2018 01:52:51 +0000 (01:52 +0000)]
epoch: add non-preemptible "critical" variant

adds:
- epoch_enter_critical() - can be called inside a different epoch,
  starts a section that will acquire any MTX_DEF mutexes or do
  anything that might sleep.
- epoch_exit_critical() - corresponding exit call
- epoch_wait_critical() - wait variant that is guaranteed that any
  threads in a section are running.
- epoch_global_critical - an epoch_wait_critical safe epoch instance

Requested by:   markj
Approved by: sbruno

6 years agoUse strsep() to parse init_path in start_init().
brooks [Thu, 17 May 2018 23:07:51 +0000 (23:07 +0000)]
Use strsep() to parse init_path in start_init().

This simplifies the use of the path variable by making it NUL
terminated.  This is a prerequisite for further cleanups.

Reviewed by: imp
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15467

6 years agoIn pmap_get_tables(), check that the L2 is indeed a table before attempting
cognet [Thu, 17 May 2018 22:40:22 +0000 (22:40 +0000)]
In pmap_get_tables(), check that the L2 is indeed a table before attempting
to get the l3.

6 years agoIn vfp_save_state(), don't bother trying to save the VFP registers if the
cognet [Thu, 17 May 2018 22:38:16 +0000 (22:38 +0000)]
In vfp_save_state(), don't bother trying to save the VFP registers if the
provided PCB doesn't have a pcb_fpusaved. All PCBs associated to a thread
should have one, but the dumppcb used when panic'ing doesn't.

6 years agoepoch: skip poll function call in hardclock unless there are callbacks pending
mmacy [Thu, 17 May 2018 21:39:15 +0000 (21:39 +0000)]
epoch: skip poll function call in hardclock unless there are callbacks pending

Reported by: mjg
Approved by: sbruno

6 years agoAdd a missing nfsrv_freesession() call for an unlikely failure case.
rmacklem [Thu, 17 May 2018 21:17:20 +0000 (21:17 +0000)]
Add a missing nfsrv_freesession() call for an unlikely failure case.

Since NFSv4.1 clients normally create a single session which supports
both fore and back channels, it is unlikely that a callback will fail
due to a lack of a back channel.
However, if this failure occurred, the session wasn't being dereferenced
and would never be free'd.
Found by inspection during pNFS server development.

Tested by: andreas.nagy@frequentis.com
MFC after: 2 months

6 years agopowerpc: fix LINT build
mmacy [Thu, 17 May 2018 21:04:19 +0000 (21:04 +0000)]
powerpc: fix LINT build

netmap currently doesn't build, take it out of LINT to prevent
hiding regressions in universe

Reviewed by: jhibbits
Approved by: sbruno

6 years agoepoch(9): schedule pcpu callback task in hardclock if there are callbacks pending
mmacy [Thu, 17 May 2018 19:57:07 +0000 (19:57 +0000)]
epoch(9): schedule pcpu callback task in hardclock if there are callbacks pending

Approved by: sbruno

6 years agoAdd a "multifunction" device side USB template, which provides mass
trasz [Thu, 17 May 2018 19:54:11 +0000 (19:54 +0000)]
Add a "multifunction" device side USB template, which provides mass
storage, CDC ACM (serial), and CDC ECM (ethernet) at the same time.
It's quite similar in function to Linux' "g_multi" gadget.

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

6 years agoepoch(9): eliminate the need to wait when polling for callbacks to run
mmacy [Thu, 17 May 2018 19:50:55 +0000 (19:50 +0000)]
epoch(9): eliminate the need to wait when polling for callbacks to run

by using ck's own callback handling mechanism we can simply check which
callbacks have had a grace period elapse

Approved by: sbruno

6 years agoepoch(9): fix potential deadlock
mmacy [Thu, 17 May 2018 19:41:58 +0000 (19:41 +0000)]
epoch(9): fix potential deadlock

Don't acquire a waiting thread's lock while holding our own

Approved by: sbruno

6 years agoepoch(9): missed add from r333755
mmacy [Thu, 17 May 2018 19:30:57 +0000 (19:30 +0000)]
epoch(9): missed add from r333755

Reported by: flo
Approved by: sbruno

6 years agorelease: rpi3: Copy the special rpi3 config.txt
manu [Thu, 17 May 2018 19:10:13 +0000 (19:10 +0000)]
release: rpi3: Copy the special rpi3 config.txt

RPI* 32bits and RPI* 64bits have a different config.txt
Copy to correct config.txt to the fat partition of the release image.
Also copy pwm.dtbo as some people want to use it.

Reviewed by: gjb

6 years agoepoch(9): restore thread priority on exit if it was changed by a waiter
mmacy [Thu, 17 May 2018 19:08:28 +0000 (19:08 +0000)]
epoch(9): restore thread priority on exit if it was changed by a waiter

Reported by: markj
Approved by: sbruno

6 years agoRemove a reference to NETDUMP_DEBUG, and document sysctls.
markj [Thu, 17 May 2018 19:06:44 +0000 (19:06 +0000)]
Remove a reference to NETDUMP_DEBUG, and document sysctls.

NETDUMP_DEBUG was removed and replaced with a sysctl which enables
debug output without requiring a recompile.

6 years agock: add support for executing callbacks outside of main poll loop
mmacy [Thu, 17 May 2018 18:14:10 +0000 (18:14 +0000)]
ck: add support for executing callbacks outside of main poll loop

Pull in change from upstream deca119d14bfffd440770eb67cbdbeaf7b57eb7b

|    ck_epoch: introduce ck_epoch_deferred
|
|    Allow for deferral to occur outside epoch poll critical loop (which may access per-CPU structures).
|

Approved by: sbruno

6 years agoAF_UNIX: make unix socket locking finer grained
mmacy [Thu, 17 May 2018 17:59:35 +0000 (17:59 +0000)]
AF_UNIX: make unix socket locking finer grained

This change moves to using a reference count across lock drop / reacquire
to guarantee liveness.

Currently sends on unix sockets contend heavily on read locking the list lock.
unix1_processes in will-it-scale peaks at 6 processes and then declines.

With this change I get a substantial improvement in number of operations per second
with 96 processes:

x before
+ after
    N           Min           Max        Median           Avg        Stddev
x  11       1688420       1696389       1693578     1692766.3     2971.1702
+  10      63417955      71030114      70662504      69576423     2374684.6
Difference at 95.0% confidence
        6.78837e+07 +/- 1.49463e+06
        4010.22% +/- 88.4246%
        (Student's t, pooled s = 1.63437e+06)

And even for 2 processes shows a ~18% improvement.
"Small" iron changes (1, 2, and 4 processes):

x before1
+ after1.2
+------------------------------------------------------------------------+
|                                                                  +     |
|                                                           x      +     |
|                                                           x      +     |
|                                                           x      +     |
|                                                           x     ++     |
|                                                          xx     ++     |
|x                                                       x xx     ++     |
|                                  |__________________A_____M_____AM____||
+------------------------------------------------------------------------+
    N           Min           Max        Median           Avg        Stddev
x  10       1131648       1197750     1197138.5     1190369.3     20651.839
+  10       1203840       1205056       1204919     1204827.9     353.27404
Difference at 95.0% confidence
        14458.6 +/- 13723
        1.21463% +/- 1.16683%
        (Student's t, pooled s = 14605.2)

x before2
+ after2.2
+------------------------------------------------------------------------+
|                                                                       +|
|                                                                       +|
|                                                                       +|
|                                                                       +|
|                                                                       +|
|                                                                       +|
|           x                                                           +|
|           x                                                           +|
|         x xx                                                          +|
|x        xxxx                                                          +|
|      |___AM_|                                                         A|
+------------------------------------------------------------------------+
    N           Min           Max        Median           Avg        Stddev
x  10       1972843       2045866     2038186.5     2030443.8     21367.694
+  10       2400853       2402196     2401043.5     2401172.7     385.40024
Difference at 95.0% confidence
        370729 +/- 14198.9
        18.2585% +/- 0.826943%
        (Student's t, pooled s = 15111.7)

x before4
+ after4.2
    N           Min           Max        Median           Avg        Stddev
x  10       3986994       3991728     3990137.5     3989985.2     1300.0164
+  10       4799990       4806664     4806116.5       4805194     1990.6625
Difference at 95.0% confidence
        815209 +/- 1579.64
        20.4314% +/- 0.0421713%
        (Student's t, pooled s = 1681.19)

Tested by: pho
Reported by: mjg
Approved by: sbruno
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15430

6 years agoFix build if USB_DEBUG is defined.
andreast [Thu, 17 May 2018 17:57:41 +0000 (17:57 +0000)]
Fix build if USB_DEBUG is defined.

6 years agointel-ucode-split: incorporate review feedback, using asprintf
emaste [Thu, 17 May 2018 17:45:47 +0000 (17:45 +0000)]
intel-ucode-split: incorporate review feedback, using asprintf

As reported by delphij in review D15443 asprintf cleans this up a little
by avoiding hardcoded buffer sizes.

Reported by: delphij

6 years agorelease: arm: Format FAT partition as FAT16
manu [Thu, 17 May 2018 16:21:12 +0000 (16:21 +0000)]
release: arm: Format FAT partition as FAT16

r332674 raised the size of the FAT partition from 2MB to 41MB for some
boards. But we format them in FAT12 and this size appears to be to big
for FAT12 and some SoC bootrom cannot cope with that.
Format the msdosfs partition as FAT16,

PR: 228285
MFC after: soon

6 years agoMark usfs(4) as obsolete; users are advised to use cfumass(4) instead.
trasz [Thu, 17 May 2018 15:21:19 +0000 (15:21 +0000)]
Mark usfs(4) as obsolete; users are advised to use cfumass(4) instead.

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

6 years agoFix off-by-one in usb_decode_str_desc(). Previously it would decode
trasz [Thu, 17 May 2018 15:19:29 +0000 (15:19 +0000)]
Fix off-by-one in usb_decode_str_desc().  Previously it would decode
one character too many.  Note that this function is only used to decode
string descriptors generated by the kernel itself.

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

6 years agoRetire vxge(4).
sbruno [Thu, 17 May 2018 14:55:41 +0000 (14:55 +0000)]
Retire vxge(4).

This driver was merged to HEAD one week prior to Exar publicly announcing they
had left the Ethernet market. It is not known to be used and has various code
quality issues spotted by Brooks and Hiren. Retire it in preparation for
FreeBSD 12.0.

Submitted by: kbowling
Reviewed by: brooks imp
Relnotes: yes
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15442

6 years agoaw_spi: Fix some silly clock mistake
manu [Thu, 17 May 2018 14:51:22 +0000 (14:51 +0000)]
aw_spi: Fix some silly clock mistake

The module uses the mod clock and not the ahb one.
We need to set the mod clock to twice the speed requested as the smallest
divider in the controller is 2.
The clock test function weren't calculating the register value best on the
best div but on the max one.
The cdr2 test function was using the cdr1 formula.

Pointy Hat: manu