SVNews

NOTE: This service is experimental and subject to change! Use at your own risk!

Year:   Month: - or - Filter committers: - or -
Filter paths:
Include diffs if smaller than lines.

2017 - 03 - 23   (today)
08:10:42 - r315841
( 2 minutes ago)
by avg
Affects: 
(2 files)
/stable/10/sys/dev/aacraid/aacraid_cam.c
MFC r315083: aacraid: fix build with AACRAID_DEBUG=2
08:10:25 - r315840
( 3 minutes ago)
by avg
Affects: 
(2 files)
/stable/11/sys/dev/aacraid/aacraid_cam.c
MFC r315083: aacraid: fix build with AACRAID_DEBUG=2
08:08:39 - r315839
( 5 minutes ago)
by avg
Affects: 
(3 files)
/stable/10/sys/kern/sched_4bsd.c
/stable/10/sys/kern/sched_ule.c
MFC r315075: trace thread running state when a thread is run for the first time
08:08:34 - r315838
( 5 minutes ago)
by avg
Affects: 
(3 files)
/stable/11/sys/kern/sched_4bsd.c
/stable/11/sys/kern/sched_ule.c
MFC r315075: trace thread running state when a thread is run for the first time
08:02:29 - r315837
( 11 minutes ago)
by avg
Affects: 
(2 files)
/stable/10/sys/kern/kern_thread.c
MFC r315074: actually implement proc:::lwp-exit probe
08:02:23 - r315836
( 11 minutes ago)
by avg
Affects: 
(2 files)
/stable/11/sys/kern/kern_thread.c
MFC r315074: actually implement proc:::lwp-exit probe
08:00:45 - r315835
( 12 minutes ago)
by avg
Affects: 
(2 files)
/stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
MFC r314913: MFV r314911: 7867 ARC space accounting leak
08:00:16 - r315834
( 13 minutes ago)
by avg
Affects: 
(2 files)
/stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
MFC r314913: MFV r314911: 7867 ARC space accounting leak
07:57:42 - r315833
( 15 minutes ago)
by avg
Affects: 
(2 files)
/stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
MFC r314912: MFV r314910: 7843 get_clones_stat() is suboptimal for lots of
clones
07:57:37 - r315832
( 16 minutes ago)
by avg
Affects: 
(2 files)
/stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
MFC r314912: MFV r314910: 7843 get_clones_stat() is suboptimal for lots of
clones
07:56:13 - r315831
( 17 minutes ago)
by avg
Affects: 
(2 files)
/stable/10/sys/dev/firewire/sbp.c
MFC r314864: firewire/sbp: try to improve locking, plus a few style nits
07:56:07 - r315830
( 17 minutes ago)
by avg
Affects: 
(2 files)
/stable/11/sys/dev/firewire/sbp.c
MFC r314864: firewire/sbp: try to improve locking, plus a few style nits
07:36:38 - r315829
( 37 minutes ago)
by ngie
Affects:  /head/share/man/man9/iflibdd.9
/head/share/man/man9/iflibdi.9
/head/share/man/man9/iflibtxrx.9
Try polishing up iflib manpages a bit (basically all the low hanging fruit)

igor:
- Fix typos.
- Delete trailing whitespace.

manlint:
- Use .Fo/.Fc/.Fa when describing functions.
- Use .Xr.
- Fill in SEE ALSO section.
- Fix .Dt use: the section was specified incorrectly and the name
  had a lowercase character.
- Continue new sentences on new lines.

Miscellaneous:
- Remove unnecessary quotes around "SEE ALSO" section headers.
- Sprinkle .Dv use in spots with constants.

Reported by: igor, make manlint
Sponsored by: Dell EMC Isilon
06:55:32 - r315828
(1 hour 18 minutes ago)
by mav
Affects: 
(3 files)
/stable/10/sys/dev/mpt/mpt.h
/stable/10/sys/dev/mpt/mpt_cam.c
MFC r315067: Partially fix target task management requests handling.

 - XPT_NOTIFY_ACKNOWLEDGE was not handled, causing stuck requests.
 - XPT_ABORT was not even trying to abort active ATIOs/INOTs.
 - Initiator's tag was not stored and not used where needed.
 - List of TM request types needed update.
 - mpt_scsi_tgt_status() missed some useful debugging.

After this change global TM requests, such as reset, should work properly.
ABORT TASK (ABTS) requests are still not passes to CTL, that is not good
and should be fixed.
06:53:31 - r315827
(1 hour 20 minutes ago)
by mav
Affects: 
(3 files)
/stable/11/sys/dev/mpt/mpt.h
/stable/11/sys/dev/mpt/mpt_cam.c
MFC r315067: Partially fix target task management requests handling.

 - XPT_NOTIFY_ACKNOWLEDGE was not handled, causing stuck requests.
 - XPT_ABORT was not even trying to abort active ATIOs/INOTs.
 - Initiator's tag was not stored and not used where needed.
 - List of TM request types needed update.
 - mpt_scsi_tgt_status() missed some useful debugging.

After this change global TM requests, such as reset, should work properly.
ABORT TASK (ABTS) requests are still not passes to CTL, that is not good
and should be fixed.
06:52:29 - r315826
(1 hour 21 minutes ago)
by mav
Affects: 
(3 files)
/stable/10/sys/dev/mpt/mpt_cam.c
/stable/10/sys/dev/mpt/mpt_debug.c
MFC r315004: Add PIM_EXTLUNS support to mpt(4).

Target mode is still limited to 256 LUNs due to the way driver is written,
but initiator can now use full 8 byte LUN space.
06:51:53 - r315825
(1 hour 21 minutes ago)
by mav
Affects: 
(3 files)
/stable/11/sys/dev/mpt/mpt_cam.c
/stable/11/sys/dev/mpt/mpt_debug.c
MFC r315004: Add PIM_EXTLUNS support to mpt(4).

Target mode is still limited to 256 LUNs due to the way driver is written,
but initiator can now use full 8 byte LUN space.
06:50:46 - r315824
(1 hour 22 minutes ago)
by mav
Affects: 
(3 files)
/stable/10/sys/dev/mpt/mpt.h
/stable/10/sys/dev/mpt/mpt_cam.c
MFC r315002: Improve residuals reporting in target mode.
06:50:13 - r315823
(1 hour 23 minutes ago)
by mav
Affects: 
(3 files)
/stable/11/sys/dev/mpt/mpt.h
/stable/11/sys/dev/mpt/mpt_cam.c
MFC r315002: Improve residuals reporting in target mode.
06:49:36 - r315822
(1 hour 24 minutes ago)
by mav
Affects: 
(2 files)
/stable/11/sys/dev/mpt/mpt_cam.c
MFC r315001: Fix panic on wildcard target LUN disable.
06:49:01 - r315821
(1 hour 24 minutes ago)
by mav
Affects: 
(3 files)
/stable/10/sys/dev/mpt/mpt.h
/stable/10/sys/dev/mpt/mpt_cam.c
MFC r314998: Fix FC target mode in mpt(4), broken in multiple ways.

 - Not set BufferLength caused receive of empty ATIOs.
 - CDB length guessing was broken at least for RC16.
 - mpt_req_untimeout() was called with wrong req parameter.
 - Sense data reporting was broken in several ways.

With this change my LSI7204EP-LC can pass at least basic tests as target.
The code is still far from perfect, but finally I found second hw/driver
after isp(4) that really can work in CAM target mode.
06:48:31 - r315820
(1 hour 25 minutes ago)
by mav
Affects: 
(3 files)
/stable/11/sys/dev/mpt/mpt.h
/stable/11/sys/dev/mpt/mpt_cam.c
MFC r314998: Fix FC target mode in mpt(4), broken in multiple ways.

 - Not set BufferLength caused receive of empty ATIOs.
 - CDB length guessing was broken at least for RC16.
 - mpt_req_untimeout() was called with wrong req parameter.
 - Sense data reporting was broken in several ways.

With this change my LSI7204EP-LC can pass at least basic tests as target.
The code is still far from perfect, but finally I found second hw/driver
after isp(4) that really can work in CAM target mode.
06:47:48 - r315819
(1 hour 25 minutes ago)
by mav
Affects: 
(3 files)
/stable/10/sys/dev/mpt/mpt.h
/stable/10/sys/dev/mpt/mpt_cam.c
MFC r314967: Add support for XPT_GET_SIM_KNOB in FC mode.
06:47:08 - r315818
(1 hour 26 minutes ago)
by mav
Affects: 
(3 files)
/stable/11/sys/dev/mpt/mpt.h
/stable/11/sys/dev/mpt/mpt_cam.c
MFC r314967: Add support for XPT_GET_SIM_KNOB in FC mode.
06:45:57 - r315817
(1 hour 27 minutes ago)
by mav
Affects: 
(3 files)
/stable/10/sys/dev/mpt/mpt.h
/stable/10/sys/dev/mpt/mpt_cam.c
MFC r314968: Report some more data in XPT_PATH_INQ.

I am not sure they are used anywhere, but why not.
06:45:11 - r315816
(1 hour 28 minutes ago)
by mav
Affects: 
(3 files)
/stable/11/sys/dev/mpt/mpt.h
/stable/11/sys/dev/mpt/mpt_cam.c
MFC r314968: Report some more data in XPT_PATH_INQ.

I am not sure they are used anywhere, but why not.
06:42:27 - r315815
(1 hour 31 minutes ago)
by mav
Affects: 
(2 files)
/stable/10/sys/dev/mpt/mpt_cam.c
MFC r314966: Report FC link speed.
06:41:58 - r315814
(1 hour 31 minutes ago)
by mav
Affects: 
(2 files)
/stable/11/sys/dev/mpt/mpt_cam.c
MFC r314966: Report FC link speed.
06:41:13 - r315813
(1 hour 32 minutes ago)
by mav
Affects: 
(51 files)
/stable/10/sys/cam/*
/stable/10/sys/dev/*
/stable/10/sys/powerpc/*
MFC r311305 (by asomers):
Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)

The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq are
fixed-length strings. AFAICT the only place they're read is in
sbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated.
However, the kernel doesn't null-terminate them. A bunch of copy-pasted code
uses strncpy to write them, and doesn't guarantee null-termination. For at
least 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actually
overflows. You can see the result by doing "camcontrol negotiate da0 -v".

This change null-terminates those fields everywhere they're set in the
kernel. It also shortens a few strings to ensure they'll fit within the
16-character field.

PR: 215474
Reported by: Coverity
CID: 1009997 1010000 1010001 1010002 1010003 1010004 1010005
CID: 1331519 1010006 1215097 1010007 1288967 1010008 1306000
CID: 1211924 1010009 1010010 1010011 1010012 1010013 1010014
CID: 1147190 1010017 1010016 1010018 1216435 1010020 1010021
CID: 1010022 1009666 1018185 1010023 1010025 1010026 1010027
CID: 1010028 1010029 1010030 1010031 1010033 1018186 1018187
CID: 1010035 1010036 1010042 1010041 1010040 1010039
06:40:20 - r315812
(1 hour 33 minutes ago)
by mav
Affects: 
(52 files)
/stable/11/sys/cam/*
/stable/11/sys/dev/*
/stable/11/sys/powerpc/*
MFC r311305 (by asomers):
Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)

The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq are
fixed-length strings. AFAICT the only place they're read is in
sbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated.
However, the kernel doesn't null-terminate them. A bunch of copy-pasted code
uses strncpy to write them, and doesn't guarantee null-termination. For at
least 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actually
overflows. You can see the result by doing "camcontrol negotiate da0 -v".

This change null-terminates those fields everywhere they're set in the
kernel. It also shortens a few strings to ensure they'll fit within the
16-character field.

PR: 215474
Reported by: Coverity
CID: 1009997 1010000 1010001 1010002 1010003 1010004 1010005
CID: 1331519 1010006 1215097 1010007 1288967 1010008 1306000
CID: 1211924 1010009 1010010 1010011 1010012 1010013 1010014
CID: 1147190 1010017 1010016 1010018 1216435 1010020 1010021
CID: 1010022 1009666 1018185 1010023 1010025 1010026 1010027
CID: 1010028 1010029 1010030 1010031 1010033 1018186 1018187
CID: 1010035 1010036 1010042 1010041 1010040 1010039
06:37:23 - r315811
(1 hour 36 minutes ago)
by mav
Affects: 
(2 files)
/stable/10/sys/dev/mpt/mpt.c
MFC r308423 (by scottl):
Fix the fallout from r308268 (mpt driver causes endless witness warnings in
VMWare and elsewhere) with the precision of a dull, rusty butter knife.
06:36:55 - r315810
(1 hour 36 minutes ago)
by mav
Affects: 
(2 files)
/stable/11/sys/dev/mpt/mpt.c
MFC r308423 (by scottl):
Fix the fallout from r308268 (mpt driver causes endless witness warnings in
VMWare and elsewhere) with the precision of a dull, rusty butter knife.
06:34:45 - r315809
(1 hour 38 minutes ago)
by mav
Affects: 
(2 files)
/stable/10/sys/dev/mpt/mpt_pci.c
MFC r303874 (by trasz):
Remove NULL check after M_WAITOK allocation from mpt(4).
06:34:15 - r315808
(1 hour 39 minutes ago)
by mav
Affects: 
(2 files)
/stable/11/sys/dev/mpt/mpt_pci.c
MFC r303874 (by trasz):
Remove NULL check after M_WAITOK allocation from mpt(4).
06:31:03 - r315807
(1 hour 42 minutes ago)
by mav
Affects: 
(2 files)
/stable/11/sbin/camcontrol/camcontrol.c
MFC r314964: Decode modern PIM flags.
06:29:47 - r315806
(1 hour 43 minutes ago)
by mav
Affects: 
(2 files)
/stable/10/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c
MFC r314952: Fix unused variable when built without INVARIANT_SUPPORT.
06:28:34 - r315805
(1 hour 45 minutes ago)
by mav
Affects: 
(2 files)
/stable/11/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c
MFC r314952: Fix unused variable when built without INVARIANT_SUPPORT.
06:11:31 - r315804
(2 hours 2 minutes ago)
by ngie
Affects:  /head/share/man/man9/PCI_IOV_INIT.9
/head/share/man/man9/PCI_IOV_UNINIT.9
PCI_IOV_*INIT(9): fix make manlint warnings

Add missing section number when referring to PCI_IOV_*INIT(9) with .Xr
from the other corresponding manpage.

MFC after: 1 week
Reported by: make manlint
Sponsored by: Dell EMC Isilon
06:08:01 - r315803
(2 hours 5 minutes ago)
by ngie
Affects:  /head/share/man/man9/memguard.9
memguard(9): fix igor/manlint warnings

- Expand a contraction [1].
- Add a missing section number when referring to uma(9) with .Xr .

MFC after: 1 week
Reported by: igor [1], make manlint [2]
Sponsored by: Dell EMC Isilon
06:02:23 - r315802
(2 hours 11 minutes ago)
by ngie
Affects:  /head/share/man/man9/ifnet.9
ifnet(9): fix some igor/manlint warnings

- Fix typos (queueing -> queuing) [1].
- Add missing section number for polling .Xr reference [2].

MFC after: 1 week
Reported by: igor [1], make manlint [2]
Sponsored by: Dell EMC Isilon
05:54:07 - r315801
(2 hours 19 minutes ago)
by ngie
Affects:  /head/share/man/man9/dnv.9
dnv(9): fix use of commas with .Nm in NAME section

MFC after: 1 week
Reported by: make manlint
Sponsored by: Dell EMC Isilon
05:54:03 - r315800
(2 hours 19 minutes ago)
by mmel
Affects:  /head/sys/arm/nvidia/tegra_sdhci.c
Release all previously allocated resources.
05:51:54 - r315799
(2 hours 21 minutes ago)
by ngie
Affects:  /head/share/man/man9/counter.9
counter(9): fix igor/manlint warnings

- Reword description of `counter_enter` slightly to fix
  wordiness [1].
- Expand "isn't" as "is not" [1].
- Add missing section number with .Xr sysctl calls [2].

MFC after: 1 week
Reported by: igor [1], make manlint [2]
Sponsored by: Dell EMC Isilon
05:44:18 - r315798
(2 hours 29 minutes ago)
by ngie
Affects:  /head/share/man/man9/DB_COMMAND.9
DB_COMMAND(9): fix mandoc markup

Start new sentences on new lines.

MFC after: 1 week
Reported by: make manlint
Sponsored by: Dell EMC Isilon
05:41:56 - r315797
(2 hours 31 minutes ago)
by ngie
Affects:  /head/share/man/man9/buf_ring.9
buf_ring(9): fix mandoc markup

Remove spurious trailing comma after `buf_ring_peek` in the NAME
section.

MFC after: 1 week
Sponsored by: Dell EMC Isilon
05:38:57 - r315796
(2 hours 34 minutes ago)
by ngie
Affects:  /head/share/man/man9/bus_alloc_resource.9
bus_alloc_resource(9): fix mandoc markup

Add missing comma after `.Nm bus_alloc_resource_any` in NAME section.

MFC after: 1 week
Reported by: make manlint
Sponsored by: Dell EMC Isilon
05:37:04 - r315795
(2 hours 36 minutes ago)
by ngie
Affects:  /head/share/man/man9/alq.9
alq(9): fix mandoc markup

Start new sentence on a new line.

MFC after: 1 week
Sponsored by: Dell EMC Isilon
05:32:02 - r315794
(2 hours 41 minutes ago)
by ngie
Affects: 
(2 files)
/stable/11/etc/mtree/BSD.tests.dist
MFC r314892:
r314892 (by cy):

Fix install due to incorrect placement of pwait dir in r314886.
05:26:44 - r315793
(2 hours 46 minutes ago)
by ngie
Affects:  /head/share/man/man3/intro.3
intro(3): fix markup

- Use `Em` with `.It` macro when referring to other libraries, instead of
  `Xr`.
- Use `.Em` instead of `.Xr` when referring to libraries.
- Remove commented out lines.

MFC after: 1 month
Reported by: make manlint
Sponsored by: Dell EMC Isilon
05:19:56 - r315792
(2 hours 53 minutes ago)
by delphij
Affects:  /vendor/ntp/4.2.8p10
Tag ntp 4.2.8p10.
05:19:00 - r315791
(2 hours 54 minutes ago)
by delphij
Affects: 
(321 files)
/vendor/ntp/dist/*
Vendor import of ntp-4.2.8p10.
05:15:35 - r315790
(2 hours 58 minutes ago)
by ngie
Affects:  /head/share/man/man7/tuning.7
tuning(7): fix SEE ALSO section sorting

dummynet(4) should come before eventtimers(4)

MFC after: 1 week
Sponsored by: Dell EMC Isilon
05:12:07 - r315789
(3 hours 1 minute ago)
by ngie
Affects:  /head/share/man/man7/tests.7
tests(7): fix mdoc warning

Continue sentence in "Configuring the tests" on a new line.

MFC after: 1 week
Reported by: make manlint
Sponsored by: Dell EMC Isilon
05:06:40 - r315788
(3 hours 6 minutes ago)
by ngie
Affects:  /head/share/man/man7/build.7
build(7): sort SEE ALSO section

tests(7) should be grouped in the man section 7 group, not the section 8 group.

MFC after: 1 week
Reported by: make manlint
Sponsored by: Dell EMC Isilon
04:54:31 - r315787
(3 hours 19 minutes ago)
by ngie
Affects: 
(2 files)
/stable/10/lib/libkvm/kvm.c
MFC r315360:

Return NULL instead of 0 on failure in _kvm_open, kvm_open{,2,files}

This is being done for the following reasons:
- kvm_open(3), etc says they will return NULL.
- NULL by definition is (void*)0 per POSIX, but can be redefined,
  depending on the compiler, etc.
04:50:50 - r315786
(3 hours 22 minutes ago)
by ngie
Affects: 
(2 files)
/stable/10/lib/libkvm/kvm_getpcpu.3
MFC r315363,r315365:

r315363:

Fix manlint errors

- Add missing comma after kvm_dpcpu_setcpu .Nm macro use (multiple
  .Nm entries should be separated by commas)
- Add missing section for kvm_dpcpu_setcpu Xr.

r315365:

Tweak r315363 slightly

I noticed after commit that kvm_dpcpu_setcpu was defined in the manpage.
Thus, the correct macro for the function reference is .Fn, not .Xr.
04:50:44 - r315785
(3 hours 22 minutes ago)
by ngie
Affects: 
(2 files)
/stable/11/lib/libkvm/kvm.c
MFC r315360:

Return NULL instead of 0 on failure in _kvm_open, kvm_open{,2,files}

This is being done for the following reasons:
- kvm_open(3), etc says they will return NULL.
- NULL by definition is (void*)0 per POSIX, but can be redefined,
  depending on the compiler, etc.
04:50:38 - r315784
(3 hours 23 minutes ago)
by adrian
Affects:  /head/sys/dev/iwm/if_iwm.c
/head/sys/dev/iwm/if_iwm_scan.c
/head/sys/dev/iwm/if_iwmvar.h
[iwm] Make ucode capabilities and api flags handling more like iwlwifi.

Obtained from: dragonflybsd.git 757eecf0e6c92745aa2eee95811e573c8300850e
04:49:33 - r315783
(3 hours 24 minutes ago)
by ngie
Affects: 
(3 files)
/stable/11/lib/libkvm/kvm_getpcpu.3
/stable/11/lib/libkvm/kvm_native.3
MFC r315362,r315363,r315365:

r315362:

Capitalize .Dt macro argument

By convention, per mdoc(7), the document title should be all caps.

r315363:

Fix manlint errors

- Add missing comma after kvm_dpcpu_setcpu .Nm macro use (multiple
  .Nm entries should be separated by commas)
- Add missing section for kvm_dpcpu_setcpu Xr.

r315365:

Tweak r315363 slightly

I noticed after commit that kvm_dpcpu_setcpu was defined in the manpage.
Thus, the correct macro for the function reference is .Fn, not .Xr.
04:47:57 - r315782
(3 hours 25 minutes ago)
by ngie
Affects: 
(2 files)
/stable/11/rescue/rescue/Makefile
MFC r315654:

Fix linking /rescue/rescue to multiple programs in usr.bin after r315113

I meant for the line that conditionally added in /usr/bin/nc support to
be `+=', not `=`. This restores hardlinks for all programs in usr.bin
specified before nc(1), e.g., bunzip2 and tar.

Pointyhat to: ngie
04:47:43 - r315781
(3 hours 25 minutes ago)
by ngie
Affects: 
(2 files)
/stable/10/rescue/rescue/Makefile
MFC r315654:

Fix linking /rescue/rescue to multiple programs in usr.bin after r315113

I meant for the line that conditionally added in /usr/bin/nc support to
be `+=', not `=`. This restores hardlinks for all programs in usr.bin
specified before nc(1), e.g., bunzip2 and tar.

Pointyhat to: ngie
04:43:04 - r315780
(3 hours 30 minutes ago)
by adrian
Affects: 
(4 files)
/head/sys/dev/iwm/*
[iwm] Remove a couple of unneeded IWM_UCODE_TLV_FLAGS_* flags.

* All the supported firmwares have these flags set.

* This removes the following flags:
  IWM_UCODE_TLV_FLAGS_PM_CMD_SUPPORT,
  IWM_UCODE_TLV_FLAGS_NEWBT_COEX,
  IWM_UCODE_TLV_FLAGS_BF_UPDATED,
  IWM_UCODE_TLV_FLAGS_D3_CONTINUITY_API,
  IWM_UCODE_TLV_FLAGS_STA_KEY_CMD,
  IWM_UCODE_TLV_FLAGS_DEVICE_PS_CMD,
  IWM_UCODE_TLV_FLAGS_SCHED_SCAN,
  IWM_UCODE_TLV_FLAGS_RX_ENERGY_API,
  IWM_UCODE_TLV_FLAGS_TIME_EVENT_API_V2

* Also remove definitions and code for dealing with the v1 time-event api.

* Remove unneeded calc_rssi() function.

Obtained from: dragonflybsd.git d078c812418d0e2c3392e99fa25fc776d07bdfad
04:35:52 - r315779
(3 hours 37 minutes ago)
by ngie
Affects:  /head/usr.bin/diff/diff.1
diff(1): document remaining long options

While here, try and tie together some of the short options with
their long option equivalents, where possible.

Sponsored by: Dell EMC Isilon
04:34:25 - r315778
(3 hours 39 minutes ago)
by adrian
Affects:  /head/sys/dev/iwm/if_iwm.c
[iwm] Move mbuf hacks after sanity checks in iwm_mvm_rx_rx_mpdu().

* This avoids leaving the mbuf in a weird state, when dropping a packet.

Obtained from: dragonflybsd.git 96eaecf93d9f731459a0df8efc72cfad034320bd
04:33:15 - r315777
(3 hours 40 minutes ago)
by adrian
Affects:  /head/sys/dev/iwm/if_iwm.c
[iwm] Get rid of struct iwm_rx_data argument for iwm_mvm_rx_rx_mpdu.

Obtained from: dragonflybsd.git b5cdd8067951dc90271ab104ef555b3b5a4d5d5a
03:28:24 - r315776
(4 hours 45 minutes ago)
by ngie
Affects: 
(40 files)
/head/ObsoleteFiles.inc
/head/usr.bin/*
/head/usr.sbin/pw/tests/*
Rename tests from <foo> to <foo>_test to match the FreeBSD test suite
naming scheme

usr.bin/diff/diff_test was renamed to usr.bin/diff/netbsd_diff_test
to avoid collisions with the renamed FreeBSD test.

MFC after: 1 week
Sponsored by: Dell EMC Isilon
02:57:08 - r315775
(5 hours 16 minutes ago)
by ngie
Affects: 
(4 files)
/head/sbin/mount/mount.8
/head/sbin/mount_cd9660/mount_cd9660.8
/head/share/man/man5/*
Add a post-humous manpage for cd9660(5), the ISO-9660 file system

Describe (briefly) how to compile the filesystem into the kernel and
load as a module.

Reference cd9660(5) in mount(8) and mount_cd9660(8).

MFC after: 1 month
Sponsored by: Dell EMC Isilon
02:50:35 - r315774
(5 hours 23 minutes ago)
by ngie
Affects:  /head/sbin/mount/mount.conf.8
mount.conf(8): fix a .Xr call

Add the missing section number for devfs(5)

MFC after: 1 week
Sponsored by: Dell EMC Isilon
02:36:51 - r315773
(5 hours 36 minutes ago)
by imp
Affects:  /head/sbin/devd/devd.cc
/head/sbin/devd/devd.hh
Implement quote escaping. String values may now contain " if you
it is preceded by \.

foo="I \"like\" C++"

gives the value 'I "like" C++' to the variable 'foo'. If a character
other than " follows the \, both the \ and that character are passed
through.

Differential Revision: https://reviews.freebsd.org/D6286
Sponsored by: Netflix
02:33:27 - r315772
(5 hours 40 minutes ago)
by ngie
Affects:  /head/share/man/man5/tmpfs.5
tmpfs(5): fix mdoc warnings

- Delete trailing whitespace
- Sort SEE ALSO order: mmap(2)'s Xr should come before nmount(2)'s Xr.

MFC after: 1 week
Reported by: make manlint
Sponsored by: Dell EMC Isilon
02:30:57 - r315771
(5 hours 42 minutes ago)
by imp
Affects:  /head/lib/libefivar/efivar-dp-parse.c
Fix a coverity-discovered NULL pointer dereference.

*** CID 1372598: Null pointer dereferences (FORWARD_NULL)
/lib/libefivar/efivar-dp-parse.c: 3612 in
UefiDevicePathLibConvertTextToDeviceNode()
  Dereferencing null pointer "FromText".

When ported from Tiano core, I commented this out with an ifdef. That
was in error because we're supposed to fallback to a filepath when
nothing else patches. Instead, restore the original code, but fix
DevPathFromTextFilePath to cope with the conversion to narrow
strings. Also, fix the off-by-one error in the size of the memory it
allocates.

The off by one error is documented in Tiano core bug
https://bugzilla.tianocore.org/show_bug.cgi?id=441

CID: 1372598
Sponsored by: Netflix
02:30:52 - r315770
(5 hours 42 minutes ago)
by imp
Affects:  /head/lib/libefivar/uefi-dplib.h
Define StrCmp in a funky was to be bug-compatible with EDK2 code.

Paper over a coverity issue:

*** CID 1372592: API usage errors (BAD_COMPARE)
/lib/libefivar/efivar-dp-parse.c: 2723 in DevPathFromTextiSCSI()
  Truncating the result of "strcmp" to "unsigned short" may cause it
  to be misinterpreted as 0. Note that "strcmp" may return an integer
  besides -1, 0, or 1.

We do this by making StrCmp return either 0 or 1 for equal or
not-equal. There's a bug in the DevPathFromTextiSCSI cast of the
return value and this workaround will fix it without breaking other
users of StrCmp (all of which test for == 0).

https://bugzilla.tianocore.org/show_bug.cgi?id=440 has been filed
upstream to log this issue.

CID: 1372592
Sponsored by: Netflix
02:29:59 - r315769
(5 hours 43 minutes ago)
by ngie
Affects:  /head/share/man/man5/src.conf.5
Regenerate src.conf(5) (again)

Sponsored by: Dell EMC Isilon
02:26:15 - r315768
(5 hours 47 minutes ago)
by ngie
Affects:  /head/tools/build/options/makeman
Remove the .Pa portion I added to the .An macro in AUTHORS section

That doesn't work (mandoc complains about the macro being empty).

That's what I get for being clever and not verifying before committing
things again *sigh*.

MFC after: 1 month
X-MFC with: r315766
Partyhat to: ngie
Sponsored by: Dell EMC Isilon
02:21:59 - r315767
(5 hours 51 minutes ago)
by ngie
Affects:  /head/share/man/man5/src.conf.5
Regenerate src.conf(5)

Sponsored by: Dell EMC Isilon
02:16:56 - r315766
(5 hours 56 minutes ago)
by ngie
Affects:  /head/tools/build/options/makeman
Note that tools/build/options/makeman automatically generated src.conf(5)

This (as a bonus) fixes mdoc warnings with src.conf(5) :)..

MFC after: 1 month
Sponsored by: Dell EMC Isilon
02:13:59 - r315765
(5 hours 59 minutes ago)
by ngie
Affects:  /head/tools/build/options/WITHOUT_IPSEC_SUPPORT
Fix mdoc(7) warning: new sentences should start on new lines

MFC after: 1 week
X-MFC with: r315764
Sponsored by: Dell EMC Isilon
02:01:25 - r315764
(6 hours 12 minutes ago)
by ngie
Affects:  /head/tools/build/options/WITHOUT_IPSEC_SUPPORT
Add a WITHOUT_IPSEC_SUPPORT option description for src.conf(5)

This is a follow up commit to r313330.

MFC after: 1 week
Sponsored by: Dell EMC Isilon
01:44:17 - r315763
(6 hours 29 minutes ago)
by ngie
Affects:  /head/tools/build/options/WITH_RATELIMIT
Add a WITHOUT_RATELIMIT option description for src.conf(5)

This is a follow up commit for r312379

MFC after: 1 month
X-MFC with: r312379
Sponsored by: Dell EMC Isilon
01:16:26 - r315762
(6 hours 57 minutes ago)
by ngie
Affects:  /head/share/man/man5/rc.conf.5
rc.conf(5): fix a .Xr call for chroot(8)

Add the missing section number to the .Xr call.

MFC after: 1 week
Sponsored by: Dell EMC Isilon
00:56:52 - r315761
(7 hours 16 minutes ago)
by ngie
Affects:  /head/release/doc/en_US.ISO8859-1/hardware/article.xml
Add cxgbe(4), ixl(4), and mlx4en(4) to the hardware release notes

MFC after: 1 week
Reviewed by: gjb
Sponsored by: Dell EMC Isilon
00:41:33 - r315760
(7 hours 32 minutes ago)
by marius
Affects:  /head/sys/arm/nvidia/tegra_sdhci.c
Correct the dependency of mmc(4) on sdhci_tegra(4) after r314887.
2017 - 03 - 22   (yesterday)
23:47:15 - r315759
(8 hours 26 minutes ago)
by gjb
Affects:  /head/release/doc/en_US.ISO8859-1/hardware/article.xml
Add mlx5en(4) to the hardware page. [1]
Belatedly bump copyright years after several changes.

Reported by: rgrimes [1]
Sponsored by: The FreeBSD Foundation
22:49:11 - r315758
(9 hours 24 minutes ago)
by gjb
Affects:  /user/gjb/thermite/README.txt
Add a README.txt explaining the high-level overview of how thermite.sh
and related bits work.

Sponsored by: The FreeBSD Foundation
22:48:16 - r315757
(9 hours 25 minutes ago)
by gjb
Affects: 
(4 files)
/user/gjb/thermite/*
Add extra helper scripts for thermite.sh.

Sponsored by: The FreeBSD Foundation
22:46:03 - r315756
(9 hours 27 minutes ago)
by gjb
Affects: 
(52 files)
/user/gjb/thermite/*
Make the version of the snapshot configuration files public, based
on several inquiries to do so. These cover the head, stable/11, and
stable/10 branches, and all architectures snapshots are produced
therein.

Sponsored by: The FreeBSD Foundation
22:29:14 - r315755
(9 hours 44 minutes ago)
by gjb
Affects:  /head/release/doc/en_US.ISO8859-1/hardware/article.xml
Fix hardware list build after r315742.

Sponsored by: The FreeBSD Foundation
22:28:13 - r315754
(9 hours 45 minutes ago)
by kib
Affects: 
(7 files)
/head/sys/*
Update r315753 with the proper flag name.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
22:23:01 - r315753
(9 hours 50 minutes ago)
by kib
Affects: 
(7 files)
/head/sys/*
Add a flag BI_BRAND_ONLY_STATIC to specify that the brand only
matches static binaries.

Interpretation of the 'static' there is that the binary must not
specify an interpreter. In particular, shared objects are matched by
the brand if BI_CAN_EXEC_DYN is also set.

This improves precision of the brand matching, which should eliminate
surprises due to brand ordering.

Revert r315701.

Discussed with and tested by: ed (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
22:20:47 - r315752
(9 hours 52 minutes ago)
by gjb
Affects:  /user/gjb/thermite/master.conf
Remove a configuration file that will be pulled in with a following
commit.

Sponsored by: The FreeBSD Foundation
22:19:14 - r315751
(9 hours 54 minutes ago)
by gjb
Affects:  /user/gjb/thermite/mk-vmimage.sh
Remove the mk-vmimage.sh script, deprecated by release/Makefile.mirrors.

Sponsored by: The FreeBSD Foundation
22:16:12 - r315750
(9 hours 57 minutes ago)
by gjb
Affects:  /user/gjb/thermite/thermite.sh
Bump the copyright year, forgotten in r315748.

Sponsored by: The FreeBSD Foundation
22:06:48 - r315749
(10 hours 6 minutes ago)
by kib
Affects:  /head/sys/kern/imgact_elf.c
Adjust r314851 to not require every brand to specify interpreter path.

Reported and tested by: ed
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
22:01:53 - r315748
(10 hours 11 minutes ago)
by gjb
Affects:  /user/gjb/thermite/thermite.sh
Update the send_completed_email() output.

Sponsored by: The FreeBSD Foundation
21:59:04 - r315747
(10 hours 14 minutes ago)
by bapt
Affects:  /head/usr.bin/diff/diffreg.c
Use MIN macros from sys/param.h
21:52:22 - r315746
(10 hours 21 minutes ago)
by bapt
Affects:  /head/usr.bin/diff/diff.c
Use strndup(3) instead of malloc + memcpy
21:45:42 - r315745
(10 hours 27 minutes ago)
by dim
Affects:  /head/contrib/libcxxrt/typeinfo.cc
Cherry-pick libcxxrt commit 8a853717e61d5d55cbdf74d9d0a7545da5d5ff92:

Author: David Chisnall <theraven@FreeBSD.org>
Date: Wed Mar 22 12:27:08 2017 +0000

  Simplify some code.

  realloc() with a null pointer is equivalent to malloc, so we don't need
  to handle the two cases independently.

  Fixes #46

This should help with lang/beignet and other programs, which expect
__cxa_demangle(name, NULL, NULL, &status) to return zero in status.

PR: 213732
MFC after: 3 days
21:39:00 - r315744
(10 hours 34 minutes ago)
by ngie
Affects:  /head/share/man/man4/Makefile
Commit Makefiles changes not build manpage for igb(4), accidentally
forgotten in r315742.

X-MFC with: r311849, r315742
Pointyhat to: ngie
Sponsored by: Dell EMC Isilon
21:35:01 - r315743
(10 hours 38 minutes ago)
by bapt
Affects:  /head/usr.bin/diff/diffreg.c
Use MAX and MIN macros from sys/param.h
21:32:44 - r315742
(10 hours 40 minutes ago)
by ngie
Affects:  /head/ObsoleteFiles.inc
/head/share/man/man4/em.4
/head/share/man/man4/igb.4
Merge documentation for em(4) and igb(4)

Document work done by mmacy/sbruno to merge the two drivers together
and convert em(4) to the iflib framework.

X-MFC with: r311849
Sponsored by: Dell EMC Isilon
21:18:18 - r315741
(10 hours 55 minutes ago)
by kp
Affects:  /head/sys/net/pfvar.h
/head/sys/netpfil/pf/pf.c
/head/sys/netpfil/pf/pf_ioctl.c
pf: Fix possible shutdown race

Prevent possible races in the pf_unload() / pf_purge_thread() shutdown
code. Lock the pf_purge_thread() with the new pf_end_lock to prevent
these races.

Use a shared/exclusive lock, as we need to also acquire another sx lock
(VNET_LIST_RLOCK). It's fine for both pf_purge_thread() and pf_unload()
to sleep,

Pointed out by: eri, glebius, jhb
Differential Revision: https://reviews.freebsd.org/D10026
20:51:52 - r315740
(11 hours 21 minutes ago)
by imp
Affects:  /head/lib/libc/gen/getttyent.c
Simplify the code a little.

Submitted by: rppokala
Sponsored by: Netflix
20:06:29 - r315739
(12 hours 7 minutes ago)
by ngie
Affects:  /head/sys/boot/forth/loader.conf
Garbage collect if_igb reference in loader.conf

if_igb was merged with if_em in r311849

X-MFC with: r311849
Sponsored by: Dell EMC Isilon
19:48:09 - r315738
(12 hours 25 minutes ago)
by ngie
Affects:  /head/sys/boot/forth/loader.conf
Document some more 10GbE+ network drivers in loader.conf

- if_cxgbe
- if_ixl
- if_ixlv
- sfxge

MFC after: 1 week
Sponsored by: Dell EMC Isilon
19:23:13 - r315737
(12 hours 50 minutes ago)
by ngie
Affects:  /head/lib/libc/gen/getttyent.c
Unbreak world by adding sys/stat.h for stat(2)

X-MFC with: r315733
Reported by: O. Hartmann <ohartmann@walstatt.org>
Sponsored by: Dell EMC Isilon
19:20:39 - r315736
(12 hours 53 minutes ago)
by ed
Affects: 
(4 files)
/head/sys/compat/cloudabi/*
/head/sys/compat/cloudabi32/cloudabi32_sock.c
/head/sys/compat/cloudabi64/cloudabi64_sock.c
Make file descriptor passing for CloudABI's recvmsg() work.

Similar to the change for sendmsg(), create a pointer size independent
implementation of recvmsg() and let cloudabi32 and cloudabi64 call into
it. In case userspace requests one or more file descriptors, call
kern_recvit() in such a way that we get the control message headers in
an mbuf. Iterate over all of the headers and copy the file descriptors
to userspace.
19:18:47 - r315735
(12 hours 54 minutes ago)
by imp
Affects:  /head/sys/cam/cam_iosched.c
Implement moving SD.

From the paper "Incremental calculation of weighted mean and variance"
by Tony Finch Februrary 2009, retrieved from
http://people.ds.cam.ac.uk/fanf2/hermes/doc/antiforgery/stats.pdf
converted to use shifting.
19:17:13 - r315734
(12 hours 56 minutes ago)
by ngie
Affects:  /head/lib/libc/gen/getttyent.c
style(9): sort #includes

MFC after: 1 week
Sponsored by: Dell EMC Isilon
19:00:41 - r315733
(13 hours 12 minutes ago)
by imp
Affects:  /head/include/ttyent.h
/head/lib/libc/gen/getttyent.c
/head/libexec/getty/ttys.5
Impelemnt ttys onifexists in init.

Implement a new init(8) option in /etc/ttys. If this option is present
on the entry in /etc/ttys, the entry will be active if and only if it
exists. If the name starts with a '/', it will be considered an
absolute path. If not, it will be a path relative to /dev.

This allows one to turn off video console getty that aren't present
(while running a getty on them even when they aren't the system
console). Likewise with serial ports.

It differs from onifconsole in only requiring the device exist rather
than it be listed as one of the system consoles.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D10037
18:45:13 - r315732
(13 hours 28 minutes ago)
by ed
Affects:  /head/sys/sys/imgact_elf.h
Add forward declaration for struct vnode.

The coredump() function provided by this header file has struct vnode *
as an argument.

MFC after: 1 week
18:35:48 - r315731
(13 hours 37 minutes ago)
by bdrewery
Affects: 
(3 files)
/stable/10/Makefile.inc1
/stable/10/lib/libmd/Makefile
MFC r314709,r314790,r314794:

  r314709:
  Fix bootstrapping mtree after r313404 for older systems.
  r314790:
  Added comments for why nmtree/libmd are bootstrapped.
  r314794:
  Fix bootstrapping libmd on older systems after r314709.

PR: 217673
18:33:50 - r315730
(13 hours 39 minutes ago)
by bdrewery
Affects:  /stable/10/sys/sys/param.h
Bump __FreeBSD_version for libmd changes in r314143.
18:33:29 - r315729
(13 hours 40 minutes ago)
by markj
Affects:  /head/lib/libproc/proc_create.c
Add initializations missed in r315728.

X-MFC With: r315728
18:31:44 - r315728
(13 hours 41 minutes ago)
by markj
Affects:  /head/lib/libproc/proc_create.c
Avoid accessing an uninitialized variable when vfork() fails.

Reported by: Miles Ohlrich <miles.ohlrich@isilon.com>
MFC after: 1 week
Sponsored by: Dell EMC Isilon
18:14:55 - r315727
(13 hours 58 minutes ago)
by markj
Affects:  /head/lib/librtld_db/rtld_db.c
Avoid double-closing an fd if elf_begin() fails.

Reported by: Miles Ohlrich <miles.ohlrich@isilon.com>
MFC after: 1 week
Sponsored by: Dell EMC Isilon
18:13:14 - r315726
(14 hours ago)
by ngie
Affects:  /head/usr.bin/diff/diff.1
diff(1): fix SYNOPSIS section noting non-existent option, --no-ignore-case

`--no-ignore-case` should be `--no-ignore-file-name-case` per code for
compatibility with [g]diff(1).

Sponsored by: Dell EMC Isilon
18:12:48 - r315725
(14 hours ago)
by pfg
Affects: 
(2 files)
/stable/11/lib/libc/gen/scandir.c
MFC r315720 (from cem@)
scandir: Fix NULL dereference, uninitialized value use in error case

This bug was introduced in r315095. Given that it obviously is a bug and
we can't afford to have such creatures in libc, do an early merge,

Reported by: Coverity
CIDs: 1329566, 1372625
Sponsored by: Dell EMC Isilon
17:56:46 - r315724
(14 hours 16 minutes ago)
by bdrewery
Affects: 
(3 files)
/stable/11/Makefile.inc1
/stable/11/lib/libmd/Makefile
MFC r314709,r314790,r314794:

  r314709:
  Fix bootstrapping mtree after r313404 for older systems.
  r314790:
  Added comments for why nmtree/libmd are bootstrapped.
  r314794:
  Fix bootstrapping libmd on older systems after r314709.

PR: 217673
17:53:25 - r315723
(14 hours 20 minutes ago)
by bdrewery
Affects: 
(14 files)
/stable/11/*
MFC r314886,r314943,r314944:

  r314886:
  pwait: Add a -t flag to specify a timeout before exiting, and tests.
  r314943:
  Remove unneeded -x from tests.
  r314944:
  Rename some tests to end in _test.
17:49:56 - r315722
(14 hours 23 minutes ago)
by bdrewery
Affects: 
(2 files)
/stable/10/bin/kill/kill.c
MFC r314714:

  Don't kill pid -1 on overflow from strtol(3).
17:46:08 - r315721
(14 hours 27 minutes ago)
by bdrewery
Affects: 
(2 files)
/stable/11/bin/kill/kill.c
MFC r314714:

  Don't kill pid -1 on overflow from strtol(3).
17:37:47 - r315720
(14 hours 35 minutes ago)
by cem
Affects:  /head/lib/libc/gen/scandir.c
scandir: Fix NULL dereference, uninitialized value use in error case

If opendir succeeds but malloc fails, numitems was used uninitialized in
error handling under the 'fail' label. If it happened to have a non-zero
value, the NULL 'names' was dereferenced.

Reported by: Coverity
CIDs: 1329566, 1372625
Sponsored by: Dell EMC Isilon
17:33:57 - r315719
(14 hours 39 minutes ago)
by markj
Affects:  /head/sys/compat/linuxkpi/common/include/asm/atomic.h
Extend cmpxchg() to support 8- and 16-bit values, and add xchg().

These are needed to support updated revisions of the DRM code.

Reviewed by: hselasky (previous version)
MFC after: 2 weeks
17:29:04 - r315718
(14 hours 44 minutes ago)
by markj
Affects:  /head/share/man/man9/atomic.9
/head/sys/amd64/include/atomic.h
/head/sys/i386/include/atomic.h
Add support for 8- and 16-bit atomic_(f)cmpset to x86.

Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10068
17:28:53 - r315717
(14 hours 44 minutes ago)
by ngie
Affects:  /head/usr.sbin/ctm/ctm/ctm_pass1.c
ctm: fix memory leaks in Pass1(..)

Call `Delete(..)` (a free(3) wrapper) on `name` when bailing from the
function.

Submitted by: Tom Rix <trix@juniper.net>
Reviewed by: ngie
Differential Revision: D10097
Sponsored by: Dell EMC Isilon, Juniper
17:06:57 - r315716
(15 hours 6 minutes ago)
by grehan
Affects:  /head/sys/dev/usb/input/ums.c
Bring the handling of the y axis in the ums driver in-line with the other
axes.

No functional change.

Submitted by: Vicki Pfau (vi AT endrift.com)
Approved by: hps
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9595
16:53:03 - r315715
(15 hours 20 minutes ago)
by grehan
Affects:  /head/usr.sbin/bhyve/usb_mouse.c
This fixes a typo in bhyve's USB mouse emulation.
There is no behavioral difference, as it's just swapping
out the name of two identically-valued constants.

Submitted by: Vicki Pfau (vi AT endrift.com)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9597
15:46:31 - r315714
(16 hours 27 minutes ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/net/ip.h
/head/sys/ofed/drivers/infiniband/core/cma.c
Add full VNET support to the inet_get_local_port_range() function in
the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies
15:44:00 - r315713
(16 hours 29 minutes ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/in.h
/head/sys/compat/linuxkpi/common/include/net/ipv6.h
Add support for more IPv4 and IPv6 related macros in the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies
14:30:02 - r315712
(17 hours 43 minutes ago)
by andrew
Affects: 
(6 files)
/head/sys/arm/arm/*
/head/sys/arm/include/*
/head/sys/conf/files.arm
Add the early hypervisor code needed on 32-bit ARMv7. This will be used
when we bring in bhyve support.

Submitted by: Mihai Carabas <mihai.carabas AT gmail.com>
Differential Revision: https://reviews.freebsd.org/D10045
13:53:21 - r315711
(18 hours 20 minutes ago)
by mav
Affects:  /head/sbin/camcontrol/camcontrol.c
Fix printing bits above first eight.

Reported by: Coverity
CID: 1372596
MFC after: 1 week
13:16:04 - r315710
(18 hours 57 minutes ago)
by des
Affects:  /head/lib/libpam/modules/pam_exec/pam_exec.8
/head/lib/libpam/modules/pam_exec/pam_exec.c
Add options to capture stdout and / or stderr and pass the output on
to the user. There is currently no buffering, so the result may be
somewhat unpredictable if the conversation function adds a newline,
like openpam_ttyconv() does.

Clean up and simplify the environment handling code, which triggered
an inexplicable bug on some systems.

MFC after: 2 weeks
11:06:33 - r315709
(21 hours 7 minutes ago)
by mav
Affects:  /head/sys/dev/isp/isp_freebsd.c
Switch from using periph_links to sim_links.

periph_links field belongs to periph drivers and must not be used here.

MFC after: 2 weeks
08:56:03 - r315708
(23 hours 17 minutes ago)
by mav
Affects: 
(4 files)
/head/sys/dev/isp/*
Cleanup response queue processing.

MFC after: 2 weeks
08:55:32 - r315707
(23 hours 18 minutes ago)
by pho
Affects:  /user/pho/stress2/misc/sndstat.sh
Just ignore this test if /dev/sndstat is not found.

Sponsored by: Dell EMC Isilon
08:54:02 - r315706
(23 hours 19 minutes ago)
by pho
Affects:  /user/pho/stress2/misc/pty.sh
/user/pho/stress2/misc/pty2.sh
Just ignore test if "kldload pty" fails.

Sponsored by: Dell EMC Isilon
07:54:29 - r315705
(1 day ago)
by mav
Affects: 
(2 files)
/stable/10/sys/geom/geom_dev.c
MFC r314908: When chunking large DIOCGDELETE, do it on stripe edge.
07:53:57 - r315704
(1 day ago)
by mav
Affects: 
(2 files)
/stable/11/sys/geom/geom_dev.c
MFC r314908: When chunking large DIOCGDELETE, do it on stripe edge.
07:52:25 - r315703
(1 day ago)
by mav
Affects: 
(2 files)
/stable/11/sys/cam/scsi/scsi_da.c
MFC r314906: Add initial support for UNMAP granularity.

Report UNMAP granularity as stripesize/-offset if we have no other values
to report there.

Add new quirk DA_Q_STRICT_UNMAP for cases when target is too critical to
misaligned UNMAP request, reporting errors instead of being suboptimal.
Setting this quirk makes da periph to forcefully align all UNMAP requests
to avoid those errors by the cost of some odd ranges not being UNMAP'ed.
This makes UNMAP usable within VMware 6.x VMs, just now 100% efficient.
07:09:30 - r315702
(1 day 1 hour ago)
by dim
Affects:  /stable/11/contrib/libc++/include/utility
Pull in r283944 from upstream libc++ trunk (by Eric Fiselier):

  Fix std::pair on FreeBSD

  Summary:
  FreeBSD ships an old ABI for std::pair which requires that it have
  non-trivial copy/move constructors. Currently the non-trivial
  copy/move is achieved by providing explicit definitions of the
  constructors. This is problematic because it means the constructors
  don't SFINAE properly. In order to SFINAE copy/move constructors they
  have to be explicitly defaulted and hense non-trivial.

  This patch attempts to provide SFINAE'ing copy/move constructors for
  std::pair while still making them non-trivial. It does this by adding
  a base class with a non-trivial copy constructor and then allowing
  pair's constructors to be generated by the compiler. This also allows
  the constructors to be constexpr.

  Reviewers: emaste, theraven, rsmith, dim

  Subscribers: cfe-commits

  Differential Revision: https://reviews.llvm.org/D25389

This should fix building www/chromium 57.0.2987.110 on stable/11,
without further hacks. Direct commit to stable/11, since head already
has libc++ 4.0, which includes this fix.

Reported by: cpm
07:05:27 - r315701
(1 day 1 hour ago)
by ed
Affects: 
(5 files)
/head/sys/*
Set the interpreter path to /nonexistent.

CloudABI executables are statically linked and don't have an
interpreter. Setting the interpreter path to NULL used to work
previously, but r314851 introduced code that checks the string
unconditionally. Running CloudABI executables now causes a null pointer
dereference.

Looking at the rest of imgact_elf.c, it seems various other codepaths
already leaned on the fact that the interpreter path is set. Let's just
go ahead and pick an obviously incorrect interpreter path to appease
imgact_elf.c.

MFC after: 1 week
06:43:10 - r315700
(1 day 1 hour ago)
by ed
Affects: 
(4 files)
/head/sys/compat/cloudabi/*
/head/sys/compat/cloudabi32/cloudabi32_sock.c
/head/sys/compat/cloudabi64/cloudabi64_sock.c
Make file descriptor passing work for CloudABI's sendmsg().

Reduce the potential amount of code duplication between cloudabi32 and
cloudabi64 by creating a cloudabi_sock_recv() utility function. The
cloudabi32 and cloudabi64 modules will then only contain code to convert
the iovecs to the native pointer size.

In cloudabi_sock_recv(), we can now construct an SCM_RIGHTS cmsghdr in
an mbuf and pass that on to kern_sendit().
05:27:20 - r315699
(1 day 2 hours ago)
by ngie
Affects:  /head/sys/kern/kern_sysctl.c
Print out name of non-dynamic sysctl in sysctl_remove_oid_locked

This will provide a slightly better smoking gun than just stating
"can't remove non-dynamic nodes!" when calling sysctl_ctx_free(9)
and sysctl_remove_{name,oid}(9) with a non-dynamic (likely
static) sysctl.

MFC after: 1 week
Sponsored by: Dell EMC Isilon
02:44:39 - r315698
(1 day 5 hours ago)
by ngie
Affects:  /head/lib/libkvm/Makefile
libkvm: bump WARNS to 6 after recent commits done to resolve warnings issues

MFC after: 1 month
Tested with: make tinderbox; clang 4.0.0 (amd64), gcc 4.2.1/6.3.0 (amd64)
Sponsored by: Dell EMC Isilon
02:42:00 - r315697
(1 day 5 hours ago)
by ngie
Affects: 
(11 files)
/head/lib/libkvm/*
libkvm: fix warning issues post-r291406

- Fix -Wunused warnings with *_native detection handlers by marking `kd`
  __unused, except with arm/mips, where a slightly more complicated scheme
  is required to handle the native case vs the non-native case.
- Fix -Wmissing-variable-declarations warnings by marking struct kvm_arch
  objects static.

Differential Revision: D10071
MFC after: 1 week
Reviewed by: vangyzen
Tested with: WIP test code (D10024) // kgdb7121 (i386 crash/kernel on amd64)
Sponsored by: Dell EMC Isilon
01:11:13 - r315696
(1 day 7 hours ago)
by ngie
Affects: 
(5 files)
/stable/10/etc/mtree/BSD.tests.dist
/stable/10/lib/libcam/Makefile
/stable/10/lib/libcam/tests/Makefile
MFC r315320:

Start adding basic tests for cam(3)

This change contains several negative and positive tests for:
- cam_open_device
- cam_close_device
- cam_getccb
- cam_freeccb

This also contains a test for the failure case noted in bug 217649,
i.e., O_RDWR must be specified because pass(4) requires it.

This test unfortunately cannot assume that cam-capable devices are
present, so the user must explicitly provide a device via
`test_suites.FreeBSD.cam_test_device`. In the future, a test kernel
module might be shipped, or ctl(4) might be used, as a test device
when testing out libcam, which will allow the tests to do away with
having to specify an explicit test device.
01:04:20 - r315695
(1 day 7 hours ago)
by ngie
Affects: 
(4 files)
/stable/11/etc/mtree/BSD.tests.dist
/stable/11/lib/libcam/Makefile
/stable/11/lib/libcam/tests
MFC r315320:

Start adding basic tests for cam(3)

This change contains several negative and positive tests for:
- cam_open_device
- cam_close_device
- cam_getccb
- cam_freeccb

This also contains a test for the failure case noted in bug 217649,
i.e., O_RDWR must be specified because pass(4) requires it.

This test unfortunately cannot assume that cam-capable devices are
present, so the user must explicitly provide a device via
`test_suites.FreeBSD.cam_test_device`. In the future, a test kernel
module might be shipped, or ctl(4) might be used, as a test device
when testing out libcam, which will allow the tests to do away with
having to specify an explicit test device.
00:50:36 - r315694
(1 day 7 hours ago)
by vangyzen
Affects:  /head/lib/libc/sys/clock_gettime.2
clock_gettime.2: add some clock IDs

Add the CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID clock_id
values to the clock_gettime(2) man page. Reformat the excessively
long paragraph (sentence!) into a tag list.

Reported by: jilles in https://reviews.freebsd.org/D10020
MFC after: 3 days
Sponsored by: Dell EMC
2017 - 03 - 21   (2 days ago)
22:41:37 - r315693
(1 day 9 hours ago)
by cem
Affects:  /head/sys/kern/kern_fail.c
kern_fail: Allow sleeping for more than 2147483/hz seconds

Because of integer types, the timeout calculation result was limited to
INT_MAX / (1000 * hz) seconds. For systems with hz=10000, this is only 215
seconds. Perform the calculation with 64-bit math to allow sleeping for the
full INT_MAX / hz interval (215000 seconds on such hz=10000 systems).

Submitted by: Scott Ferris <sferris at isilon.com>
Sponsored by: Dell EMC Isilon
22:21:29 - r315692
(1 day 9 hours ago)
by ian
Affects:  /head/tools/test/ppsapi/ppsapitest.c
Eliminate a "format string is not a string literal" warning.
22:09:00 - r315691
(1 day 10 hours ago)
by bdrewery
Affects:  /head/Makefile.inc1
Rename _cc to _gcc to be more clear.

MFC after: 1 week
Sponsored by: Dell EMC Isilon
22:00:52 - r315690
(1 day 10 hours ago)
by ngie
Affects:  /head/sbin/route/route.c
Delete trailing whitespace (no functional change)

MFC after: 3 days
Sponsored by: Dell EMC Isilon
21:07:37 - r315689
(1 day 11 hours ago)
by dim
Affects:  /head/lib/libcompiler_rt/Makefile
Gcc has incompatible internal declarations for __divtc3 and __multc3 as
defined in compiler-rt, but it has no option to silence its warning, so
make gcc warnings for libcompiler_rt non-fatal.

Noticed by: lwhsu
MFC after: 3 days
20:48:36 - r315688
(1 day 11 hours ago)
by ngie
Affects:  /head/lib/libkvm/kvm.c
kvm_write: fix -Wcast-qual warning in pointer arithmetic argument

Cast buf to `const char *` when doing arithmetic operation to match
`cp`'s type [1].

Differential Revision: D10082
MFC after: 1 week
Reviewed by: cem (earlier diff), vangyzen
Submitted by: cem [1]
Sponsored by: Dell EMC Isilon
19:10:07 - r315687
(1 day 13 hours ago)
by ngie
Affects:  /head/lib/libutil/hexdump.3
Document sbuf_hexdump(9) in just sbuf(9)

- Remove duplicate references to sbuf_hexdump(9) from hexdump(3).
  sbuf_hexdump(9) already pointed back to hexdump(3) for implementation
  details.
- Refer to sbuf_hexdump(9) instead of sbuf(9) for completeness

MFC after: 1 week
Reviewed by: vangyzen (earlier diff)
Sponsored by: Dell EMC Isilon
Differential Revision: D9912
19:02:17 - r315686
(1 day 13 hours ago)
by ngie
Affects:  /head/lib/libkvm/kvm.c
/head/lib/libkvm/kvm_geterr.3
kvm_geterr: handle `kd` == NULL in a deterministic/graceful manner

Return a NUL string instead of just working by accident with kvm_geterr(3)
when MALLOC_PRODUCTION is disabled (I didn't confirm the MALLOC_PRODUCTION
being enabled path).

Document the new explicit return behavior for kvm_geterr(3), as well
as the previous implicit behavior, i.e., the buffer attached to
returned via kvm_geterr(3) would be empty if a previous error hadn't been
stored in `kd`.

Differential Revision: D10022
MFC after: 1 week
Reviewed by: vangyzen
Sponsored by: Dell EMC Isilon
18:02:14 - r315685
(1 day 14 hours ago)
by emaste
Affects:  /head/sys/kern/imgact_binmisc.c
tighten buffer bounds in imgact_binmisc_populate_interp

We must ensure there's space for the terminating null in the temporary
buffer in imgact_binmisc_populate_interp().

Note that there's no buffer overflow here because xbe->xbe_interpreter's
length and null termination is checked in imgact_binmisc_add_entry()
before imgact_binmisc_populate_interp() is called. However, the latter
should correctly enforce its own bounds.

Reviewed by: sbruno
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10042
16:23:44 - r315684
(1 day 15 hours ago)
by glebius
Affects:  /head/sys/netinet/in_pcb.h
Force same alignment on struct xinpgen as we have on struct xinpcb. This
fixes 32-bit builds.
14:14:11 - r315683
(1 day 17 hours ago)
by mav
Affects:  /head/sys/dev/isp/isp_pci.c
/head/sys/dev/isp/isp_sbus.c
Remove another remnants left after r246713.

MFC after: 2 weeks
13:49:43 - r315682
(1 day 18 hours ago)
by mav
Affects:  /head/sys/dev/isp/isp_pci.c
/head/sys/dev/isp/isp_sbus.c
Remove some dead code left after r246713.

MFC after: 2 weeks
13:10:37 - r315681
(1 day 19 hours ago)
by mav
Affects: 
(4 files)
/head/sys/dev/isp/*
Improve command timeout handling.

Let firmware do its best first, and if it can't, try software recovery.
I would remove software timeout handler completely, but found bunch of
complains on command timeout on sparc64 mailing list few years ago, so
better be safe in case of interrupt loss.

MFC after: 2 weeks
13:01:08 - r315680
(1 day 19 hours ago)
by maxim
Affects:  /head/sbin/ifconfig/ifconfig.8
The .Cm macro usage fixed.

PR: 217977
Submitted by: tobik
11:56:21 - r315679
(1 day 20 hours ago)
by des
Affects:  /user/des/sizes/Makefile
/user/des/sizes/sizes.c
Add max_align_t if available.
Add intN_t just for s & g.
Use <bsd.prog.mk>.
11:26:31 - r315678
(1 day 20 hours ago)
by mav
Affects:  /head/sys/dev/isp/isp.c
Remove questionable reqp->req_time access.

MFC after: 2 weeks
10:34:34 - r315677
(1 day 21 hours ago)
by mav
Affects: 
(4 files)
/head/sys/dev/isp/*
Clean/unify some macro usage.

MFC after: 2 weeks
09:38:59 - r315676
(1 day 22 hours ago)
by royger
Affects: 
(6 files)
/stable/10/sys/dev/xen/*
/stable/10/sys/xen/xen-os.h
/stable/10/sys/xen/xenbus/xenbusb.c
MFC r314840:

xen: add support for canceled suspend

Submitted by: Liuyingdong <liuyingdong@huawei.com>
Reviewed by: royger
09:27:24 - r315675
(1 day 22 hours ago)
by royger
Affects: 
(4 files)
/stable/10/sys/dev/xen/control/control.c
/stable/10/sys/xen/xenstore/xenstore.c
/stable/10/sys/xen/xenstore/xenstorevar.h
MFC r314841:

xenstore: fix suspension when using the xenstore device

Submitted by: Liuyingdong <liuyingdong@huawei.com>
Reviewed by: royger
09:24:07 - r315674
(1 day 22 hours ago)
by mav
Affects:  /head/sys/cam/cam_xpt.c
Minor cosmetic addition to r315673.

Now CAM_SIM_LOCK() macros are not used and may be removed later.

MFC after: 2 weeks
09:12:41 - r315673
(1 day 23 hours ago)
by mav
Affects:  /head/sys/cam/cam_sim.c
/head/sys/cam/cam_xpt.c
/head/sys/sys/param.h
Make CAM SIM lock optional.

For three years now CAM does not use SIM lock, but still enforces SIM to
use it. Remove this requirement, allowing SIMs to have any locking they
prefer, if they pass no mutex to cam_sim_alloc().

MFC after: 2 weeks
09:07:05 - r315672
(1 day 23 hours ago)
by glebius
Affects:  /head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c
Make sdp compilable after r315662.
08:57:20 - r315671
(1 day 23 hours ago)
by glebius
Affects:  /head/usr.bin/sockstat/sockstat.c
Shut up gcc.
08:56:13 - r315670
(1 day 23 hours ago)
by mav
Affects:  /head/sys/dev/isp/isp_pci.c
Addition to r315579: drop the lock while allocating IRQs.

MFC after: 12 days
08:39:36 - r315669
(1 day 23 hours ago)
by pho
Affects:  /user/pho/stress2/lib/resources.c
Missed to remove a break from the loop.

Sponsored by: Dell EMC Isilon
08:38:12 - r315668
(1 day 23 hours ago)
by royger
Affects: 
(6 files)
/stable/11/sys/dev/xen/*
/stable/11/sys/xen/xen-os.h
/stable/11/sys/xen/xenbus/xenbusb.c
MFC r314840:

xen: add support for canceled suspend

Submitted by: Liuyingdong <liuyingdong@huawei.com>
Reviewed by: royger
08:36:25 - r315667
(1 day 23 hours ago)
by royger
Affects: 
(4 files)
/stable/11/sys/dev/xen/control/control.c
/stable/11/sys/dev/xen/xenstore/xenstore.c
/stable/11/sys/xen/xenstore/xenstorevar.h
MFC r314841:

xenstore: fix suspension when using the xenstore device

Submitted by: Liuyingdong <liuyingdong@huawei.com>
Reviewed by: royger
08:34:41 - r315666
(1 day 23 hours ago)
by royger
Affects: 
(2 files)
/stable/11/sys/dev/xen/timer/timer.c
MFC r314094:

xen/timer: mark the Xen PV timer as not safe for suspension

Submitted by: Liuyingdong <liuyingdong@huawei.com>
Reviewed by: royger
08:30:06 - r315665
(1 day 23 hours ago)
by royger
Affects: 
(2 files)
/stable/11/sys/dev/xen/netfront/netfront.c
MFC r314842:

xen/netfront: fix inbound packet flags for checksum offload

Reviewed by: Wei Liu <wei.liu2@citrix.com>
Sponsored by: Citrix Systems R&D
08:24:40 - r315664
(1 day 23 hours ago)
by pho
Affects:  /user/pho/stress2/lib/resources.c
Limit number of retries.

Sponsored by: Dell EMC Isilon
08:23:44 - r315663
(1 day 23 hours ago)
by pho
Affects:  /user/pho/stress2/lib/main.c
Change exit status to indicate test program failures.

Sponsored by: Dell EMC Isilon
06:39:49 - r315662
(2 days 1 hour ago)
by glebius
Affects: 
(22 files)
/head/*
Hide struct inpcb, struct tcpcb from the userland.

This is a painful change, but it is needed. On the one hand, we avoid
modifying them, and this slows down some ideas, on the other hand we still
eventually modify them and tools like netstat(1) never work on next version of
FreeBSD. We maintain a ton of spares in them, and we already got some ifdef
hell at the end of tcpcb.

Details:
- Hide struct inpcb, struct tcpcb under _KERNEL || _WANT_FOO.
- Make struct xinpcb, struct xtcpcb pure API structures, not including
  kernel structures inpcb and tcpcb inside. Export into these structures
  the fields from inpcb and tcpcb that are known to be used, and put there
  a ton of spare space.
- Make kernel and userland utilities compilable after these changes.
- Bump __FreeBSD_version.

Reviewed by: rrs, gnn
Differential Revision: D10018
05:15:10 - r315661
(2 days 2 hours ago)
by ngie
Affects: 
(2 files)
/stable/10/tools/build/mk/OptionalObsoleteFiles.inc
MFC r314241,r315228:

r314241:

Fill in MK_RESCUE by finding paths in ${DESTDIR}/rescue and adding
them to OLD_FILES/OLD_DIRS, as necessary.

r315228:

Redirect standard error from find /rescue to /dev/null

This mutes noise from find when /rescue doesn't exist.
05:13:14 - r315660
(2 days 3 hours ago)
by ngie
Affects: 
(2 files)
/stable/11/tools/build/mk/OptionalObsoleteFiles.inc
MFC r314241,r315228:

r314241:

Fill in MK_RESCUE by finding paths in ${DESTDIR}/rescue and adding
them to OLD_FILES/OLD_DIRS, as necessary.

r315228:

Redirect standard error from find /rescue to /dev/null

This mutes noise from find when /rescue doesn't exist.
03:42:28 - r315659
(2 days 4 hours ago)
by pfg
Affects: 
(2 files)
/stable/11/usr.sbin/lpr/common_source/common.c
MFC r314877:
lpr(1): small bounds check with reallocarray(3).

While here plug a memory leak upon error and postpose the multiplication
until after reallocation has succeded.

Hinted partially by: OpenBSD
Reviewed by: gad
01:24:56 - r315658
(2 days 6 hours ago)
by vangyzen
Affects: 
(4 files)
/stable/10/sys/compat/freebsd32/freebsd32_misc.c
/stable/10/sys/compat/linux/linux_time.c
/stable/10/sys/kern/kern_time.c
MFC r315510

nanosleep: plug a kernel memory disclosure

nanosleep() updates rmtp on EINVAL. In that case, kern_nanosleep()
has not updated rmt, so sys_nanosleep() updates the user-space rmtp
by copying garbage from its stack frame. This is not only a kernel
memory disclosure, it's also not POSIX-compliant. Fix it to update
rmtp only on EINTR.

Security: possibly
Sponsored by: Dell EMC
01:23:34 - r315657
(2 days 6 hours ago)
by vangyzen
Affects: 
(4 files)
/stable/11/sys/compat/freebsd32/freebsd32_misc.c
/stable/11/sys/compat/linux/linux_time.c
/stable/11/sys/kern/kern_time.c
MFC r315510

nanosleep: plug a kernel memory disclosure

nanosleep() updates rmtp on EINVAL. In that case, kern_nanosleep()
has not updated rmt, so sys_nanosleep() updates the user-space rmtp
by copying garbage from its stack frame. This is not only a kernel
memory disclosure, it's also not POSIX-compliant. Fix it to update
rmtp only on EINTR.

Security: possibly
Sponsored by: Dell EMC
2017 - 03 - 20   (3 days ago)
23:07:34 - r315656
(2 days 9 hours ago)
by asomers
Affects:  /head/tests/sys/netinet/fibs_test.sh
Fix back-to-back runs of sys/netinet/fibs_test;slaac_on_nondefault_fib6

This test was failing if run twice because rtadvd takes too long to die.
The rtadvd process from the first run was still running when the
second run created its interfaces. The solution is to use SIGKILL during
the cleanup instead of SIGTERM so rtadvd will die faster.

While I'm here, randomize the addresses used for the test, which makes bugs
like this easier to spot, and fix the cleanup order to be the opposite of
the setup order

PR: 217871
MFC after: 18 days
X-MFC-With: 315458
Sponsored by: Spectra Logic Corp
22:36:28 - r315655
(2 days 9 hours ago)
by gad
Affects:  /head/usr.sbin/lpr/chkprintcap/chkprintcap.c
/head/usr.sbin/lpr/chkprintcap/skimprintcap.c
Fixes to chkprintcap:
- Check the return from a call to malloc() in skim_printcap(), and
  return a NULL if that fails.
- Fix a small memory leak in main() that happens if skim_printcap()
  returns an error, including the new error-return of NULL.

Submitted by: Tom Rix <trix@juniper.net>
Reviewed by: pfg, ngie
MFC after: 4 weeks
Sponsored by: Dell EMC Isilon, Juniper
Differential Revision: D9954, D9982
22:33:22 - r315654
(2 days 9 hours ago)
by ngie
Affects:  /head/rescue/rescue/Makefile
Fix linking /rescue/rescue to multiple programs in usr.bin after r315113

I meant for the line that conditionally added in /usr/bin/nc support to
be `+=', not `=`. This restores hardlinks for all programs in usr.bin
specified before nc(1), e.g., bunzip2 and tar.

Reported by: Andrzej Tobola <ato@iem.pw.edu.pl>
Submitted by: Scott Allendorf <scott-allendorf@uiowa.edu>
Pointyhat to: ngie
MFC after: 3 days
Sponsored by: Dell EMC Isilon
22:20:17 - r315653
(2 days 9 hours ago)
by tsoome
Affects:  /head/lib/libstand/bootp.c
/head/sys/boot/common/dev_net.c
/head/sys/boot/i386/libi386/pxe.c
loader: verify the value from dhcp.interface-mtu and use snprintf to set mtu

Since the uset can set dhcp.interface-mtu, we need to try to validate the
value. So we verify if the conversion to int is successful and we will not
allow to set value greater than max IPv4 packet size.

Also use snprintf for safety.

Reviewed by: allanjude, bapt
Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D8492
20:44:14 - r315652
(2 days 11 hours ago)
by mav
Affects:  /head/sys/dev/isp/isp_freebsd.c
/head/sys/dev/isp/isp_freebsd.h
/head/sys/dev/isp/ispvar.h
Remove some more dead code.

MFC after: 2 weeks
19:27:35 - r315651
(2 days 12 hours ago)
by landonf
Affects:  /head/sys/dev/bhnd/cores/chipc/chipcreg.h
/head/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.c
/head/sys/dev/bhnd/cores/pmu/bhnd_pmureg.h
Integrate BCM4706 PMU (rev6) support, derived from the ISC-licensed Broadcom
sbchipc.h and hndpmu.c sources included in the RT-N16 and later firmware
source drops.

Approved by: adrian (mentor, implicit)
19:25:42 - r315650
(2 days 12 hours ago)
by andrew
Affects:  /head/sys/arm/freescale/imx/imx_gpt.c
Use tc_priv to find the softc in the i.MX timer driver.

Sponsored by: ABT Systems Ltd
19:24:16 - r315649
(2 days 12 hours ago)
by bapt
Affects:  /head/usr.bin/diff/diffreg.c
Cache tzdata when running under capsicum

PR: 217957
Reported by: tobik@
19:16:28 - r315648
(2 days 12 hours ago)
by tsoome
Affects:  /head/lib/libstand/nfs.c
libstand: verify value provided by nfs.read_size

Implement simple value check and feedback.

Reviewed by: allanjude, rpokala
Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D8491
18:28:22 - r315647
(2 days 13 hours ago)
by ngie
Affects:  /head/lib/libkvm/kvm.c
/head/lib/libkvm/kvm_open.3
Handle kd == NULL gracefully with kvm_close(3)

Don't segfault in kvm_close(3) if provided a NULL pointer. Instead, return
-1 and set errno to EINVAL.

Document this new behavior explicitly.

MFC after: 1 week
Reviewed by: vangyzen
Sponsored by: Dell EMC Isilon
Differential Revision: D10065
18:15:36 - r315646
(2 days 13 hours ago)
by tsoome
Affects:  /head/sys/boot/i386/libi386/pxe.h
loader: pxe.h constants have wrong values

FLTR_PRMSCS should be 0x4 and FLTR_SRC_RTG should be 0x8

PXE Specification 2.1 PXENV_UNDI_OPEN, page 59.

http://download.intel.com/design/archives/wfm/downloads/pxespec.pdf

Reviewed by: allanjude
Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D10056
18:03:40 - r315645
(2 days 14 hours ago)
by tsoome
Affects:  /head/sys/boot/userboot/userboot/userboot_disk.c
loader: disk_cleanup was left in userboot_disk.c

In r315408, disk_cleanup was removed, which is called at
sys/boot/userboot/userboot/userboot_disk.c:113.
This causes bhyveload to fail.

PR: 217935
Reported by: Fabian Freyer
Reviewed by: allanjude
Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D10060
17:57:24 - r315644
(2 days 14 hours ago)
by hrs
Affects:  /head/usr.sbin/inetd/inetd.c
Simplify a pipe for signal handling.
17:46:33 - r315643
(2 days 14 hours ago)
by hrs
Affects:  /head/usr.sbin/syslogd/syslogd.c
Fix a regression which prevented an IPv6 address in a -b option from
working.

PR: 217939
Differential Revision: https://reviews.freebsd.org/D10064
17:26:13 - r315642
(2 days 14 hours ago)
by ngie
Affects:  /head/contrib/bsnmp/lib/snmpclient.c
bsnmp: explicitly test the return value for open_client_{local,udp} in
snmp_open(..)

open_client_* returns -1 on failure; 0 on success. Ensure that the return value
is
0 -- otherwise exit snmp_open(..).

MFC after: 1 week
Sponsored by: Dell EMC Isilon
17:17:54 - r315641
(2 days 14 hours ago)
by ngie
Affects:  /head/contrib/bsnmp/lib/snmpclient.c
bsnmp: don't leak snmp_client.fd in open_client_udp(..) on connect(2) failure

MFC after: 1 week
Sponsored by: Dell EMC Isilon
16:44:55 - r315640
(2 days 15 hours ago)
by vangyzen
Affects: 
(9 files)
/head/lib/libnetbsd/*
/head/usr.bin/Makefile
/head/usr.bin/getaddrinfo/*
Port the getaddrinfo(1) utility from NetBSD

Submitted by: Lohith Bellad <lohithbsd@gmail.com>
Reviewed by: hiren (earlier rev), ae
Obtained from: NetBSD
MFC after: 1 week
Relnotes: yes
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D9365
16:30:02 - r315639
(2 days 15 hours ago)
by ngie
Affects:  /head/lib/libcam/camlib.c
libcam: NULL out freed `ccb.cdm.matches` and `ccb.cdm.patterns` pointers

This is being done to avoid potential double frees with the values.

Differential Revision: D9970
MFC after: 1 week
Reviewed by: imp
Sponsored by: Dell EMC Isilon
14:17:00 - r315638
(2 days 17 hours ago)
by pho
Affects: 
(4 files)
/user/pho/stress2/misc/*
Cast st_ino and st_nlink to uintmax_t for 64 bit inode changes.
13:11:30 - r315637
(2 days 19 hours ago)
by pho
Affects:  /user/pho/stress2/misc/sigaltstack.sh
Added a regression test.

Submitted by: Steven Hartland <killing@multiplay.co.uk>
Sponsored by: Dell EMC Isilon
13:02:27 - r315636
(2 days 19 hours ago)
by mm
Affects: 
(34 files)
/head/contrib/libarchive/*
/head/lib/libarchive/*
/head/usr.bin/*
MFV r315633, 315635:

Sync libarchive with vendor

Vendor changes/bugfixes (FreeBSD-related):
  PR 867 (bsdcpio): show numeric uid/gid when names are not found
  PR 870 (seekable zip): accept files with valid ZIP64 EOCD headers
  PR 880 (pax): Fix handling of "size" pax header keyword
  PR 887 (crypto): Discard 3072 bytes instead of 1024 of first keystream
  OSS-Fuzz issue 806 (mtree): rework mtree_atol10 integer parser
  Break ACL read/write code into platform-specific source files
  Unbreak static dependency on libbz2

MFC after: 1 week
11:55:03 - r315635
(2 days 20 hours ago)
by mm
Affects: 
(6 files)
/vendor/libarchive/dist/libarchive/*
Update vendor/libarchive to git 3e37a9e051bb7674115ca1e262551a070a92283a

Vendor changes:
  Fix type in archive_read_open(3)
  Always use extern keyword for shared constants in archive_acl_maps.h
11:29:40 - r315634
(2 days 20 hours ago)
by pho
Affects:  /user/pho/stress2/misc/trim.sh
Don't loop forever on umount(1).

Sponsored by: Dell EMC Isilon
11:12:31 - r315633
(2 days 21 hours ago)
by mm
Affects: 
(45 files)
/vendor/libarchive/dist/*
Update vendor/libarchive to git 5881c9021a85668bd945593f5ba43a0d22c53d71

Vendor changes (FreeBSD-related):
  Break ACL read/write code into platform-specific source files

Vendor bugfixes (FreeBSD-related):
  PR 867 (bsdcpio): show numeric uid/gid when names are not found
  PR 870 (seekable zip): accept files with valid ZIP64 EOCD headers
  PR 880 (pax): Fix handling of "size" pax header keyword
  PR 887 (crypto): Discard 3072 bytes instead of 1024 of first keystream
  OSS-Fuzz issue 806 (mtree): rework mtree_atol10 integer parser
  Unbreak static dependency on libbz2
10:48:10 - r315632
(2 days 21 hours ago)
by pho
Affects:  /user/pho/stress2/misc/vnodes.sh
Make sure pty.ko is loaded. While here, cleanup code.

Sponsored by: Dell EMC Isilon
09:01:30 - r315631
(2 days 23 hours ago)
by pho
Affects:  /user/pho/stress2/testcases/lockf2/lockf2.c
Using local include file.

Sponsored by: Dell EMC Isilon
09:00:20 - r315630
(2 days 23 hours ago)
by pho
Affects:  /user/pho/stress2/testcases/lockf/lockf.c
Use quotes for local include file.

Sponsored by: Dell EMC Isilon
08:59:12 - r315629
(2 days 23 hours ago)
by pho
Affects:  /user/pho/stress2/testcases/openat/openat.c
Fix copy/paste error.

Sponsored by: Dell EMC Isilon
08:58:22 - r315628
(2 days 23 hours ago)
by pho
Affects:  /user/pho/stress2/testcases/tcp/tcp.c
Added missing waitpid() and cleanup code while here.

Sponsored by: Dell EMC Isilon
08:57:25 - r315627
(2 days 23 hours ago)
by pho
Affects:  /user/pho/stress2/testcases/run/run.c
Cleanup is handled by tools/cleanup.sh

Sponsored by: Dell EMC Isilon
08:56:37 - r315626
(2 days 23 hours ago)
by pho
Affects:  /user/pho/stress2/testcases/badcode/Makefile
CFLAGS is already defined in Makefile.inc

Sponsored by: Dell EMC Isilon
08:16:05 - r315625
(2 days 23 hours ago)
by ae
Affects: 
(2 files)
/stable/10/sys/net/bpf.c
MFC r315192:
  Ignore ifnet renaming in the bpf ifnet departure handler.

  PR: 213015
08:10:58 - r315624
(3 days ago)
by ae
Affects: 
(2 files)
/stable/11/sys/net/bpf.c
MFC r315192:
  Ignore ifnet renaming in the bpf ifnet departure handler.

  PR: 213015
08:10:35 - r315623
(3 days ago)
by avos
Affects:  /head/sys/dev/rtwn/if_rtwn.c
rtwn: fix node id assignment.

Do not assign new id if node is reused.

Tested with RTL8821AU, HOSTAP mode + RTL8188EU, STA mode
(with inactivity timeout == 90)
06:12:55 - r315622
(3 days 2 hours ago)
by ngie
Affects:  /head/usr.sbin/syslogd/syslogd.c
syslogd: try to print out a more helpful message in socksetup(..) if/when
getaddrinfo fails

If the asprintf call fails, fall back to the old code (as a last ditch effort
to provide the end-user with helpful output).

Sponsored by: Dell EMC Isilon
05:15:55 - r315621
(3 days 2 hours ago)
by alc
Affects:  /head/sys/kern/uipc_shm.c
Use IDX_TO_OFF(), not ptoa(), when converting the difference between two
vm_pindex_t's into a vm_ooffset_t.

The length given to shm_dotruncate() must never be negative. Assert this.

Tidy up a comment.

Reviewed by: kib
MFC after: 1 week
05:12:27 - r315620
(3 days 3 hours ago)
by ngie
Affects:  /head/usr.sbin/syslogd/syslogd.c
syslogd: fix dprintf in socksetup(..)

- Make the explanation more complete
- Correct a minor grammar nit with verb tense.
- Don't emit the message if `pe->pe_name` is NULL (it doesn't
  have much value).

MFC after: 1 week
Sponsored by: Dell EMC Isilon
04:41:36 - r315619
(3 days 3 hours ago)
by delphij
Affects:  /head/share/man/man4/cpuctl.4
Pet manlint.

MFC after: 2 weeks
04:25:40 - r315618
(3 days 3 hours ago)
by ngie
Affects:  /head/usr.sbin/syslogd/syslogd.c
syslogd: don't leak `f` on failure in cfline(..)

Free `f` if an unknown priority or facility is parsed with the function.

MFC after: 1 week
Reported by: Coverity
CID: 1368068
Sponsored by: Dell EMC Isilon
03:52:06 - r315617
(3 days 4 hours ago)
by ngie
Affects:  /head/contrib/netbsd-tests/lib/libc/locale/t_io.c
Remove all expected failures from lib/libc/locale/io_test for FreeBSD

This is no longer required as of r315616, as the test is no longer
built/installed.

This is being done to diff reduce with NetBSD.

Sponsored by: Dell EMC Isilon
03:50:22 - r315616
(3 days 4 hours ago)
by ngie
Affects:  /head/ObsoleteFiles.inc
/head/lib/libc/tests/locale/Makefile
Don't build/install lib/libc/io_test anymore

The failing test requires the zh_TW.Big5 locale, which is no longer
installed as of r315568.

Add a note/pointer just in case someone considers re-adding it.

Reported by: Jenkins
Sponsored by: Dell EMC Isilon
03:47:15 - r315615
(3 days 4 hours ago)
by delphij
Affects:  /head/lib/libc/sys/Symbol.map
Make space style consistent with earlier entries.

X-MFC with: r315526
03:42:14 - r315614
(3 days 4 hours ago)
by ngie
Affects:  /head/ObsoleteFiles.inc
Fix date added in r315570 so it's sorted properly

Sponsored by: Dell EMC Isilon
03:18:16 - r315613
(3 days 4 hours ago)
by ngie
Affects: 
(4 files)
/stable/9/contrib/bsnmp/snmpd/main.c
MFC r315206:

bsnmpd: fix segfault when trans_insert_port(..) is called with multiple
out of order addresses

Move `port->transport` initialization before the TAILQ_FOREACH(..) loop
to ensure that the value is properly initialized before it's inserted
into the TAILQ.

PR: 217760
03:13:03 - r315612
(3 days 5 hours ago)
by ngie
Affects: 
(2 files)
/stable/10/contrib/bsnmp/snmpd/main.c
MFC r315206:

bsnmpd: fix segfault when trans_insert_port(..) is called with multiple
out of order addresses

Move `port->transport` initialization before the TAILQ_FOREACH(..) loop
to ensure that the value is properly initialized before it's inserted
into the TAILQ.

PR: 217760
03:13:00 - r315611
(3 days 5 hours ago)
by ngie
Affects: 
(2 files)
/stable/11/contrib/bsnmp/snmpd/main.c
MFC r315206:

bsnmpd: fix segfault when trans_insert_port(..) is called with multiple
out of order addresses

Move `port->transport` initialization before the TAILQ_FOREACH(..) loop
to ensure that the value is properly initialized before it's inserted
into the TAILQ.

PR: 217760
03:06:41 - r315610
(3 days 5 hours ago)
by ngie
Affects: 
(3 files)
/stable/10/sbin/dhclient/clparse.c
/stable/10/sbin/dhclient/tests/fake.c
MFC r315199,r315200,r315203:

r315199:

sbin/dhclient: fix a memory leak in parse_client_lease_statement(..)

The memory stored by `lease` would have previously been leaked if an
unterminated lease declaration was found in an early-return code path.

CID: 1007114

r315200:

Fix -Wunused-but-set-warning with `ret`

While here, resolve Coverity warnings by demonstrating that vfprintf's
return value is being explicitly ignored.

Tested with: clang, gcc 4.2.1, gcc 6.3.0

r315203:

sbin/dhclient: fix `vendor` storage leak in parse_option_decl(..)

This ensures the storage isn't leaked when non-NULL and the function
returns early, prior to the `free(vendor)` later on in the function.

CID: 1007111-1007113
03:06:37 - r315609
(3 days 5 hours ago)
by ngie
Affects: 
(3 files)
/stable/11/sbin/dhclient/clparse.c
/stable/11/sbin/dhclient/tests/fake.c
MFC r315199,r315200,r315203:

r315199:

sbin/dhclient: fix a memory leak in parse_client_lease_statement(..)

The memory stored by `lease` would have previously been leaked if an
unterminated lease declaration was found in an early-return code path.

CID: 1007114

r315200:

Fix -Wunused-but-set-warning with `ret`

While here, resolve Coverity warnings by demonstrating that vfprintf's
return value is being explicitly ignored.

Tested with: clang, gcc 4.2.1, gcc 6.3.0

r315203:

sbin/dhclient: fix `vendor` storage leak in parse_option_decl(..)

This ensures the storage isn't leaked when non-NULL and the function
returns early, prior to the `free(vendor)` later on in the function.

CID: 1007111-1007113
03:01:23 - r315608
(3 days 5 hours ago)
by ngie
Affects: 
(2 files)
/stable/10/lib/libcam/cam_cdbparse.3
MFC r315202:

lib/libcam/cam_cdbparse.3: fix manpage warnings

- Add comma before and after 'e.g.'; remove surrounding parentheses
  that were unnecessary after this change [1].
- Add .Mt when referencing ken and Peter Dufault's email addresses
  [2].
- Sprinkle around .An use where proper [2].

Bump .Dd for the change
03:01:21 - r315607
(3 days 5 hours ago)
by ngie
Affects: 
(2 files)
/stable/11/lib/libcam/cam_cdbparse.3
MFC r315202:

lib/libcam/cam_cdbparse.3: fix manpage warnings

- Add comma before and after 'e.g.'; remove surrounding parentheses
  that were unnecessary after this change [1].
- Add .Mt when referencing ken and Peter Dufault's email addresses
  [2].
- Sprinkle around .An use where proper [2].

Bump .Dd for the change
03:00:22 - r315606
(3 days 5 hours ago)
by ngie
Affects: 
(2 files)
/stable/10/lib/libcam/cam.3
MFC r315132,r315133,r315186:

r315132:

Use .Dv when referencing NULL

This is the correct markup macro, as opposed to .Va (variable names)

While here, annotate several bare references to `NULL` with .Dv.

r315133:

lib/libcam/cam.3: fix manpage warnings

- spelling: "mis-named" should be "misnamed".
- delete spaces interspersed in literal representation of
  `struct cam_device` as hard-tabs separate the types and fields.
- Add commas after `e.g.`.

r315186:

lib/libcam/cam.3: note that cam_freeccb(3) with ccb == NULL is a no-op

This allows me to accurately test this scenario, and for others to rely
on the behavior, instead of relying on knowledge obtained via code
inspection.

Wording borrowed from free(3).

Requested by: ken (D9928)
03:00:19 - r315605
(3 days 5 hours ago)
by ngie
Affects: 
(2 files)
/stable/11/lib/libcam/cam.3
MFC r315132,r315133,r315186:

r315132:

Use .Dv when referencing NULL

This is the correct markup macro, as opposed to .Va (variable names)

While here, annotate several bare references to `NULL` with .Dv.

r315133:

lib/libcam/cam.3: fix manpage warnings

- spelling: "mis-named" should be "misnamed".
- delete spaces interspersed in literal representation of
  `struct cam_device` as hard-tabs separate the types and fields.
- Add commas after `e.g.`.

r315186:

lib/libcam/cam.3: note that cam_freeccb(3) with ccb == NULL is a no-op

This allows me to accurately test this scenario, and for others to rely
on the behavior, instead of relying on knowledge obtained via code
inspection.

Wording borrowed from free(3).

Requested by: ken (D9928)
02:58:05 - r315604
(3 days 5 hours ago)
by ngie
Affects: 
(2 files)
/stable/11/usr.bin/xinstall/tests/install_test.sh
MFC r315098,r315106,r315108:

r315098:

Clarify src vs dest path mismatch in :symbolic_link_{absolute,relative}_body

Unfortunately kyua does not omit the path mismatch on failure, so it must be
coded
into the error message.

Cache the values, run the test(1) call, then print out the values in an atf_fail
call to emit the required diagnostics to debug why things are failing.

r315106:

Add 3 more testcases demonstrating how install -l sr works

The additional testcases use absolute paths for sources and targets,
as the other testcase which tested `-l sr` used flat relative paths in
the same directory.

Please note that these testcases do not test `-l a` -- that's already
addressed in the battery of tests.

r315108:

Restore some of the error message text accidentally removed in r315098

"unexpected symlink contents" is more pedantically correct than
"unexpected symlink".
02:47:28 - r315603
(3 days 5 hours ago)
by ngie
Affects:  /head/lib/libkvm/kvm.c
kvm_close(3): return `error` instead of blindly returning `0`

`error` is the accumulated error from previous close(2) calls.

This bug has been present since the libcall's import from 4.4BSD
Lite (r1573).

MFC after: 1 week
Noticed by: vangyzen (D10022)
Relnotes: yes
Sponsored by: Dell EMC Isilon
01:53:50 - r315602
(3 days 6 hours ago)
by pfg
Affects: 
(2 files)
/stable/11/sys/sys/cdefs.h
MFC r312942:
Remove GCC's __nonnull() attribute definition.

While GCC's __nonnull__ attribute is generally useful to prevent misuse of
some functions it also tends to do rather dangerous "optimizations". Now
that we have replaced all such uses with the clang nullability qualifiers,
the GCC attribute is unnecessary.

Remove the definition completely to prevent its use in system's headers.
01:19:04 - r315601
(3 days 6 hours ago)
by ngie
Affects:  /head/lib/libkvm/kvm_open.3
kvm_open2(3): remove '*' when describing addr argument for `resolver`

As noted by vangyzen, with a similar issue in D10022, the pointer portion of
the .Fa macro call is unnecessary, so remove the '*'.

MFC after: 1 week
Sponsored by: Dell EMC Isilon
00:55:24 - r315600
(3 days 7 hours ago)
by pfg
Affects: 
(8 files)
/stable/10/usr.bin/mkimg/qcow.c
/stable/10/usr.sbin/*
MFC r315212, r315213, r315214, r315215:
mkimg(1): let calloc(3) do the multiplication.
nscd(8): let calloc(3) do the multiplying.
mpsutil(8): let calloc(3) do the multiplying.
ypbind(8): let calloc(3) do the multiplying.

MFC after: 1 week
00:54:45 - r315599
(3 days 7 hours ago)
by pfg
Affects: 
(8 files)
/stable/11/usr.bin/mkimg/qcow.c
/stable/11/usr.sbin/*
MFC r315212, r315213, r315214, r315215:
mkimg(1): let calloc(3) do the multiplication.
nscd(8): let calloc(3) do the multiplying.
mpsutil(8): let calloc(3) do the multiplying.
ypbind(8): let calloc(3) do the multiplying.

MFC after: 1 week
2017 - 03 - 19   (4 days ago)
23:27:17 - r315598
(3 days 8 hours ago)
by marius
Affects: 
(10 files)
/head/sys/dev/mmc/*
/head/sys/dev/sdhci/*
o Add support for eMMC DDR bus speed mode at 52 MHz to sdhci(4) and
  mmc(4). For the most part, this consists of support for:
  - Switching the signal voltage (VCCQ) to 1.8 V or (if supported
  by the host controller) to 1.2 V,
  - setting the UHS mode as appropriate in the SDHCI_HOST_CONTROL2
  register,
  - setting the power class in the eMMC device according to the
  core supply voltage (VCC),
  - using different bits for enabling a bus width of 4 and 8 bits
  in the the eMMC device at DDR or higher timings respectively,
  - arbitrating timings faster than high speed if there actually
  are additional devices on the same MMC bus.

  Given that support for DDR52 is not denoted by SDHCI capability
  registers, availability of that timing is indicated by a new
  quirk SDHCI_QUIRK_MMC_DDR52 and only enabled for Intel SDHCI
  controllers so far. Generally, what it takes for a sdhci(4)
  front-end to enable support for DDR52 is to hook up the bridge
  method mmcbr_switch_vccq (which especially for 1.2 V signaling
  support is chip/board specific) and the sdhci_set_uhs_timing
  sdhci(4) method.

  As a side-effect, this change also fixes communication with
  some eMMC devices at SDR high speed mode with 52 MHz due to
  the signaling voltage and UHS bits in the SDHCI controller no
  longer being left in an inappropriate state.

  Compared to 52 MHz at SDR high speed which typically yields
  ~45 MB/s with the eMMC chips tested, throughput goes up to
  ~80 MB/s at DDR52.

  Additionally, this change already adds infrastructure and quite
  some code for modes up to HS400ES and SDR104 respectively (I did
  not want to add to much stuff at a time, though). Essentially,
  what is still missing in order to be able to activate support
  for these latter is is support for and handling of (re-)tuning.

o In sdhci(4), add two tunables hw.sdhci.quirk_clear as well as
  hw.sdhci.quirk_set, which (when hooked up in the front-end)
  allow to set/clear sdhci(4) quirks for debugging and testing
  purposes. However, especially for SDHCI controllers on the
  PCI bus which have no specific support code so far and, thus,
  are picked up as generic SDHCI controllers, hw.sdhci.quirk_set
  allows for setting the necessary quirks (if required).

o In mmc(4), check and handle the return values of some more
  function calls instead of assuming that everything went right.
  In case failures actually are not problematic, indicate that
  by casting the return value to void.

Reviewed by: jmcneill
23:06:11 - r315597
(3 days 9 hours ago)
by alc
Affects:  /head/sys/kern/vfs_bio.c
Style fixes. In particular, the variable "bogus" is used like a Boolean.
Define it as such.

Reviewed by: kib
MFC after: 1 week
23:05:03 - r315596
(3 days 9 hours ago)
by avos
Affects:  /head/sys/net80211/ieee80211_superg.c
net80211: reschedule tasks properly after r315594.
23:04:58 - r315595
(3 days 9 hours ago)
by ngie
Affects:  /head/lib/libkvm/kvm_getprocs.3
Remove a commented out line before kvm_getprocs(3)

The commented out return value for kvm_getprocs(3) was misleading -- the
uncommented line is correct.

No content change

MFC after: 1 week
Sponsored by: Dell EMC Isilon
22:18:44 - r315594
(3 days 9 hours ago)
by avos
Affects:  /head/sys/net80211/ieee80211_superg.c
net80211: do not cancel callout when FF queue is empty.

This should reduce overhead for aggregates (since every second frame
clears the queue and reschedules the task there is no need to cancel
the callout here; let it just run once at the end - even if queue is
empty).

Reported by: adrian
22:14:22 - r315593
(3 days 9 hours ago)
by ngie
Affects: 
(2 files)
/stable/10/etc/snmpd.config
MFC r311601:

Move the mibII module up so uncommenting the bridge module works

Add a note about how module ordering and dependent modules
22:13:40 - r315592
(3 days 9 hours ago)
by ngie
Affects: 
(2 files)
/stable/11/etc/snmpd.config
MFC r311601:

Move the mibII module up so uncommenting the bridge module works

Add a note about how module ordering and dependent modules
21:53:12 - r315591
(3 days 10 hours ago)
by ian
Affects:  /head/sys/arm/freescale/imx/imx_gpt.c
Replace the hard-coded way-too-small minimum event timer period with a value
calculated at runtime based on how long it takes to set up an event in
hardware. This fixes the intermittant 1-minute hang at boot on imx5
systems, and also the occasional oversleeping while running. It doesn't
affect imx6 systems, which use different hardware for eventtimers.

It turns out that it usually takes about 30 timer ticks to set up the timer
compare register, and the old hard-coded minimum period was 10 ticks. On
the rare occasions when a timeout event that short was set up, we'd miss
the event and have to wait about 64 seconds for counter rollover before
the compare interrupt would fire.

Instead of just hardcoding a new bigger value, the code now measures the
time it takes to do the register read/write sequence to set up the compare
register, scales it up by 1.5x to be safe, and calculates the minimum event
period from the result. In the real world, the minimum period works out to
about 750 nanoseconds on imx5 hardware.
21:49:15 - r315590
(3 days 10 hours ago)
by ngie
Affects:  /head/usr.bin/diff/diff.1
diff(1): add --strip-trailing-cr to last example in the SYNOPSIS

This syncs the last example in the SYNOPSIS with the other examples.

Reviewed by: bapt
Sponsored by: Dell EMC Isilon
Differential Revision: D10017
21:28:37 - r315589
(3 days 10 hours ago)
by ian
Affects:  /head/sys/arm/freescale/imx/imx_gpt.c
Eliminate unnecessary read/modify/write sequences during eventtimer setup.

It turns out to be surprisingly expensive to access the gpt hardware (on the
order of 150ns per read/write). To cut down on the overhead of setting up
each eventtimer event, eliminate read-modify-write sequences to manage the
compare interrupt enable, by keeping a shadow copy of the hardware register
and only writing to the hardware when the enable bits really change.
21:25:27 - r315588
(3 days 10 hours ago)
by kib
Affects:  /head/sys/dev/cpuctl/cpuctl.c
Update the list of cpudev ioctls which require write access.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
21:25:13 - r315587
(3 days 10 hours ago)
by mav
Affects:  /head/sys/dev/isp/isp.c
/head/sys/dev/isp/isp_freebsd.c
/head/sys/dev/isp/ispvar.h
Remove some useless code.

MFC after: 2 weeks
21:24:07 - r315586
(3 days 10 hours ago)
by kib
Affects:  /head/sys/dev/cpuctl/cpuctl.c
Style.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
21:18:53 - r315585
(3 days 10 hours ago)
by jilles
Affects:  /head/bin/sh/expand.c
sh: Fix build with -DDEBUG=2.

With the new expansion code (word splitting during instead of after other
expansion processing), tracing the result of command substitution is no
longer possible, so stop trying.
20:51:28 - r315584
(3 days 11 hours ago)
by avos
Affects:  /head/sys/dev/rtwn/pci/rtwn_pci_rx.c
/head/sys/dev/rtwn/usb/rtwn_usb_rx.c
rtwn: drop unneeded (after r315583) code.

Tested with RTL8188EU, HOSTAP mode + RTL8821AU, STA mode
(fast-frames / A-MSDU).
20:05:21 - r315583
(3 days 12 hours ago)
by avos
Affects:  /head/sys/net80211/ieee80211_superg.c
/head/sys/net80211/ieee80211_superg.h
net80211: add a timer to flush fast-frames queues.

This should allow to drop 'ieee80211_ff_[age/flush]' calls from drivers
(an additional call can be made from ieee80211_tx_complete()
for non-default ieee80211_ffagemax values to prevent stalls -
but it will require an additional counter for transmitted frames).

Tested with RTL8821AU, STA mode (A-MSDU part only).

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D9984
20:04:57 - r315582
(3 days 12 hours ago)
by pfg
Affects: 
(2 files)
/stable/10/contrib/one-true-awk/b.c
MFC r315426, MFV r315425:
one-true-awk: have calloc(3) do the multiplication.
20:04:23 - r315581
(3 days 12 hours ago)
by pfg
Affects: 
(2 files)
/stable/11/contrib/one-true-awk/b.c
MFC r315426, MFV r315425:
one-true-awk: have calloc(3) do the multiplication.
19:52:47 - r315580
(3 days 12 hours ago)
by alc
Affects:  /head/sys/vm/vm_fault.c
Two changes to vm_fault_populate():

Simplify the logic for clipping the range returned by the pager to fit
within the map entry.

Use atop() rather than OFF_TO_IDX() on addresses.

Reviewed by: kib
MFC after: 1 week
19:11:40 - r315579
(3 days 13 hours ago)
by mav
Affects: 
(7 files)
/head/sys/dev/isp/*
Add initial support for multiple MSI-X vectors.

For 24xx and above use 2 vectors (default and response queue).
For 26xx and above use 3 vectors (default, response and ATIO queues).
Due to global lock interrupt hardlers never run simultaneously now, but
at least this allows to save one regitster read per interrupt.

MFC after: 2 weeks
19:10:23 - r315578
(3 days 13 hours ago)
by ian
Affects: 
(2 files)
/head/sys/modules/dtb/imx5/Makefile
Add a module to build imx5 dtb files.
18:50:03 - r315577
(3 days 13 hours ago)
by ian
Affects:  /head/sys/boot/fdt/dts/arm/imx53-qsb.dts
Delete our local imx53-qsb.dts file; the code now runs fine using the
standard vendor-supplied file in sys/gnu/dts/arm.
18:38:08 - r315576
(3 days 13 hours ago)
by ian
Affects:  /head/sys/arm/conf/EFIKA_MX
Add INTRNG option to EFIKA_MX config, it is an imx5-based platform.
18:35:20 - r315575
(3 days 13 hours ago)
by ian
Affects:  /head/sys/arm/conf/DIGI-CCWMX53
Remove kernel config for DIGI-CCWMX53 devel board. It was just standard
IMX53 with static dtb added, and now that imx53 can use vendor-supplied dts
files and ubldr, there is no need for a static-dtb variant.
18:30:38 - r315574
(3 days 13 hours ago)
by ian
Affects:  /head/sys/arm/conf/IMX53
/head/sys/arm/freescale/imx/tzic.c
Convert the imx5 interrupt controller driver to INTRNG.
18:28:38 - r315573
(3 days 13 hours ago)
by ian
Affects:  /head/sys/arm/conf/IMX53
Add dtb/imx5 module build to the imx53 kernel config.
18:26:52 - r315572
(3 days 13 hours ago)
by ian
Affects:  /head/sys/arm/conf/IMX53-QSB
Remove kernel config for IMX53-QSB (quickstart board). It was just
standard IMX53 with static dtb added, and now that imx53 can use vendor-
supplied dts files and ubldr, there is no need for a static-dtb variant.
18:21:35 - r315571
(3 days 13 hours ago)
by bapt
Affects: 
(4 files)
/head/share/timedef/*
Canada adheres to ISO 8601, let's make the locale reflecting that fact

PR: 200079
MFC after: 1 week
Submitted by: Dan McGregor <dan.mcgregor@usask.ca>
Reported by: A.J. Kehoe IV (Nanoman) <freebsd-bugs@nanoman.ca>
Differential Revision: https://reviews.freebsd.org/D9925
18:03:52 - r315570
(3 days 14 hours ago)
by bapt
Affects:  /head/ObsoleteFiles.inc
/head/etc/mtree/BSD.usr.dist
Remove empty Big5 directory from share/nls
17:54:12 - r315569
(3 days 14 hours ago)
by bapt
Affects:  /head/share/timedef/Makefile
/head/share/timedef/zh_TW.Big5.src
Finish removal of Big5
17:52:46 - r315568
(3 days 14 hours ago)
by bapt
Affects: 
(13 files)
/head/*
Remove zh_TW.Big5 locale

After discussion with many Taiwanese, in IT or not. Big5 is not used anymore.
It is not able to represent lots of the characters used in the language.
17:48:41 - r315567
(3 days 14 hours ago)
by bapt
Affects: 
(6 files)
/head/tools/tools/locale/Makefile
/head/tools/tools/locale/etc/*
/head/tools/tools/locale/tools/*
Prepare the removal of the zh_TW.Big5 encoding
17:46:08 - r315566
(3 days 14 hours ago)
by bapt
Affects:  /head/tools/tools/locale/etc/final-maps/map.Big5HKSCS
Garbage collect a map file that is not used anymore to generate locales
17:19:59 - r315565
(3 days 14 hours ago)
by bapt
Affects: 
(6 files)
/head/*
Temporary readd GNU diff

etcupdate requires --change-group-format it is not easy to implement
in bsd diff so for now readd GNU diff
16:17:42 - r315564
(3 days 15 hours ago)
by trasz
Affects:  /head/usr.sbin/fstyp/fstyp.8
Improve formatting.

MFC after: 2 weeks
16:01:44 - r315563
(3 days 16 hours ago)
by kib
Affects: 
(8 files)
/stable/11/lib/libc/sys/mmap.2
/stable/11/sys/kern/*
/stable/11/sys/vm/*
MFC r313690:
Consistently handle negative or wrapping offsets in the mmap(2) syscalls.

MFC r315158:
Fix two missed places where vm_object offset to index calculation
should use unsigned shift.
15:56:06 - r315562
(3 days 16 hours ago)
by kib
Affects: 
(4 files)
/stable/10/sys/kern/kern_event.c
/stable/10/sys/kern/kern_ktrace.c
/stable/10/sys/sys/ktrace.h
MFC r315155:
Ktracing kevent(2) calls with unusual arguments might leads to an
overly large allocation requests.

PR: 217435
15:53:17 - r315561
(3 days 16 hours ago)
by trasz
Affects:  /head/share/man/man4/ctl.4
Bring back the "i". The point is to make it easy to find via "apropos
iscsi", along with all the other relevant components.

MFC after: 2 weeks
15:49:51 - r315560
(3 days 16 hours ago)
by trasz
Affects:  /head/sbin/reboot/reboot.8
Document how to use reroot with NFS.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL
15:48:41 - r315559
(3 days 16 hours ago)
by kib
Affects: 
(2 files)
/stable/11/sys/kern/kern_exit.c
MFC r315159:
Avoid reusing p_ksi while it is on queue.
15:46:25 - r315558
(3 days 16 hours ago)
by kib
Affects: 
(2 files)
/stable/11/sys/kern/imgact_elf.c
MFC r315157:
Accept linkers representation for ELF segments with zero on-disk length.
15:44:08 - r315557
(3 days 16 hours ago)
by kib
Affects: 
(2 files)
/stable/11/sys/kern/imgact_elf.c
MFC r315156:
Style.
15:32:12 - r315556
(3 days 16 hours ago)
by trasz
Affects: 
(2 files)
/stable/11/sys/compat/linux/linux_mmap.c
MFC r313947:

There are some Linux binaries that expect the system to obey the "addr"
parameter to mmap(2), even if MAP_FIXED is not explicitly specified.
Android ART is one example. Implement bug compatibility for this case
in linuxulator.

Sponsored by: DARPA, AFRL
15:15:34 - r315555
(3 days 16 hours ago)
by trasz
Affects: 
(5 files)
/stable/11/sys/compat/*
/stable/11/sys/kern/kern_cpuset.c
/stable/11/sys/sys/syscallsubr.h
MFC r313281:

Add kern_cpuset_getaffinity() and kern_cpuset_getaffinity(),
and use it in compats instead of their sys_*() counterparts.

Sponsored by: DARPA, AFRL
15:07:30 - r315554
(3 days 17 hours ago)
by trasz
Affects: 
(4 files)
/stable/11/sys/compat/freebsd32/freebsd32_misc.c
/stable/11/sys/kern/kern_cpuset.c
/stable/11/sys/sys/syscallsubr.h
MFC r313015:

Add kern_cpuset_getid() and kern_cpuset_setid(), and use them
in compat32 instead of their sub_*() counterparts.

Sponsored by: DARPA, AFRL
14:46:40 - r315553
(3 days 17 hours ago)
by trasz
Affects: 
(5 files)
/stable/11/sys/compat/*
/stable/11/sys/kern/sys_generic.c
/stable/11/sys/sys/syscallsubr.h
MFC r313018:

Add kern_pread() and kern_pwrite(), and use it in compats instead
of their sys_*() counterparts. The svr4 is left unchanged.

Sponsored by: DARPA, AFRL
14:42:16 - r315552
(3 days 17 hours ago)
by kib
Affects:  /head/sys/vm/vm_fault.c
Fix off-by-one in the vm_fault_populate() code.

When re-calculating the last inclusive page index after the pager
call, -1 was erronously ommitted. If the pager extended the run
(unlikely), the result would be insertion of the valid page mapping
outside the current map entry range.

Found by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
14:40:01 - r315551
(3 days 17 hours ago)
by trasz
Affects: 
(3 files)
/stable/11/sys/compat/freebsd32/freebsd32_misc.c
/stable/11/sys/kern/vfs_syscalls.c
MFC r313016:

Replace calls to sys_truncate() with kern_truncate().

Sponsored by: DARPA, AFRL
14:36:19 - r315550
(3 days 17 hours ago)
by trasz
Affects: 
(5 files)
/stable/11/sys/compat/*
/stable/11/sys/kern/vfs_syscalls.c
MFC r312987:

Add kern_lseek() and use it instead of sys_lseek() in various compats.
I didn't touch svr4/, there's no point.

Sponsored by: DARPA, AFRL
14:25:23 - r315549
(3 days 17 hours ago)
by trasz
Affects: 
(6 files)
/stable/11/sys/compat/*
/stable/11/sys/kern/uipc_syscalls.c
/stable/11/sys/sys/syscallsubr.h
MFC r312988:

Add kern_listen(), kern_shutdown(), and kern_socket(), and use them
instead of their sys_*() counterparts in various compats. The svr4
is left untouched, because there's no point.

Sponsored by: DARPA, AFRL
14:12:55 - r315548
(3 days 18 hours ago)
by trasz
Affects: 
(6 files)
/stable/11/sys/*
MFC r312986:

Replace sys_ftruncate() with kern_ftruncate() in various compats.

Sponsored by: DARPA, AFRL
14:09:02 - r315547
(3 days 18 hours ago)
by trasz
Affects: 
(2 files)
/stable/11/sbin/savecore/savecore.c
MFC r313946:

Make savecore(8) output nicer by specifying the maximum field width
instead of minimum one (precision instead of width).
14:05:56 - r315546
(3 days 18 hours ago)
by trasz
Affects: 
(2 files)
/stable/11/sbin/fsck/fsck.c
MFC r313915:

Make fsck(8) default to "ufs", like eg mount(8) does.
13:46:11 - r315545
(3 days 18 hours ago)
by mav
Affects: 
(4 files)
/head/sys/dev/isp/*
Remove hackish code delaying ATIOs to unknown virtual port.

Since we support RQSTYPE_RPT_ID_ACQ, that functionality is only useful
in loop mode, which probably doesn't worth having this hack in 2017.

MFC after: 2 weeks
10:41:36 - r315544
(3 days 21 hours ago)
by trasz
Affects: 
(2 files)
/stable/11/sys/amd64/linux/linux_machdep.c
MFC r313993:

Reimplement linux_arch_prctl() as a wrapper around sysarch(2).
This also adds support for LINUX_ARCH_SET_GS.
10:39:59 - r315543
(3 days 21 hours ago)
by trasz
Affects: 
(4 files)
/stable/11/sys/amd64/linux32/linux.h
/stable/11/sys/compat/linux/linux_stats.c
/stable/11/sys/i386/linux/linux.h
MFC r314282:

Fix linux_fstatfs() to return proper value for f_frsize. Without it,
linux df(1) binary from Xenial shows garbage.
10:38:27 - r315542
(3 days 21 hours ago)
by trasz
Affects: 
(2 files)
/stable/11/sys/compat/linprocfs/linprocfs.c
MFC r313995:

Add /proc/self/mounts to linprocfs; some linux binaries need it.
10:37:03 - r315541
(3 days 21 hours ago)
by trasz
Affects: 
(2 files)
/stable/11/sys/compat/linux/linux.c
MFC r313804:

Improve debugging output.
10:35:56 - r315540
(3 days 21 hours ago)
by trasz
Affects: 
(2 files)
/stable/11/sys/kern/vfs_mountroot.c
MFC r313351:

Make root_mount_hold() work after boot. This is important for two
reasons. First is rerooting into USB-mounted device that happens
to be not yet enumerated. The second is when mounting with (non-root)
filesystem on USB device on a hub that's enumerated later than the root
mount: the rc scripts explicitly mount for the root mount holds to be
released, but each USB bus takes the hold asynchronously, and if that
happens after root mount, it would just get ignored.
10:34:26 - r315539
(3 days 21 hours ago)
by trasz
Affects: 
(2 files)
/stable/11/sys/kern/vfs_mountroot.c
MFC r313350:

In r290196 the root mount hold mechanism was changed to make it not wait
for mount hold release if the root device already exists. So, unless your
rootdev is not on USB - ie in the usual case - the root mount won't wait
for USB. However, the old behaviour was sometimes used as "wait until USB
is fully enumerated", and r290196 broke that.

This commit adds vfs.root_mount_always_wait tunable, to force the kernel
to always wait for root mount holds, even if the root is already there.

Relnotes: yes
10:32:39 - r315538
(3 days 21 hours ago)
by trasz
Affects: 
(2 files)
/stable/11/sys/compat/linux/linux_file.c
MFC r313283:

Fix linux_pipe() and linux_pipe2() to close file descriptors on copyout
error.
10:28:51 - r315537
(3 days 21 hours ago)
by trasz
Affects: 
(2 files)
/stable/11/sys/compat/linux/linux_misc.c
MFC r313017:

Fix linux_getppid() to debug the actual parent, even it was reparented
by debugger.
10:28:04 - r315536
(3 days 21 hours ago)
by mav
Affects:  /head/sys/dev/isp/isp_freebsd.c
/head/sys/dev/isp/isp_target.c
Move <= 23xx PDB workaround to generic code.

It is chip-specific and has nothing to do with platform.

MFC after: 2 weeks
10:26:00 - r315535
(3 days 21 hours ago)
by trasz
Affects: 
(3 files)
/stable/11/usr.bin/iscsictl/iscsictl.c
/stable/11/usr.bin/iscsictl/iscsictl.h
MFC r312539 (by mav@):

Remove some unused code.
09:36:43 - r315534
(3 days 22 hours ago)
by mav
Affects:  /head/sys/dev/isp/isp_target.h
Remove some dead stuff.

MFC after: 2 weeks
09:30:03 - r315533
(3 days 22 hours ago)
by mav
Affects:  /head/sys/dev/isp/isp_freebsd.c
/head/sys/dev/isp/isp_target.c
/head/sys/dev/isp/isp_target.h
Move 24xx RQSTYPE_NOTIFY handling to generic code.

This code has nothing to do with specific platform.

MFC after: 2 weeks
07:34:19 - r315532
(4 days ago)
by ae
Affects: 
(5 files)
/stable/11/sys/netpfil/ipfw/*
MFC r314716:
  Add IPv6 support to O_IP_DST_LOOKUP opcode.

  o check the size of O_IP_SRC_LOOKUP opcode, it can not exceed the size of
  ipfw_insn_u32;
  o rename ipfw_lookup_table_extended() function into ipfw_lookup_table() and
  remove old ipfw_lookup_table();
  o use args->f_id.flow_id6 that is in host byte order to get DSCP value;
  o add SCTP ports support to 'lookup src/dst-port' opcode;
  o add IPv6 support to 'lookup src/dst-ip' opcode.

  PR: 217292
  Sponsored by: Yandex LLC
  Differential Revision: https://reviews.freebsd.org/D9873
05:00:14 - r315531
(4 days 3 hours ago)
by adrian
Affects:  /head/sys/dev/ath/if_ath_tx.c
[ath] prepare for "correct" group (bcast/mcast) address frame handling and
software/hardware queue TID mapping.

When I initially did this 11n TX work in days of yonder, my 802.11 standards
clue was ... not as finely tuned. One of the things in 802.11-2012 (which
I guess technically was after I did this work, but I'm sure it was like this
in the previous rev?) is that among other traffic classes, three things are
important:

* group addressed frames should be default non-QoS, even if they're QoS frames,
and
* group addressed frames should have a seqno out of a different space than the
  per-TID QoS one; and because of this
* group addressed frames, being non-QoS, should never be in the Block-ACK window
  for TX.

Now, net80211 and now this code cheats by using the non-QOS TID, but ideally
we'd introduce a separate seqno space just for multicast/group traffic for
TX and RX comparison.

Later extensions (eg reliable multicast / multimedia) express what one should do
when doing multicast traffic in a TID. Now, technically we /could/ do group
traffic
as QoS traffic and throw it into a per-TID seqno space, but this definitely
introduces ordering issues when you take into account things like CABQ
behaviour.
(Ie, if some traffic in the TID goes into the CABQ and some doesn't, because
it's doing a split of multicast and non-multicast traffic, then you have
seqno ordering issues.)

So, until someone implements 802.11vv reliable multicast / multimedia
extensions,
group traffic is non-QoS.

Next, software/hardware queue TID mapping. In the past I believed the WME
tagging
of frames because well, net80211 had a habit of tagging things like management
traffic with it. But, then we also map QoS traffic categories to TIDs as well.
So, we should obey the TID! But! then it put some management traffic into
higher
WME categories too, as those frames don't have QoS TIDs. But! It'd do things
like
put things like QoS action frames into higher WME categories, when they should
be kept in-order with the rest of the traffic for that TID. So! Given all of
this,
the ath(4) driver does overrides to not trust the WME category.

I .. am undoing some of this. Now, the TID has a 1:1 mapping to the hardware
queue. The TID is the primary source of truth now for all QoS traffic.
The WME is only used for non-QoS traffic. This now means that any TID traffic
queued should be consistently queued regardless of WME, so things like the
"TX finished, do more TX" that is occuring right now for transmit handling
should be "better".

The consistent {TID, WME} -> hardware queue mapping is important for
transmit completion. It's used to schedule more traffic for that
particular TID, because that {many TID}:{1 TXQ} mapping in ath_tx_tid_sched()
is used for driving completion. Ie, when the hardware queue completes,
it'll walk that list of scheduled TIDs attached to that TXQ.

The eventual aim is to get ready for some other features around putting
some data into other hardware queues (eg for better PS-POLL support,
uAPSD, support, correct-er TDMA support, etc) which requires that
I tidy all of this up in preparation for then introducing further
TID scheduling that isn't linked to a hardware TXQ (likely a per-WME, per-TID
driver queue, and a per-node driver queue) to enable that.

Tested:

* AR9380, STA mode
* AR9380, AR9580, AP mode
04:03:39 - r315530
(4 days 4 hours ago)
by ian
Affects:  /head/sys/arm/freescale/imx/imx_gpt.c
/head/sys/arm/freescale/imx/imx_gptvar.h
Remove unreferenced global function imx_gpt_get_timerfreq() and do some
cleanups enabled by that:

 - The only thing left in imx_gptvar.h was the softc, which IMO never
  should have been in there at all. Move it into the driver, and
  delete the header file.

 - Remove several unneeded #includes from the driver.

 - Change imx_gpt_softc from global to static (it's used by DELAY()), and
  don't redundantly static-initialize it to NULL.
03:06:09 - r315529
(4 days 5 hours ago)
by kp
Affects:  /head/sys/netpfil/pf/pf.c
pf: Fix rule evaluation after inet6 route-to

In pf_route6() we re-run the ruleset with PF_FWD if the packet goes out
of a different interface. pf_test6() needs to know that the packet was
forwarded (in case it needs to refragment so it knows whether to call
ip6_output() or ip6_forward()).

This lead pf_test6() to try to evaluate rules against the PF_FWD
direction, which isn't supported, so it needs to treat PF_FWD as PF_OUT.
Once fwdir is set correctly the correct output/forward function will be
called.

PR: 217883
Submitted by: Kajetan Staszkiewicz
MFC after: 1 week
Sponsored by: InnoGames GmbH
01:24:18 - r315528
(4 days 6 hours ago)
by bjk
Affects: 
(5 files)
/head/share/man/man5/stab.5
/head/share/man/man9/*
Tidy up mdoc formatting for "etc.)" at end of line

man(1) has some logic to use two spaces after a full stop, which is
useful for spotting sentence breaks in monospace fonts. However,
this logic is very simple, treating almost all '.' characters as
end-of-sentence markers, unless followed by certain other
characters. For example, '.,' is not end-of-sentence, and neither
is ".) ", but ".)" at the end of a line triggers the sentence-end
detection.

Apply a zero-width space to a few instances of this in share/man,
and also supply a missing full stop for an instance that occurred at
the end of a sentence.

Leave untouched several instances that are at the end of a sentence
or list element.

Reported by: 0mp (ieee80211.9)
00:54:24 - r315527
(4 days 7 hours ago)
by vangyzen
Affects: 
(11 files)
/head/sys/compat/freebsd32/*
/head/sys/kern/*
/head/sys/sys/*
Regenerate syscall files for r315526

Sponsored by: Dell EMC
00:51:12 - r315526
(4 days 7 hours ago)
by vangyzen
Affects: 
(19 files)
/head/*
Add clock_nanosleep()

Add a clock_nanosleep() syscall, as specified by POSIX.
Make nanosleep() a wrapper around it.

Attach the clock_nanosleep test from NetBSD. Adjust it for the
FreeBSD behavior of updating rmtp only when interrupted by a signal.
I believe this to be POSIX-compliant, since POSIX mentions the rmtp
parameter only in the paragraph about EINTR. This is also what
Linux does. (NetBSD updates rmtp unconditionally.)

Copy the whole nanosleep.2 man page from NetBSD because it is complete
and closely resembles the POSIX description. Edit, polish, and reword it
a bit, being sure to keep any relevant text from the FreeBSD page.

Reviewed by: kib, ngie, jilles
MFC after: 3 weeks
Relnotes: yes
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D10020
00:36:29 - r315525
(4 days 7 hours ago)
by jhb
Affects:  /head/usr.bin/truss/syscalls.c
Improve decoding of last arguments to ioctl() and sendto().

Decode the last argument to ioctl() as a pointer rather than an int.
Eventually this could use 'int' for the _IOWINT() case and pointers for
all others.

The last argument to sendto() is a socklen_t value, not a pointer.
00:31:21 - r315524
(4 days 7 hours ago)
by jhb
Affects:  /head/usr.bin/truss/syscall.h
/head/usr.bin/truss/syscalls.c
Decode arguments to madvise().
00:27:07 - r315523
(4 days 7 hours ago)
by jhb
Affects:  /head/usr.bin/truss/syscall.h
/head/usr.bin/truss/syscalls.c
Add a Sizet type for 'size_t' values and use it instead of Int.

Various size_t arguments were previously decoded as Int values instead
which would have truncated values above 2^31 on 64-bit systems.
00:22:13 - r315522
(4 days 7 hours ago)
by emaste
Affects: 
(4 files)
/head/contrib/binutils/ld/emulparams/*
/head/sys/conf/ldscript.amd64
/head/sys/conf/ldscript.i386
use INT3 instead of NOP for x86 binary padding

We should never end up executing the inter-function padding, so we
are better off faulting than silently carrying on to whatever function
happens to be next.

Note that LLD will soon do this by default (although it currently pads
with zeros).

Reviewed by: dim, kib
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10047
2017 - 03 - 18   (5 days ago)
23:59:50 - r315521
(4 days 8 hours ago)
by trasz
Affects: 
(3 files)
/stable/11/sys/cam/ctl/ctl.c
/stable/11/sys/cam/ctl/ctl.h
MFC r312622:

Add SCSI descriptors for USB Mass Storage.

Sponsored by: The FreeBSD Foundation
23:57:47 - r315520
(4 days 8 hours ago)
by trasz
Affects: 
(2 files)
/stable/11/sys/cam/ctl/ctl_frontend_iscsi.c
MFC r311283:

Don't release the cfiscsi session refcount too early. It wasn't
observed to fix any actual error, but it's the right thing to do
from the correctness point of view.
23:55:50 - r315519
(4 days 8 hours ago)
by trasz
Affects: 
(2 files)
/stable/11/sys/kern/vfs_lookup.c
MFC r311284:

Fix bug that would result in a kernel crash in some cases involving
a symlink and an autofs mount request. The crash was caused by namei()
calling bcopy() with a negative length, caused by numeric underflow:
in lookup(), in the relookup path, the ni_pathlen was decremented too
many times. The bug was introduced in r296715.

Big thanks to Alex Deiter for his help with debugging this.
23:37:00 - r315518
(4 days 8 hours ago)
by alc
Affects:  /head/sys/kern/imgact_elf.c
Avoid unnecessary calls to vm_map_protect() in elf_load_section().

Typically, when elf_load_section() unconditionally passed VM_PROT_ALL to
elf_map_insert(), it was needlessly enabling execute access on the
mapping, and it would later have to call vm_map_protect() to correct the
mapping's access rights. Now, instead, elf_load_section() always passes
its parameter "prot" to elf_map_insert(). So, elf_load_section() must
only call vm_map_protect() if it needs to remove the write access that
was temporarily granted to perform a copyout().

Reviewed by: kib
MFC after: 1 week
23:24:52 - r315517
(4 days 8 hours ago)
by trasz
Affects: 
(2 files)
/stable/11/sys/fs/autofs/autofs.c
MFC r308339:

Value returned by taskqueue_enqueue_timeout(9) is not an error; don't treat
it as such.
23:00:13 - r315516
(4 days 9 hours ago)
by truckman
Affects:  /head/sys/netpfil/ipfw/dn_aqm_pie.h
Change several constants used by the PIE algorithm from unsigned to signed.

 - PIE_MAX_PROB is compared to variable of int64_t and the type promotion
  rules can cause the value of that variable to be treated as unsigned.
  If the value is actually negative, then the result of the comparsion
  is incorrect, causing the algorithm to perform poorly in some
  situations. Changing the constant to be signed cause the comparision
  to work correctly.

 - PIE_SCALE is also compared to signed values. Fortunately they are
  also compared to zero and negative values are discarded so this is
  more of a cosmetic fix.

 - PIE_DQ_THRESHOLD is only compared to unsigned values, but it is small
  enough that the automatic promotion to unsigned is harmless.

Submitted by: Rasool Al-Saadi <ralsaadi@swin.edu.au>
MFC after: 1 week
22:19:23 - r315515
(4 days 9 hours ago)
by ae
Affects:  /stable/11/UPDATING
Add a note about IPsec update to the UPDATING. This is direct commit.
22:04:20 - r315514
(4 days 10 hours ago)
by ae
Affects: 
(87 files)
/stable/11/*
MFC r304572 (by bz):
  Remove the kernel optoion for IPSEC_FILTERTUNNEL, which was deprecated
  more than 7 years ago in favour of a sysctl in r192648.

MFC r305122:
  Remove redundant sanity checks from ipsec[46]_common_input_cb().

  This check already has been done in the each protocol callback.

MFC r309144,309174,309201 (by fabient):
  IPsec RFC6479 support for replay window sizes up to 2^32 - 32 packets.

  Since the previous algorithm, based on bit shifting, does not scale
  with large replay windows, the algorithm used here is based on
  RFC 6479: IPsec Anti-Replay Algorithm without Bit Shifting.
  The replay window will be fast to be updated, but will cost as many bits
  in RAM as its size.

  The previous implementation did not provide a lock on the replay window,
  which may lead to replay issues.

  Obtained from: emeric.poupon@stormshield.eu
  Sponsored by: Stormshield
  Differential Revision: https://reviews.freebsd.org/D8468

MFC r309143,309146 (by fabient):
  In a dual processor system (2*6 cores) during IPSec throughput tests,
  we see a lot of contention on the arc4 lock, used to generate the IV
  of the ESP output packets.

  The idea of this patch is to split this mutex in order to reduce the
  contention on this lock.

  Update r309143 to prevent false sharing.

  Reviewed by: delphij, markm, ache
  Approved by: so
  Obtained from: emeric.poupon@stormshield.eu
  Sponsored by: Stormshield
  Differential Revision: https://reviews.freebsd.org/D8130

MFC r313330:
  Merge projects/ipsec into head/.

  Small summary
  -------------

  o Almost all IPsec releated code was moved into sys/netipsec.
  o New kernel modules added: ipsec.ko and tcpmd5.ko. New kernel
  option IPSEC_SUPPORT added. It enables support for loading
  and unloading of ipsec.ko and tcpmd5.ko kernel modules.
  o IPSEC_NAT_T option was removed. Now NAT-T support is enabled by
  default. The UDP_ENCAP_ESPINUDP_NON_IKE encapsulation type
  support was removed. Added TCP/UDP checksum handling for
  inbound packets that were decapsulated by transport mode SAs.
  setkey(8) modified to show run-time NAT-T configuration of SA.
  o New network pseudo interface if_ipsec(4) added. For now it is
  build as part of ipsec.ko module (or with IPSEC kernel).
  It implements IPsec virtual tunnels to create route-based VPNs.
  o The network stack now invokes IPsec functions using special
  methods. The only one header file <netipsec/ipsec_support.h>
  should be included to declare all the needed things to work
  with IPsec.
  o All IPsec protocols handlers (ESP/AH/IPCOMP protosw) were removed.
  Now these protocols are handled directly via IPsec methods.
  o TCP_SIGNATURE support was reworked to be more close to RFC.
  o PF_KEY SADB was reworked:
  - now all security associations stored in the single SPI namespace,
  and all SAs MUST have unique SPI.
  - several hash tables added to speed up lookups in SADB.
  - SADB now uses rmlock to protect access, and concurrent threads
  can do SA lookups in the same time.
  - many PF_KEY message handlers were reworked to reflect changes
  in SADB.
  - SADB_UPDATE message was extended to support new PF_KEY headers:
  SADB_X_EXT_NEW_ADDRESS_SRC and SADB_X_EXT_NEW_ADDRESS_DST. They
  can be used by IKE daemon to change SA addresses.
  o ipsecrequest and secpolicy structures were cardinally changed to
  avoid locking protection for ipsecrequest. Now we support
  only limited number (4) of bundled SAs, but they are supported
  for both INET and INET6.
  o INPCB security policy cache was introduced. Each PCB now caches
  used security policies to avoid SP lookup for each packet.
  o For inbound security policies added the mode, when the kernel does
  check for full history of applied IPsec transforms.
  o References counting rules for security policies and security
  associations were changed. The proper SA locking added into xform
  code.
  o xform code was also changed. Now it is possible to unregister xforms.
  tdb_xxx structures were changed and renamed to reflect changes in
  SADB/SPDB, and changed rules for locking and refcounting.

  Obtained from: Yandex LLC
  Relnotes: yes
  Sponsored by: Yandex LLC
  Differential Revision: https://reviews.freebsd.org/D9352

MFC r313331:
  Add removed headers into the ObsoleteFiles.inc.

MFC r313561 (by glebius):
  Move tcp_fields_to_net() static inline into tcp_var.h, just below its
  friend tcp_fields_to_host(). There is third party code that also uses
  this inline.

MFC r313697:
  Remove IPsec related PCB code from SCTP.

  The inpcb structure has inp_sp pointer that is initialized by
  ipsec_init_pcbpolicy() function. This pointer keeps strorage for IPsec
  security policies associated with a specific socket.
  An application can use IP_IPSEC_POLICY and IPV6_IPSEC_POLICY socket
  options to configure these security policies. Then ip[6]_output()
  uses inpcb pointer to specify that an outgoing packet is associated
  with some socket. And IPSEC_OUTPUT() method can use a security policy
  stored in the inp_sp. For inbound packet the protocol-specific input
  routine uses IPSEC_CHECK_POLICY() method to check that a packet conforms
  to inbound security policy configured in the inpcb.

  SCTP protocol doesn't specify inpcb for ip[6]_output() when it sends
  packets. Thus IPSEC_OUTPUT() method does not consider such packets as
  associated with some socket and can not apply security policies
  from inpcb, even if they are configured. Since IPSEC_CHECK_POLICY()
  method is called from protocol-specific input routine, it can specify
  inpcb pointer and associated with socket inbound policy will be
  checked. But there are two problems:
  1. Such check is asymmetric, becasue we can not apply security policy
  from inpcb for outgoing packet.
  2. IPSEC_CHECK_POLICY() expects that caller holds INPCB lock and
  access to inp_sp is protected. But for SCTP this is not correct,
  becasue SCTP uses own locks to protect inpcb.

  To fix these problems remove IPsec related PCB code from SCTP.
  This imply that IP_IPSEC_POLICY and IPV6_IPSEC_POLICY socket options
  will be not applicable to SCTP sockets. To be able correctly check
  inbound security policies for SCTP, mark its protocol header with
  the PR_LASTHDR flag.

  Differential Revision: https://reviews.freebsd.org/D9538

MFC r313746:
  Add missing check to fix the build with IPSEC_SUPPORT and without MAC.

MFC r313805:
  Fix LINT build for powerpc.

  Build kernel modules support only when both IPSEC and TCP_SIGNATURE
  are not defined.

MFC r313922:
  For translated packets do not adjust UDP checksum if it is zero.

  In case when decrypted and decapsulated packet is an UDP datagram,
  check that its checksum is not zero before doing incremental checksum
  adjustment.

MFC r314339:
  Document that the size of AH ICV for HMAC-SHA2-NNN should be half of
  NNN bits as described in RFC4868.

  PR: 215978

MFC r314812:
  Introduce the concept of IPsec security policies scope.

  Currently are defined three scopes: global, ifnet, and pcb.
  Generic security policies that IKE daemon can add via PF_KEY interface
  or an administrator creates with setkey(8) utility have GLOBAL scope.
  Such policies can be applied by the kernel to outgoing packets and checked
  agains inbound packets after IPsec processing.
  Security policies created by if_ipsec(4) interfaces have IFNET scope.
  Such policies are applied to packets that are passed through if_ipsec(4)
  interface.
  And security policies created by application using setsockopt()
  IP_IPSEC_POLICY option have PCB scope. Such policies are applied to
  packets related to specific socket. Currently there is no way to list
  PCB policies via setkey(8) utility.

  Modify setkey(8) and libipsec(3) to be able distinguish the scope of
  security policies in the `setkey -DP` listing. Add two optional flags:
  '-t' to list only policies related to virtual *tunneling* interfaces,
  i.e. policies with IFNET scope, and '-g' to list only policies with GLOBAL
  scope. By default policies from all scopes are listed.

  To implement this PF_KEY's sadb_x_policy structure was modified.
  sadb_x_policy_reserved field is used to pass the policy scope from the
  kernel to userland. SADB_SPDDUMP message extended to support filtering
  by scope: sadb_msg_satype field is used to specify bit mask of requested
  scopes.

  For IFNET policies the sadb_x_policy_priority field of struct sadb_x_policy
  is used to pass if_ipsec's interface if_index to the userland. For GLOBAL
  policies sadb_x_policy_priority is used only to manage order of security
  policies in the SPDB. For IFNET policies it is not used, so it can be used
  to keep if_index.

  After this change the output of `setkey -DP` now looks like:
  # setkey -DPt
  0.0.0.0/0[any] 0.0.0.0/0[any] any
  in ipsec
  esp/tunnel/87.250.242.144-87.250.242.145/unique:145
  spid=7 seq=3 pid=58025 scope=ifnet ifname=ipsec0
  refcnt=1
  # setkey -DPg
  ::/0 ::/0 icmp6 135,0
  out none
  spid=5 seq=1 pid=872 scope=global
  refcnt=1

  Obtained from: Yandex LLC
  Sponsored by: Yandex LLC
  Differential Revision: https://reviews.freebsd.org/D9805

PR: 212018
Relnotes: yes
Sponsored by: Yandex LLC
21:44:42 - r315513
(4 days 10 hours ago)
by dchagin
Affects:  /vendor/tcsh/6.20.00
Tag tcsh 6.20.00 release.
21:41:53 - r315512
(4 days 10 hours ago)
by dchagin
Affects: 
(505 files)
/vendor/tcsh/dist/*
Import of tcsh-6.20.00
20:41:07 - r315511
(4 days 11 hours ago)
by jilles
Affects:  /head/bin/sh/arith.h
sh: Remove unused function declaration for arith_lex_reset().

Reported by: Robert Elz
20:16:23 - r315510
(4 days 11 hours ago)
by vangyzen
Affects:  /head/sys/compat/freebsd32/freebsd32_misc.c
/head/sys/compat/linux/linux_time.c
/head/sys/kern/kern_time.c
nanosleep: plug a kernel memory disclosure

nanosleep() updates rmtp on EINVAL. In that case, kern_nanosleep()
has not updated rmt, so sys_nanosleep() updates the user-space rmtp
by copying garbage from its stack frame. This is not only a kernel
memory disclosure, it's also not POSIX-compliant. Fix it to update
rmtp only on EINTR.

Reviewed by: jilles (via D10020), dchagin
MFC after: 3 days
Security: possibly
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D10044
19:59:21 - r315509
(4 days 12 hours ago)
by jhb
Affects:  /head/usr.bin/truss/syscall.h
/head/usr.bin/truss/syscalls.c
Decode arguments passed to kldsym() and kldunloadf().

This does not currently decode the kld_sym_lookup structure passed to
kldsym().
19:54:58 - r315508
(4 days 12 hours ago)
by ian
Affects:  /head/sys/arm/freescale/imx/imx53_machdep.c
Remove hardcoded bootverbose=1; imx53 systems boot using loader(8) and
users can set verbose if they want to.
19:27:16 - r315507
(4 days 12 hours ago)
by mav
Affects:  /head/sys/dev/isp/isp_freebsd.c
/head/sys/dev/isp/isp_target.c
Reorganize RQSTYPE_NOTIFY handling for chips <= 23xx.

There were two copies of the code: one in generic code was half-broken, and
another in platform code was never called. Leave only one in generic code
and working.

MFC after: 2 weeks
18:38:12 - r315506
(4 days 13 hours ago)
by dchagin
Affects:  /head/sys/compat/linsysfs/linsysfs.c
Glibc get_nprocs() and get_nprocs_conf() uses the sysfs cpu infrastructure
to get number of processors. Implement /sys/devices/system/cpu/.

MFC after: 1 month
18:34:29 - r315505
(4 days 13 hours ago)
by dchagin
Affects: 
(5 files)
/head/sys/amd64/*
/head/sys/compat/linux/*
/head/sys/i386/linux/linux_dummy.c
Implement getrandom() syscall.
Note. GRND_RANDOM option is not supported for now.

MFC after: 1 month
18:31:45 - r315504
(4 days 13 hours ago)
by jhb
Affects:  /head/usr.bin/truss/syscall.h
/head/usr.bin/truss/syscalls.c
Decode arguments passed to getfsstat().

Note that this does not yet decode the statfs structures returned by
getfsstat().
18:31:04 - r315503
(4 days 13 hours ago)
by dchagin
Affects:  /head/sys/compat/linux/linux_socket.c
As noted by Roel Bouwman Linux allows a large buffer size than the
struct ucred size. Fix this.

PR: 102956
Reported by: Roel Bouwman <roel at qsp nl>
MFC after: 1 week
18:26:56 - r315502
(4 days 13 hours ago)
by jhb
Affects:  /head/usr.bin/truss/syscall.h
/head/usr.bin/truss/syscalls.c
Decode flock() operation.
18:23:30 - r315501
(4 days 13 hours ago)
by dchagin
Affects: 
(4 files)
/head/sys/amd64/*
/head/sys/compat/linux/linux_socket.h
/head/sys/i386/linux/linux.h
To reduce code duplication move socket defines to the MI path.

MFC after: 1 week
18:21:41 - r315500
(4 days 13 hours ago)
by jhb
Affects:  /head/usr.bin/truss/syscall.h
/head/usr.bin/truss/syscalls.c
Decode file flags passed to *chflags*().

While here, decode arguments passed to fchflags() and chflagsat().
18:19:31 - r315499
(4 days 13 hours ago)
by dchagin
Affects:  /head/sys/compat/linux/linux_socket.c
Remove superflous break statment.

MFC after: 1 week
18:14:17 - r315498
(4 days 13 hours ago)
by dchagin
Affects:  /head/sys/compat/linux/linux_time.c
Check for negative nanoseconds.
Linux do that in timespec_valid().

Reported by: vangyzen@
MFC after: 1 week
18:12:09 - r315497
(4 days 14 hours ago)
by jhb
Affects:  /head/usr.bin/truss/syscall.h
/head/usr.bin/truss/syscalls.c
Decode arguments passed to posix_fadvise().
18:10:02 - r315496
(4 days 14 hours ago)
by jhb
Affects:  /head/usr.bin/truss/syscall.h
/head/usr.bin/truss/syscalls.c
Decode the arguments passed to cap_fcntls_get() and cap_fcntls_limit().
18:05:39 - r315495
(4 days 14 hours ago)
by trasz
Affects: 
(2 files)
/stable/11/usr.sbin/diskinfo/diskinfo.8
MFC r306161:

Small tweaks to the diskinfo(8) manual page, to make it more consistent
with others.
18:01:30 - r315494
(4 days 14 hours ago)
by trasz
Affects:  /stable/11/usr.sbin/diskinfo/diskinfo.8
/stable/11/usr.sbin/diskinfo/diskinfo.c
MFC r306160:

Add "diskinfo -i", a simple aio-based IOPS benchmark.
17:59:43 - r315493
(4 days 14 hours ago)
by trasz
Affects: 
(2 files)
/stable/11/usr.sbin/diskinfo/diskinfo.c
MFC r306129:

Reduce code duplication by factoring out the delta_t() function.
No functional changes.
17:58:41 - r315492
(4 days 14 hours ago)
by trasz
Affects: 
(2 files)
/stable/11/usr.sbin/diskinfo/diskinfo.c
MFC r306096:

Cosmetics - add missing newline.
17:57:47 - r315491
(4 days 14 hours ago)
by trasz
Affects: 
(2 files)
/stable/11/usr.sbin/diskinfo/diskinfo.c
MFC r306094:

Make it possible for diskinfo(8) to operate on files. This is useful
with -t and upcoming -i.
17:50:49 - r315490
(4 days 14 hours ago)
by ian
Affects:  /head/sys/arm/freescale/imx/imx51_ccm.c
Make the imx5 clocks driver work with vendor-supplied dts (which does not
supply the addresses for the DPLL register blocks) by hard-coding the
addresses in the driver source code. Yes, this is just as bad an idea as
it sounds, but we have no choice.

In the early days of using fdt data, when we were making up our own data
for each board, we defined 4 sets of memory mapped registers in the data.
The vendor-supplied data only provides the address of the CCM register
block, but not the 3 DPLL blocks. The linux driver has the DPLL physical
addresses (which differ by SOC type) hard-coded in the driver, and we
have no choice but to do the same thing if we want to run with the vendor-
supplied fdt data.

So now we use bus_space_map() to make the DPLL blocks accessible, choosing
the set of fixed addresses to map based on the soc id.
17:01:11 - r315489
(4 days 15 hours ago)
by mav
Affects:  /head/sys/dev/isp/isp_freebsd.c
/head/sys/dev/isp/isp_target.c
Move RQSTYPE_ABTS_RCVD parsing into generic code.

MFC after: 2 weeks
16:09:36 - r315488
(4 days 16 hours ago)
by mav
Affects:  /head/sys/dev/isp/isp_freebsd.c
/head/sys/dev/isp/isp_target.c
/head/sys/dev/isp/isp_target.h
Extend nt_lun to full 8 byte.

MFC after: 2 weeks
16:09:30 - r315487
(4 days 16 hours ago)
by jilles
Affects:  /head/bin/sh/expand.c
sh: Remove unused return value of subevalvar_misc().
16:07:28 - r315486
(4 days 16 hours ago)
by jilles
Affects: 
(4 files)
/stable/11/bin/sh/expand.c
/stable/11/bin/sh/tests/expansion/Makefile
/stable/11/bin/sh/tests/expansion/cmdsubst23.0
MFC r315005: sh: Fix executing wrong command with ${x#$(y)}$(z).

The parsed internal representation of words consists of a byte string with a
list of nodes (commands in command substitution). Each unescaped CTLBACKQ or
CTLBACKQ | CTLQUOTE byte corresponds to an entry in the list.

If param in ${param#%##%%word} is not set, the word is not expanded (in a
deviation of POSIX shared with other ash variants and ksh93). Erroneously,
the pointer in the list of commands (argbackq) was not advanced. This caused
the wrong command to be executed later if the outer word contained another
command substitution.

Example:
  echo "${unsetvar#$(echo a)}$(echo b)"
wrote "a" but should write "b".
15:42:22 - r315485
(4 days 16 hours ago)
by mav
Affects: 
(4 files)
/head/sys/dev/isp/*
Remove dead remnants of SPI target.

MFC after: 2 weeks
15:25:51 - r315484
(4 days 16 hours ago)
by badger
Affects:  /head/tests/sys/kern/ptrace_test.c
ptrace_test: eliminate assumption about thread scheduling

A couple of the ptrace tests make assumptions about which thread in a
multithreaded process will run after a halt. This makes the tests less
portable across branches, and susceptible to future breakage. Instead,
twiddle thread scheduling and priorities to match the tests'
expectation.

X-MFC with: r313992
Sponsored by: Dell EMC
13:58:25 - r315483
(4 days 18 hours ago)
by kevlo
Affects: 
(2 files)
/stable/11/sys/dev/wi/if_wi_pci.c
MFC r315294:
Fix unreachable code in wi_pci_resume().

PR: 217784
Submitted by: Svyatoslav <razmyslov at viva64.com>
Found by: PVS-Studio
13:42:08 - r315482
(4 days 18 hours ago)
by mav
Affects:  /head/sys/dev/isp/isp_freebsd.c
/head/sys/dev/isp/isp_target.c
Use isp_target_put_entry() in places where it can be.

This unifies the code and removes some duplication.

MFC after: 2 weeks
12:39:24 - r315481
(4 days 19 hours ago)
by mmokhi
Affects: 
(2 files)
/stable/10/sys/kern/sys_generic.c
MFC r314996:
Fix NULL pointer dereference and panic with shm file pread/pwrite.

PR: 217429
Approved by: dchagin
11:13:54 - r315480
(4 days 20 hours ago)
by bde
Affects: 
(4 files)
/head/sys/dev/*
/head/sys/kern/subr_terminal.c
/head/sys/teken/teken_subr_compat.h
Fix bright colors for syscons, and make them work for the first time
for vt. Restore syscons' rendering of background (bg) brightness as
foreground (fg) blinking and vice versa, and add rendering of blinking
as background brightness to vt.

Bright/saturated is conflated with light/white in the implementation
and in this description.

Bright colors were broken in all cases, but appeared to work in the
only case shown by "vidcontrol show". A boldness hack was applied
only in 1 layering-violation place (for some syscons sequences) where
it made some cases seem to work but was undone by clearing bold using
ANSI sequences, and more seriously was not undone when setting
ANSI/xterm dark colors so left them bright. Move this hack to drivers.

The boldness hack is only for fg brightness. Restore/add a similar hack
for bg brightness rendered as fg blinking and vice versa. This works
even better for vt, since vt changes the default text mode to give the
more useful bg brightness instead of fg blinking.

The brightness bit in colors was unnecessarily removed by the boldness
hack. In other cases, it was lost later by teken_256to8(). Use
teken_256to16() to not lose it. teken_256to8() was intended to be
used for bg colors to allow finer or bg-specific control for the more
difficult reduction to 8; however, since 16 bg colors actually work
on VGA except in syscons text mode and the conversion isn't subtle
enough to significantly in that mode, teken_256to8() is not used now.

There are still bugs, especially in vidcontrol, if bright/blinking
background colors are set.

Restore XOR logic for bold/bright fg in syscons (don't change OR
logic for vt). Remove broken ifdef on FG_UNDERLINE and its wrong
or missing bit and restore the correct hard-coded bit. FG_UNDERLINE
is only for mono mode which is not really supported.

Restore XOR logic for blinking/bright bg in syscons (in vt, add
OR logic and render as bright bg). Remove related broken ifdef
on BG_BLINKING and its missing bit and restore the correct
hard-coded bit. The same bit means blinking or bright bg depending
on the mode, and we want to ignore the difference everywhere.

Simplify conversions of attributes in syscons. Don't pretend to
support bold fonts. Don't support unusual encodings of brightness.
It is as good as possible to map 16 VGA colors to 16 xterm-16
colors. E.g., VGA brown -> xterm-16 Olive will be converted back
to VGA brown, so we don't need to convert to xterm-256 Brown. Teken
cons25 compatibility code already does the same, and duplicates some
small tables. This is mostly for the sc -> te direction. The other
direction uses teken_256to16() which is too generic.
10:48:37 - r315479
(4 days 21 hours ago)
by ae
Affects: 
(2 files)
/stable/11/sys/netinet/if_ether.c
MFC r315050:
  Fix the L2 address printed in the "arp: %s moved from %*D" message.

  In the r292978 struct llentry was changed and the ll_addr field become
  the pointer.

  PR: 217667
10:34:29 - r315478
(4 days 21 hours ago)
by mav
Affects:  /head/sys/dev/isp/isp_freebsd.c
/head/sys/dev/isp/isp_target.c
Do some notify acks cleanup.

ISPASYNC_TARGET_NOTIFY_ACK makes no sense without argument.

MFC after: 2 weeks
07:01:19 - r315477
(5 days 1 hour ago)
by bde
Affects:  /head/sys/ddb/db_expr.c
Fix right shifts on arches with db_expr_t larger than u_int (LP64 arches
in practice).

db_expr_t is a signed type, but right shifts are fudged to evaluate
them in an unsigned type, and the unsigned type was broken by hard-
coding it as 'unsigned', so casting to it lost the top bits on arches
with db_expr_t larger than u_int.

The unsigned type with the same size as db_expr_t is not declared;
assume that db_addr_t gives it. Fixing this properly is less important
than using the correct type for db_expr_t (originally always long for
C90, but always intmax_t since C99).
06:05:54 - r315476
(5 days 2 hours ago)
by alc
Affects: 
(2 files)
/stable/11/sys/kern/imgact_elf.c
MFC r314717,315085
  Style and punctuation fixes.

  Simplify the control flow and tidy up a comment in map_insert.
05:53:09 - r315475
(5 days 2 hours ago)
by alc
Affects: 
(3 files)
/stable/11/sys/kern/vfs_default.c
/stable/11/sys/vm/vm_object.c
MFC r315318
  Relax the locking requirements for vm_object_page_noreuse(). While
  reviewing all uses of OFF_TO_IDX(), I observed that
  vm_object_page_noreuse() is requiring an exclusive lock on the object
  when, in fact, a shared lock suffices.
05:48:26 - r315474
(5 days 2 hours ago)
by alc
Affects: 
(2 files)
/stable/11/sys/vm/vm_page.c
MFC r313186
  Over the years, the code and comments in vm_page_startup() have diverged
  in one respect. When determining how many page structures to allocate,
  contrary to what the comments say, the code does not account for the
  overhead of a page structure per page of physical memory. This revision
  changes the code to match the comments.
05:38:10 - r315473
(5 days 2 hours ago)
by alc
Affects: 
(2 files)
/stable/11/sys/vm/default_pager.c
MFC r310083
  Tidy up. Mostly, remove or replace stale comments. Most of the comments
  in this file actually described the operation of the swap pager, not the
  default pager. Given that this is the wrong place to discuss the
  implementation of the swap pager, it shouldn't come as a surprise that as
  the swap pager evolved these comments became increasingly stale. In
  addition, apply some style fixes, like modernizing a few remaining old-
  style function definitions.
05:25:23 - r315472
(5 days 2 hours ago)
by alc
Affects: 
(2 files)
/stable/11/sys/vm/vm_radix.c
MFC r309416
  Eliminate a stale comment; vm_radix_prealloc() was replaced in r254141.
03:55:29 - r315471
(5 days 4 hours ago)
by kib
Affects: 
(3 files)
/stable/11/sys/compat/freebsd32/freebsd32_misc.c
/stable/11/sys/kern/kern_event.c
MFC r315238:
Use designated initializers for kevent_copyops.
03:49:50 - r315470
(5 days 4 hours ago)
by kib
Affects: 
(4 files)
/stable/11/sys/kern/kern_event.c
/stable/11/sys/kern/kern_ktrace.c
/stable/11/sys/sys/ktrace.h
MFC r315155:
Ktracing kevent(2) calls with unusual arguments might leads to an
overly large allocation requests.

PR: 217435

MFC r315237:
Hide kev_iovlen() definition under #ifdef KTRACE.
01:37:20 - r315469
(5 days 6 hours ago)
by kp
Affects:  /head/sys/netpfil/pf/pf_ioctl.c
pf: Fix memory leak on vnet shutdown or unload

Rules are unlinked in shutdown_pf(), so we must call
pf_unload_vnet_purge(), which frees unlinked rules, after that, not
before.

Reviewed by: eri, bz
Differential Revision: https://reviews.freebsd.org/D10040
00:53:24 - r315468
(5 days 7 hours ago)
by emaste
Affects:  /head/lib/libc/string/memmem.c
/head/lib/libc/string/strstr.c
libc: add reference to two-way algorithm and bad shift table in memmem/strstr

Requested by: ed
00:51:39 - r315467
(5 days 7 hours ago)
by emaste
Affects:  /head/lib/libc/string/memmem.3
/head/lib/libc/string/memmem.c
/head/lib/libc/string/strstr.c
libc: Use musl's O(n) memmem and strstr

It is O(n) in the length of the haystack (big) string, and has special
cases for short needle (little) strings, of one to four bytes, to avoid
excessive overhead.

There are a small set of nearly trivial cases where the startup overhead
of the musl implementation makes it slightly slower -- for example, a 31
byte needle that matches the beginning of the haystack. It's faster for
non-trivial cases, and significantly so for inputs that trigger worst-
case behaviour of the previous implementation. As an example, in my
tests a 16K needle that matches the end of a 64K haystack is nearly
2000x faster with this implementation.

Reviewed by: bapt (earlier), ed (earlier)
Obtained from: musl (snapshot at commit c718f9fc)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2601
2017 - 03 - 17   (6 days ago)
22:57:37 - r315466
(5 days 9 hours ago)
by marius
Affects: 
(7 files)
/head/sys/dev/mmc/*
/head/sys/dev/sdhci/*
Again, fixes regarding style(4), to comments, includes and unused
parameters.
22:02:02 - r315465
(5 days 10 hours ago)
by landonf
Affects:  /head/sys/mips/broadcom/bcm_machdep.c
Add MIPS boot support for the BCM4706/Northstar ChipCommon core.

This adds support for matching against a core lookup table when performing
early boot core lookup, and includes the BCM4706/Northstar-specific
ChipCommon core ID in the set of supported ChipCommon cores.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D10033
21:40:14 - r315464
(5 days 10 hours ago)
by jhibbits
Affects: 
(17 files)
/head/sys/powerpc/*
Introduce 64-bit PowerPC Book-E support

Extend the Book-E pmap to support 64-bit operation. Much of this was taken from
Juniper's Junos FreeBSD port. It uses a 3-level page table (page directory
list -- PP2D, page directory, page table), but has gaps in the page directory
list where regions will repeat, due to the design of the PP2D hash (a 20-bit gap
between the two parts of the index). In practice this may not be a problem
given the expanded address space. However, an alternative to this would be to
use a 4-level page table, like Linux, and possibly reduce the available address
space; Linux appears to use a 46-bit address space. Alternatively, a cache of
page directory pointers could be used to keep the overall design as-is, but
remove the gaps in the address space.

This includes a new kernel config for 64-bit QorIQ SoCs, based on MPC85XX, with
the following notes:
* The DPAA driver has not yet been ported to 64-bit so is not included in the
  kernel config.
* This has been tested on the AmigaOne X5000, using a MD_ROOT compiled in
  (total size kernel+mdroot must be under 64MB).
* This can run both 32-bit and 64-bit processes, and has even been tested to run
  a 32-bit init with 64-bit children.

Many thanks to stevek and marcel for getting Juniper's FreeBSD patches open
sourced to be used here, and to stevek for reviewing, and providing some
historical contexts on quirks of the code.

Reviewed by: stevek
Obtained from: Juniper (in part)
MFC after: 2 months
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D9433
21:24:09 - r315463
(5 days 10 hours ago)
by erj
Affects:  /stable/10/sys/conf/files
ixgbe(4): Fix build breakage when only compiling ix(4)

PR: 217862
Reported by: lampa
Sponsored by: Intel Corporation
21:03:54 - r315462
(5 days 11 hours ago)
by mmokhi
Affects: 
(2 files)
/stable/11/sys/kern/sys_generic.c
MFC r314996
Fix NULL pointer dereference and panic with shm file pread/pwrite.

Approved by: dchagin
18:08:36 - r315461
(5 days 14 hours ago)
by bdrewery
Affects:  /head/share/mk/bsd.dep.mk
META_MODE: Fix not using .depend files when no OBJDIR is present.

By default bmake does not allow meta mode to work unless an OBJDIR is
present. It allows this if curdirok= is set with a value not starting
with [0NnFf], but usually it is "yes".

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
18:08:33 - r315460
(5 days 14 hours ago)
by bdrewery
Affects:  /head/sys/conf/kmod.mk
kmod: Fix building assym.o not building missing dependencies.

For instance, in the dtrace/dtrace module, building dtrace_asm.o wants
to build genassym.o first, but it doesn't build the missing ilinks
and if_*.h headers which are part of the OBJS_DEPEND_GUESS list
of dependencies to build if a .depend file is missing.

MFC after: 1 week
Sponsored by: Dell EMC Isilon
18:08:00 - r315459
(5 days 14 hours ago)
by bdrewery
Affects:  /head/sys/conf/kmod.mk
kmod: Fix depending on ILINKS for tracked DEPENDOBJS.

The objects that may be in the dependency graph may not match
${OBJS}. Ensure the ilink link is added as a dependency for
all of them when a .depend file is missing for that objfile.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
16:50:37 - r315458
(5 days 15 hours ago)
by asomers
Affects: 
(8 files)
/head/sys/netinet6/*
/head/tests/sys/netinet/fibs_test.sh
Constrain IPv6 routes to single FIBs when net.add_addr_allfibs=0

sys/netinet6/icmp6.c
  Use the interface's FIB for source address selection in ICMPv6 error
  responses.

sys/netinet6/in6.c
  In in6_newaddrmsg, announce arrival of local addresses on the
  interface's FIB only. In in6_lltable_rtcheck, use a per-fib ND6
  cache instead of a single cache.

sys/netinet6/in6_src.c
  In in6_selectsrc, use the caller's fib instead of the default fib.
  In in6_selectsrc_socket, remove a superfluous check.

sys/netinet6/nd6.c
  In nd6_lle_event, use the interface's fib for routing socket
  messages. In nd6_is_new_addr_neighbor, check all FIBs when trying
  to determine whether an address is a neighbor. Also, simplify the
  code for point to point interfaces.

sys/netinet6/nd6.h
sys/netinet6/nd6.c
sys/netinet6/nd6_rtr.c
  Make defrouter_select fib-aware, and make all of its callers pass in
  the interface fib.

sys/netinet6/nd6_nbr.c
  When inputting a Neighbor Solicitation packet, consider the
  interface fib instead of the default fib for DAD. Output NS and
  Neighbor Advertisement packets on the correct fib.

sys/netinet6/nd6_rtr.c
  Allow installing the same host route on different interfaces in
  different FIBs. If rt_add_addr_allfibs=0, only install or delete
  the prefix route on the interface fib.

tests/sys/netinet/fibs_test.sh
  Clear some expected failures, but add a skip for the newly revealed
  BUG217871.

PR: 196361
Submitted by: Erick Turnquist <jhujhiti@adjectivism.org>
Reported by: Jason Healy <jhealy@logn.net>
Reviewed by: asomers
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9451
15:40:24 - r315457
(5 days 16 hours ago)
by hselasky
Affects: 
(4 files)
/head/sys/compat/linuxkpi/common/include/linux/*
/head/sys/compat/linuxkpi/common/src/linux_current.c
/head/sys/compat/linuxkpi/common/src/linux_kthread.c
Implement get_pid_task(), pid_task() and some other PID helper
functions in the LinuxKPI. Add a usage atomic to the task_struct
structure to facilitate refcounting the task structure when returned
from get_pid_task(). The get_task_struct() and put_task_struct()
function is used to manage atomic refcounting. After this change the
task_struct should only be freed through put_task_struct().

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies
14:54:10 - r315456
(5 days 17 hours ago)
by vangyzen
Affects: 
(17 files)
/stable/11/sys/*
MFC r313821 r315277 r315286

Use inet_ntoa_r() instead of inet_ntoa() throughout the kernel.

inet_ntoa() cannot be used safely in a multithreaded environment
because it uses a static local buffer. Instead, use inet_ntoa_r()
with a buffer on the caller's stack, except for KTR messages.
KTR can correctly log the immediate integral values passed to it,
as well as constant strings, but not non-constant strings,
since they might change by the time ktrdump retrieves them.
Therefore, use hex notation in KTR messages.

Sponsored by: Dell EMC
14:18:52 - r315455
(5 days 17 hours ago)
by des
Affects:  /head/lib/libfetch/common.c
/head/lib/libfetch/fetch.c
/head/lib/libfetch/http.c
r308996 broke IP literals by assuming that a colon could only occur as
a separator between host and port, and using strchr() to search for it.
Rewrite fetch_resolve() so it handles bracketed literals correctly, and
remove similar code elsewhere to avoid passing unbracketed literals to
fetch_resolve(). Remove #ifdef INET6 so we still parse IP literals
correctly even if we do not have the ability to connect to them.

While there, fix an off-by-one error which caused HTTP 400 errors to be
misinterpreted as redirects.

PR: 217723
MFC after: 1 week
Reported by: bapt, bz, cem, ngie
13:49:05 - r315454
(5 days 18 hours ago)
by bde
Affects: 
(5 files)
/head/sys/amd64/*
/head/sys/i386/*
Don't access the reserved registers %dr4 and %dr5 on i386.

On the original i386, %dr[4-5] were unimplemented but not very clearly
reserved, so debuggers read them to print them. i386 was still doing
this.

On the original athlon64, %dr[4-5] are documented as reserved but are
aliased to %dr[6-7] unless CR4_DE is set, when accessing them traps.

On 2 of my systems, accessing %dr[4-5] trapped sometimes. On my Haswell
system, the apparent randomness was because the boot CPU starts with
CR4_DE set while all other CPUs start with CR4_DE clear. FreeBSD
doesn't support the data breakpoints enabled by CR4_DE and it never
changes this flag, so the flag remains different across CPUs and
the behaviour seemed inconsistent except while booting when the CPU
doesn't change.

The invalid accesses broke:
- read access for printing the registers in ddb "show watches" on CPUs
  with CR4_DE set
- read accesses in fill_dbregs() on CPUs with CR4_DE set. This didn't
  implement panic(3) since the user case always skipped %dr[4-5].
- write accesses in set_dbregs(). This also didn't affect userland.
  When it didn't trap, the aliasing made it fragile.

Don't print the dummy (zero) values of %dr[4-5] in "show watches" for
i386 or amd64. Fix style bugs near this printing.

amd64 also has space in the dbregs struct for the reserved %dr[8-15]
and already didn't print the dummy values for these, and never accessed
any of the 10 reserved debug registers.

Remove cpufuncs for making the invalid accesses. Even amd64 had these.
13:37:37 - r315453
(5 days 18 hours ago)
by kib
Affects:  /head/sys/kern/kern_sig.c
When clearing altsigstack settings on exec, do it to the right thread.

Diagnosed by: smh
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
13:31:24 - r315452
(5 days 18 hours ago)
by andrew
Affects:  /head/sys/boot/efi/loader/arch/arm64/start.S
Mark the EFI PE header as allocated. While ld.bfd doesn't seem to care
about not having this flag ld.lld fails to link without it.

Sponsored by: DARPA, AFRL
12:59:16 - r315451
(5 days 19 hours ago)
by andrew
Affects: 
(5 files)
/head/sys/arm/mv/*
/head/sys/conf/options.arm
Remove code for Marvell SoCs that lack a kernel config.

It seems to be old code from the armv6 project branch that never had a
kernel config.

Reviewed by: mmel
Sponsored by: ABT Systems Lrd
Differential Revision: https://reviews.freebsd.org/D7166
12:45:54 - r315450
(5 days 19 hours ago)
by andrew
Affects:  /head/sys/arm/qemu/virt_machdep.c
/head/sys/arm/qemu/virt_mp.c
/head/sys/dev/fdt/fdt_arm_platform.c
Make the default FDT implementation of platform_mp_setmaxid use the cpu
nodes from the DTB by default. This will allow us to enumerate the CPUs
without hard coding the CPU count into code.

Reviewed by: br
Sponsored by: ABT Systems Ltd
Differential Revision: https://reviews.freebsd.org/D9827
12:34:57 - r315449
(5 days 19 hours ago)
by smh
Affects:  /head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
Reduce ARC fragmentation threshold

As ZFS can request up to SPA_MAXBLOCKSIZE memory block e.g. during zfs recv,
update the threshold at which we start agressive reclamation to use
SPA_MAXBLOCKSIZE (16M) instead of the lower zfs_max_recordsize which
defaults to 1M.

PR: 194513
Reviewed by: avg, mav
MFC after: 1 month
Sponsored by: Multiplay
Differential Revision: https://reviews.freebsd.org/D10012
12:34:56 - r315448
(5 days 19 hours ago)
by andrew
Affects: 
(4 files)
/head/sys/arm/conf/IMX6
/head/sys/arm/freescale/imx/*
Move the IMX6 kernels to use PLATFORM_SMP. This is the last SMP config to
be migrated to this and will allow the removal of this option.

Reviewed by: ian
Sponsored by: ABT Systems Ltd
Differential Revision: https://reviews.freebsd.org/D9907
11:45:46 - r315447
(5 days 20 hours ago)
by robak
Affects:  /head/usr.sbin/bsdinstall/scripts/hardening
Revert changes introduced in r314036 on demand by jhb and bapt.

Approved by: bapt, jhb
11:45:16 - r315446
(5 days 20 hours ago)
by mav
Affects: 
(2 files)
/stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
MFC r309856: Postpone ZVOL media/block size caching till first open.

At least on FreeBSD there are no legal way to access media or get its
size without opening device/provider first. Postponing this caching
allows to skip several disk seeks per ZVOL/snapshot during import.

For HDD pool with 1 ZVOL in dev mode with 1000 snapshots this reduces
pool import time from 40 to 10 seconds.
11:44:16 - r315445
(5 days 20 hours ago)
by mav
Affects: 
(2 files)
/stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c
MFC r309833: Add missed vfs.zfs.zfetch.max_idistance sysctl.
11:43:14 - r315444
(5 days 20 hours ago)
by mav
Affects: 
(3 files)
/stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c
/stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
MFC r308099:
Add sysctls for zfs_immediate_write_sz and zvol_immediate_write_sz.
10:30:06 - r315443
(5 days 21 hours ago)
by hselasky
Affects: 
(4 files)
/head/sys/compat/linuxkpi/common/include/linux/*
/head/sys/compat/linuxkpi/common/src/linux_current.c
Implement minimalistic memory mapping structure, struct mm_struct, and
some associated helper functions in the LinuxKPI. Let the existing
linux_alloc_current() function allocate and initialize the new
structure and let linux_free_current() drop the refcount on the memory
mapping structure. When the mm_struct's refcount reaches zero, the
structure is freed.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies
08:02:46 - r315442
(6 days ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/uaccess.h
Add comment describing the use of pagefault_disable() and
pagefault_enable() in the LinuxKPI.

Suggested by: rpokala@
MFC after: 1 week
Sponsored by: Mellanox Technologies
07:56:20 - r315441
(6 days ago)
by mav
Affects: 
(9 files)
/stable/11/cddl/contrib/opensolaris/cmd/ztest/ztest.c
/stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/*
MFC r308782:
After some ZIL changes 6 years ago zil_slog_limit got partially broken
due to zl_itx_list_sz not updated when async itx'es upgraded to sync.
Actually because of other changes about that time zl_itx_list_sz is not
really required to implement the functionality, so this patch removes
some unneeded broken code and variables.

Original idea of zil_slog_limit was to reduce chance of SLOG abuse by
single heavy logger, that increased latency for other (more latency critical)
loggers, by pushing heavy log out into the main pool instead of SLOG. Beside
huge latency increase for heavy writers, this implementation caused double
write of all data, since the log records were explicitly prepared for SLOG.
Since we now have I/O scheduler, I've found it can be much more efficient
to reduce priority of heavy logger SLOG writes from ZIO_PRIORITY_SYNC_WRITE
to ZIO_PRIORITY_ASYNC_WRITE, while still leave them on SLOG.

Existing ZIL implementation had problem with space efficiency when it
has to write large chunks of data into log blocks of limited size. In some
cases efficiency stopped to almost as low as 50%. In case of ZIL stored on
spinning rust, that also reduced log write speed in half, since head had to
uselessly fly over allocated but not written areas. This change improves
the situation by offloading problematic operations from z*_log_write() to
zil_lwb_commit(), which knows real situation of log blocks allocation and
can split large requests into pieces much more efficiently. Also as side
effect it removes one of two data copy operations done by ZIL code WR_COPIED
case.

While there, untangle and unify code of z*_log_write() functions.
Also zfs_log_write() alike to zvol_log_write() can now handle writes crossing
block boundary, that may also improve efficiency if ZPL is made to do that.

Sponsored by: iXsystems, Inc.
07:52:56 - r315440
(6 days ago)
by mav
Affects: 
(2 files)
/stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
MFC r307397: Add vfs.zfs.zil_log_limit sysctl.

It is at least partially broken now, but that is another question.
04:16:14 - r315439
(6 days 3 hours ago)
by glebius
Affects:  /head/libexec/rpc.rstatd/rstat_proc.c
Remove unused vmmeter.
03:14:15 - r315438
(6 days 4 hours ago)
by jhibbits
Affects:  /head/share/man/man4/man4.powerpc/dtsec.4
Update dtsec man page with correct config requirements.
03:03:58 - r315437
(6 days 5 hours ago)
by sephe
Affects: 
(4 files)
/stable/10/sys/dev/hyperv/netvsc/hn_nvs.c
/stable/10/sys/dev/hyperv/netvsc/hn_rndis.c
/stable/10/sys/dev/hyperv/netvsc/if_hn.c
MFC 314382,314483-314485

314382
  hyperv/hn: Simplify RNDIS packet data offset calculation.

  Sponsored by: Microsoft
  Differential Revision: https://reviews.freebsd.org/D9699

314483
  hyperv/hn: Simplify RNDIS packet total length calculation.

  Sponsored by: Microsoft
  Differential Revision: https://reviews.freebsd.org/D9712

314484
  hyperv/hn: Make sure that RNDIS packet message is at least 4B aligned.

  Sponsored by: Microsoft
  Differential Revision: https://reviews.freebsd.org/D9713

314485
  hyperv/hn: Misaligned chimney sending buffers should not be used

  Sponsored by: Microsoft
  Differential Revision: https://reviews.freebsd.org/D9714
02:48:29 - r315436
(6 days 5 hours ago)
by sephe
Affects: 
(4 files)
/stable/11/sys/dev/hyperv/netvsc/hn_nvs.c
/stable/11/sys/dev/hyperv/netvsc/hn_rndis.c
/stable/11/sys/dev/hyperv/netvsc/if_hn.c
MFC: 314382-314485

314382
  hyperv/hn: Simplify RNDIS packet data offset calculation.

  Sponsored by: Microsoft
  Differential Revision: https://reviews.freebsd.org/D9699

314483
  hyperv/hn: Simplify RNDIS packet total length calculation.

  Sponsored by: Microsoft
  Differential Revision: https://reviews.freebsd.org/D9712

314484
  hyperv/hn: Make sure that RNDIS packet message is at least 4B aligned.

  Sponsored by: Microsoft
  Differential Revision: https://reviews.freebsd.org/D9713

314485
  hyperv/hn: Misaligned chimney sending buffers should not be used

  Sponsored by: Microsoft
  Differential Revision: https://reviews.freebsd.org/D9714
00:46:50 - r315435
(6 days 7 hours ago)
by allanjude
Affects: 
(6 files)
/head/contrib/top/*
/head/usr.bin/top/machine.c
Add ZFS compressed ARC stats to top(1)

Provides:
amount of compressed data
logical size of compressed data (how much it would have taken uncompressed)
compression ratio (logical size : total ARC size)
Overhead (space consumed for compression headers)

Example output:
ARC: 31G Total, 18G MFU, 9067M MRU, 2236K Anon, 615M Header, 2947M Other
  25G Compressed, 54G Uncompressed, 1.76:1 Ratio, 2265M Overhead

Reviewed by: jpaetzel, smh, imp, jhb (previous version)
MFC after: 2 week
Relnotes: yes
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D9829

 


Powered by Python FreeBSD support by secnetix GmbH & Co. KG

Page generated in 38 ms, 407 revisions printed. Current time is 2017-03-23 08:13:39. All times are in UTC/GMT.