]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoAdd myself (ultima) as a new port committer.
ultima [Thu, 8 Jun 2017 01:42:32 +0000 (01:42 +0000)]
Add myself (ultima) as a new port committer.

Reviewed by: matthew (mentor), lifanov (mentor)
Approved by: matthew (mentor), lifanov (mentor)
Differential Revision: https://reviews.freebsd.org/D11089

7 years agoRemove directories for the roff documentations which is built and installed
bapt [Thu, 8 Jun 2017 01:41:20 +0000 (01:41 +0000)]
Remove directories for the roff documentations which is built and installed
anymore

Reported by: trasz

7 years agoNew sentences start on new lines, fix two violations
allanjude [Thu, 8 Jun 2017 01:39:17 +0000 (01:39 +0000)]
New sentences start on new lines, fix two violations

Reviewed by: bcr
Sponsored by: BSDCan Dev Summit

7 years agoSHA-512 and Skein have been supported by the boot loader for some time.
allanjude [Thu, 8 Jun 2017 01:29:24 +0000 (01:29 +0000)]
SHA-512 and Skein have been supported by the boot loader for some time.

Submitted by: lifanov
Reviewed by: bcr
Sponsored by: BSDCan Dev Summit

7 years agoFix SMBFS when saved passwords are greater than 18 characters
jpaetzel [Thu, 8 Jun 2017 00:48:26 +0000 (00:48 +0000)]
Fix SMBFS when saved passwords are greater than 18 characters

PR: 132302
Submitted by: dhorn2000@gmail.com guru@unixarea.de
MFC after: 1 week

7 years agoFix src.conf.5 generation
bapt [Thu, 8 Jun 2017 00:41:25 +0000 (00:41 +0000)]
Fix src.conf.5 generation

When makeman is generating src.conf(5) it tries to test all variation of options
including WITH_DIRDEPS_BUILD. it results in an error when filemon(4) is not
loaded.

Export variables that are needed to prevent this behaviour.

Helped by: sjg

7 years agoRegenerate src.conf.5 after removal of groff
bapt [Thu, 8 Jun 2017 00:36:58 +0000 (00:36 +0000)]
Regenerate src.conf.5 after removal of groff

7 years agoRemove some workaround for an option that does not exists anymore.
bapt [Wed, 7 Jun 2017 23:42:37 +0000 (23:42 +0000)]
Remove some workaround for an option that does not exists anymore.

7 years agoRemove leftovers from groff removal
bapt [Wed, 7 Jun 2017 23:41:33 +0000 (23:41 +0000)]
Remove leftovers from groff removal

Reported by: rpokala

7 years agoFinish removal of groff
bapt [Wed, 7 Jun 2017 23:26:28 +0000 (23:26 +0000)]
Finish removal of groff

7 years agoRemove groff from base
bapt [Wed, 7 Jun 2017 23:00:34 +0000 (23:00 +0000)]
Remove groff from base

All manpages in base are now compatible with mandoc(1), all roff documentation
will be relocated in the doc tree. man(1) can now use groff from the ports tree
if it needs.

Also remove checknr(1) and colcrt(1) which are only useful with groff.

Approved by: (no objections on the mailing lists)

7 years agolibc: Remove futimens() and utimensat() compat stubs.
jilles [Wed, 7 Jun 2017 21:21:14 +0000 (21:21 +0000)]
libc: Remove futimens() and utimensat() compat stubs.

The futimens() and utimensat() compat stubs allowed using these functions on
kernels that did not have the system calls yet (10.2, old 11-current).

Also remove the documentation of the [ENOTSUP] error that could occur with
an old kernel.

A -DNO_CLEAN build may fail because the depend files refer to the deleted
files.

7 years agoAdd MLINKS for atf-sh(3) to each of the functions it implements
ngie [Wed, 7 Jun 2017 21:18:28 +0000 (21:18 +0000)]
Add MLINKS for atf-sh(3) to each of the functions it implements

This hopefully will make atf-sh(3) easier to understand for newcomers,
without having to go through the atf-sh(3) level of indirection.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoRemove incorrect manpage link I added for atf_check(1) in r319659 for
ngie [Wed, 7 Jun 2017 21:14:06 +0000 (21:14 +0000)]
Remove incorrect manpage link I added for atf_check(1) in r319659 for
completeness.

MFC after: never
Sponsored by: Dell EMC Isilon

7 years agoRevert r319659
ngie [Wed, 7 Jun 2017 21:11:32 +0000 (21:11 +0000)]
Revert r319659

I missed the fact that atf-sh(3) already documents atf_check(3). I'll
be adding an manpage link for that instead in the next commit.

MFC after: 1 week
MFC with: r319659
Sponsored by: Dell EMC Isilon

7 years agoAdd an MLINK for atf_check(1) -> atf-check(1)
ngie [Wed, 7 Jun 2017 21:03:27 +0000 (21:03 +0000)]
Add an MLINK for atf_check(1) -> atf-check(1)

This is being done to make the documentation for atf-check(1) easier to find/more
intuitive for new users, because atf_check is the atf-run(1) shell version of the
standalone atf-check(1) command, which is used in atf-sh(3) test programs.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agovm.defer_swapspace_pageouts was removed in r308474.
bdrewery [Wed, 7 Jun 2017 19:42:17 +0000 (19:42 +0000)]
vm.defer_swapspace_pageouts was removed in r308474.

Reported by: pstef

7 years agovm.defer_swapspace_pageouts was removed in r308474.
bdrewery [Wed, 7 Jun 2017 19:36:17 +0000 (19:36 +0000)]
vm.defer_swapspace_pageouts was removed in r308474.

7 years agoAdd more #ifdef arch checks to the linuxkpi
jhibbits [Wed, 7 Jun 2017 18:08:11 +0000 (18:08 +0000)]
Add more #ifdef arch checks to the linuxkpi

arm, mips, and powerpc all implement pmap_mapdev_attr() and pmap_unmapdev(),
so add those archs to the checks.  powerpc also includes the atomic_swap_*()
functions, so add that to the supported list as well.  Not tested except by
compiling powerpc.

Reviewed by: markj

7 years agoOriginally, this file could be compiled as a user-space application for
alc [Wed, 7 Jun 2017 16:04:34 +0000 (16:04 +0000)]
Originally, this file could be compiled as a user-space application for
testing purposes.  However, over the years, various changes to the kernel
have broken this feature.  This revision applies some fixes to get user-
space compilation working again.  There are no changes in this revision
to code that is used by the kernel.

MFC after: 3 days

7 years agoChange R88E_EFUSE_MAX_LEN to use the same value as the vendor's driver
kevlo [Wed, 7 Jun 2017 09:10:24 +0000 (09:10 +0000)]
Change R88E_EFUSE_MAX_LEN to use the same value as the vendor's driver
that contains the length of the efuse content.

Reviewed by: avos

7 years agoAdd some basic tests for chmod(1)
ngie [Wed, 7 Jun 2017 05:33:56 +0000 (05:33 +0000)]
Add some basic tests for chmod(1)

MFC after: 1 month
Sponsored by: Dell EMC Isilon

7 years agoProvide typedef for socket upcall function.
glebius [Wed, 7 Jun 2017 01:48:11 +0000 (01:48 +0000)]
Provide typedef for socket upcall function.
While here change so_gen_t type to modern uint64_t.

7 years agoRemove a piece of dead code.
glebius [Wed, 7 Jun 2017 01:21:34 +0000 (01:21 +0000)]
Remove a piece of dead code.

7 years agoWhen the input parameter node is NULL, memory is allocated to it.
stevek [Tue, 6 Jun 2017 22:17:55 +0000 (22:17 +0000)]
When the input parameter node is NULL, memory is allocated to it.
To later free the memory, introduce a new variable lnode to track when
this happens.

Submitted by: Thomas Rix <trix@juniper.net>
Reviewed by: emax
Approved by: sjg (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D9878

7 years agoBefore returning because of an memory allocation error, free the memory
stevek [Tue, 6 Jun 2017 21:51:04 +0000 (21:51 +0000)]
Before returning because of an memory allocation error, free the memory
already allocated to buf.

Found using clang's static analyzer - scan-build

Submitted by: Thomas Rix <trix@juniper.net>
Reviewed by: stevek
Approved by: sjg (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D9852

7 years agoAdd testcases for `cat -b`
ngie [Tue, 6 Jun 2017 21:50:00 +0000 (21:50 +0000)]
Add testcases for `cat -b`

MFC after: 1 month
Sponsored by: Dell EMC Isilon

7 years agoThe memory assigned to the local variable 'copy' needs to be freed.
stevek [Tue, 6 Jun 2017 21:40:35 +0000 (21:40 +0000)]
The memory assigned to the local variable 'copy' needs to be freed.

Found using clang's static analyzer - scan-build

Submitted by: Thomas Rix <trix@juniper.net>
Reviewed by: ed
Approved by: sjg (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D9663

7 years agosh: Call fc -e editor with interrupts enabled.
jilles [Tue, 6 Jun 2017 21:08:05 +0000 (21:08 +0000)]
sh: Call fc -e editor with interrupts enabled.

Starting the fc -e editor can execute arbitrary script, and executing
arbitrary script with INTOFF in effect may cause unexpected results.

This change (together with other changes) serves mainly to allow asserting
that INTOFF is not in effect when starting the evaluation of a node.

7 years agoAdd additional testcases for cat(1)
ngie [Tue, 6 Jun 2017 21:03:43 +0000 (21:03 +0000)]
Add additional testcases for cat(1)

Verify the following additional cases:
- -s (in isolation, in addition to the -se testcase obtained via the
      NetBSD test).
- -vt

Submitted by: shivansh
Reviewed by: asomers (earlier diff), ngie
MFC after: 1 month
Sponsored by: Google, Inc (GSoC 2017)
Differential Revision: D11020

7 years agoStarting in r118390, swaponsomething() began to reserve the blocks at the
alc [Tue, 6 Jun 2017 16:52:07 +0000 (16:52 +0000)]
Starting in r118390, swaponsomething() began to reserve the blocks at the
beginning of a swap area for a disk label.  However, neither r118390 nor
r118544, which increased the reservation from one to two blocks, correctly
accounted for these blocks when updating the variable "swap_pager_avail".
This change corrects that error.

Reviewed by: kib
MFC after: 5 days

7 years agoAdd basic tests for echo(1)
ngie [Tue, 6 Jun 2017 16:04:27 +0000 (16:04 +0000)]
Add basic tests for echo(1)

Verify that echo(1) does not...
- ... print the trailing newline character with option '-n'.
- ... print the trailing newline character when '\c' is appended to
      the end of the string.

Submitted by: shivansh
Reviewed by: asomers, ngie
MFC after: 1 month
Sponsored by: Google, Inc (GSoC 2017)
Differential Revision: D11036

7 years agoEnsure ${_CW} is uppercase when passing '-c' to mk-vmimage.sh,
gjb [Tue, 6 Jun 2017 14:08:54 +0000 (14:08 +0000)]
Ensure ${_CW} is uppercase when passing '-c' to mk-vmimage.sh,
otherwise with 'CLOUDWARE=vagrant-virtualbox', the path to the
configuration file may be incorrect.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoFix init order in the LinuxKPI for IDR support after recent changes.
hselasky [Tue, 6 Jun 2017 10:12:58 +0000 (10:12 +0000)]
Fix init order in the LinuxKPI for IDR support after recent changes.

CPU_FOREACH() is not available until SI_SUB_CPU at SI_ORDER_ANY
when the LinuxKPI is loaded as part of the kernel.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agotsearch_test: Test twalk & add some determinism.
will [Tue, 6 Jun 2017 03:40:45 +0000 (03:40 +0000)]
tsearch_test: Test twalk & add some determinism.

7 years agoWhen the function blist_fill() was added to the kernel in r107913, the swap
alc [Tue, 6 Jun 2017 03:32:17 +0000 (03:32 +0000)]
When the function blist_fill() was added to the kernel in r107913, the swap
pager used a different scheme for striping the allocation of swap space
across multiple devices.  And, although blist_fill() was intended to support
fill operations with large counts, the old striping scheme never performed a
fill larger than the stripe size.  Consequently, the misplacement of a
sanity check in blst_meta_fill() went undetected.  Now, moving forward in
time to r118390, a new scheme for striping was introduced that maintained a
blist allocator per device, but as noted in r318995, swapoff_one() was not
fully and correctly converted to the new scheme.  This change completes what
was started in r318995 by fixing the underlying bug in blst_meta_fill() that
stops swapoff_one() from simply performing a single blist_fill() operation.

Reviewed by: kib
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D11043

7 years agoJails: Optionally prevent jailed root from binding to privileged ports
allanjude [Tue, 6 Jun 2017 02:15:00 +0000 (02:15 +0000)]
Jails: Optionally prevent jailed root from binding to privileged ports

You may now optionally specify allow.noreserved_ports to prevent root
inside a jail from using privileged ports (less than 1024)

PR: 217728
Submitted by: Matt Miller <mattm916@pulsar.neomailbox.ch>
Reviewed by: jamie, cem, smh
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D10202

7 years agousr.sbin/sesutil: 'locate all off' does not deactivate empty slots
allanjude [Tue, 6 Jun 2017 02:03:22 +0000 (02:03 +0000)]
usr.sbin/sesutil: 'locate all off' does not deactivate empty slots

PR: 217409
Reported by: asomers
Reviewed by: asomers, bapt
MFC after: 1 week
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D10458

7 years agoRevert r319608, the dtb path was correct the first time. Sigh.
gjb [Mon, 5 Jun 2017 20:18:55 +0000 (20:18 +0000)]
Revert r319608, the dtb path was correct the first time.  Sigh.

MFC after: 3 days
MFC with: r319603, r319608
Sponsored by: The FreeBSD Foundation

7 years agoFix the source path for the cubieboard2 dtb hard link.
gjb [Mon, 5 Jun 2017 19:41:06 +0000 (19:41 +0000)]
Fix the source path for the cubieboard2 dtb hard link.

MFC after: 3 days
MFC with: r319603
Sponsored by: The FreeBSD Foundation

7 years agoThe variable "breakout" is used like a Boolean, so actually define it as
alc [Mon, 5 Jun 2017 18:07:56 +0000 (18:07 +0000)]
The variable "breakout" is used like a Boolean, so actually define it as
one.

Reviewed by: kib
MFC after: 5 days

7 years agoHalve the memory being internally allocated by the blist allocator. In
alc [Mon, 5 Jun 2017 17:14:16 +0000 (17:14 +0000)]
Halve the memory being internally allocated by the blist allocator.  In
short, half of the memory that is allocated to implement the radix tree is
wasted because we did not change "u_daddr_t" to be a 64-bit unsigned int
when we changed "daddr_t" to be a 64-bit (signed) int.  (See r96849 and
r96851.)

Reviewed by: kib, markj
Tested by: pho
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D11028

7 years agoCreate a hard link for sun7i-a20-cubieboard2.dtb to allow the
gjb [Mon, 5 Jun 2017 17:05:06 +0000 (17:05 +0000)]
Create a hard link for sun7i-a20-cubieboard2.dtb to allow the
cubieboard2 to find the correct dtb file.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoClarify -q is only for pgrep.
bdrewery [Mon, 5 Jun 2017 16:00:10 +0000 (16:00 +0000)]
Clarify -q is only for pgrep.

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agoANSIfy md5 functions
tsoome [Mon, 5 Jun 2017 11:55:26 +0000 (11:55 +0000)]
ANSIfy md5 functions

Update the function declarations.

Reviewed by: dim
Differential Revision: https://reviews.freebsd.org/D11055

7 years agoAdd sysctl vfs.ino64_trunc_error controlling action on truncating
kib [Mon, 5 Jun 2017 11:40:30 +0000 (11:40 +0000)]
Add sysctl vfs.ino64_trunc_error controlling action on truncating
inode number or link count for the ABI compat binaries.

Right now, and by default after the change, too large 64bit values are
silently truncated to 32 bits.  Enabling the knob causes the system to
return EOVERFLOW for stat(2) family of compat syscalls when some
values cannot be completely represented by the old structures.  For
getdirentries(2), knob skips the dirents which would cause non-trivial
truncation of d_ino.

EOVERFLOW error is specified by the X/Open 1996 LFS document
('Adding Support for Arbitrary File Sizes to the Single UNIX
Specification').

Based on the discussion with: bde
Sponsored by: The FreeBSD Foundation

7 years agoRemove unused tlb_write_random().
trasz [Mon, 5 Jun 2017 11:04:22 +0000 (11:04 +0000)]
Remove unused tlb_write_random().

Sponsored by: DARPA, AFRL

7 years agoRemove extraneous parentheses.
trasz [Mon, 5 Jun 2017 10:59:47 +0000 (10:59 +0000)]
Remove extraneous parentheses.

Sponsored by: DARPA, AFRL

7 years agoDecode arguments to dup, dup2, getdirentries, pread, and pwrite.
jhb [Mon, 5 Jun 2017 05:25:50 +0000 (05:25 +0000)]
Decode arguments to dup, dup2, getdirentries, pread, and pwrite.

- dup and dup2 print fd arguments in decimal.
- pread and pwrite are similar to read and write with the addition of the
  file offset.
- getdirentries displays the output entries as a string for now and also
  prints the value returned in *basep.  Eventually the buffer for
  getdirentries should perhaps be decoded as an array of dirent
  structures.

PR: 214885
Submitted by: Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.COM>

7 years agoMETA_MODE: Force a host tool rebuild for ino64 in r318736.
bdrewery [Mon, 5 Jun 2017 05:17:42 +0000 (05:17 +0000)]
META_MODE: Force a host tool rebuild for ino64 in r318736.

Sponsored by: Dell EMC Isilon

7 years agoMETA_MODE: Add framework to force rebuilding for major ABI changes.
bdrewery [Mon, 5 Jun 2017 05:17:39 +0000 (05:17 +0000)]
META_MODE: Add framework to force rebuilding for major ABI changes.

Normally META_MODE ignores host files for "meta mode" decisions on whether a
file should be rebuilt or not.  This is because a simple installworld can
update timestamps and cause the next build to rebuild all host tools, when the
previous ones may not have any changes in the source tree.  These tools are
normally still ABI compatible.  They are only rebuilt if NO_META_IGNORE_HOST is
set from the workaround/hack in r301467.

One of the major problems with this is when a host tool has objects spread
across many revisions that have mixed-ABI.  For example, if struct stat were to
change on the host, some objects for a tool may have different ideas of that
struct's definition.  If just 1 source file were modified and rebuilt and
linked into the tool, then that toll will have mixed-ABI objects and crash.
This exact thing happened with the ino64 commit in r301467 followed by a
trivial update to libbfd in r318750.  The resulting binary would crash in
buildworld.

Sponsored by: Dell EMC Isilon

7 years agoMETA_MODE: Allow not ignoring host headers with NO_META_IGNORE_HOST_HEADERS.
bdrewery [Mon, 5 Jun 2017 05:17:36 +0000 (05:17 +0000)]
META_MODE: Allow not ignoring host headers with NO_META_IGNORE_HOST_HEADERS.

See r301467 for more details on NO_META_IGNORE_HOST.  Usually the full
list of host ignores should have no real impact on the host tools.  The
headers however may reliably define what the ABI is for the host.  It
may be useful to allow using the headers for the build but still not
caring about things like /bin/sh, /lib/libedit.so, etc.

Sponsored by: Dell EMC Isilon

7 years agosh: Make sure to process SIGINT if SETINTON re-enables processing.
jilles [Sun, 4 Jun 2017 21:58:02 +0000 (21:58 +0000)]
sh: Make sure to process SIGINT if SETINTON re-enables processing.

If INTON re-enables interrupts, it processes any interrupt that occurred
while interrupts were disabled. Make SETINTON do the same.

7 years agotests/sys/aio: Add missing mode to open() calls with O_CREAT.
jilles [Sun, 4 Jun 2017 21:39:37 +0000 (21:39 +0000)]
tests/sys/aio: Add missing mode to open() calls with O_CREAT.

7 years ago[iwm] Remove support for fw older than -17 and -22
adrian [Sun, 4 Jun 2017 21:28:52 +0000 (21:28 +0000)]
[iwm] Remove support for fw older than -17 and -22

* iwm(4) didn't use any of these definitions yet, anyway.

Obtained from: dragonflybsd.git f95003b8f1f7382c8396a6d408e3072632afdd3d

7 years ago[iwmfw] bump built firmware now to version 22 for 7265D and 8000C.
adrian [Sun, 4 Jun 2017 21:28:03 +0000 (21:28 +0000)]
[iwmfw] bump built firmware now to version 22 for 7265D and 8000C.

7 years ago[iwmfw] 8000C ver 22 firmware.
adrian [Sun, 4 Jun 2017 21:27:39 +0000 (21:27 +0000)]
[iwmfw] 8000C ver 22 firmware.

7 years ago[iwmfw] add 7265D-22 firmware
adrian [Sun, 4 Jun 2017 21:26:31 +0000 (21:26 +0000)]
[iwmfw] add 7265D-22 firmware

7 years ago[ath_hal] add USB reset PLL work around for AR9331/AR9344 (Hornet/Wasp.)
adrian [Sun, 4 Jun 2017 21:21:44 +0000 (21:21 +0000)]
[ath_hal] add USB reset PLL work around for AR9331/AR9344 (Hornet/Wasp.)

It turns out that this is useful on hornet and wasp SoCs but it isn't
enabled in ye olde HAL /unless/ you were using a version from one of the
business units building USB targetted devices.  It eventually got fixed
for all of them as people started wanting to use the USB ports on their
SoCs (eg for flash storage, bluetooth, 4G/LTE widgets, etc.)

This is actually a fix from ath9k but I'm merging it with the available-but-
disabled code in the QCA reference HAL.

Tested:

* AR9331 SoC

7 years ago[iwm] Ignore IWM_DEBUG_LOG_MSG notifications.
adrian [Sun, 4 Jun 2017 21:14:23 +0000 (21:14 +0000)]
[iwm] Ignore IWM_DEBUG_LOG_MSG notifications.

* Firmware versions 21 and 22 generate some IWM_DEBUG_LOG_MSG notifications,
  which seem to be harmless. Avoid spamming the system log with
  "frame ... UNHANDLED (this should not happen)" messages.

Obtained from: dragonflybsd.git dda889ac57d8e5b46bb1b1ecf53c17a18481c7c8

7 years ago[iwm] Set command code for PHY_DB as well.
adrian [Sun, 4 Jun 2017 21:13:13 +0000 (21:13 +0000)]
[iwm] Set command code for PHY_DB as well.

Obtained from: dragonflybsd.git 58318c956a74382d1286ccabaf767012fdcfe1a2

7 years ago[iwm] Set correct state in smart-fifo configuration.
adrian [Sun, 4 Jun 2017 21:12:11 +0000 (21:12 +0000)]
[iwm] Set correct state in smart-fifo configuration.

Obtained from: dragonflybsd.git 666737f64b4f6dd42ffd9f0ace9fc46ccc1ebaab

7 years ago[iwm] Remove dead code from iwm_pcie_load_cpu_sections().
adrian [Sun, 4 Jun 2017 21:11:28 +0000 (21:11 +0000)]
[iwm] Remove dead code from iwm_pcie_load_cpu_sections().

* If device family is 8000 then iwm_pcie_load_cpu_sections()
  won't be called at all (iwm_pcie_load_cpu_sections_8000() is
  called in that case) so this piece of code never gets called.

Obtained from: dragonflybsd.git 3e9aaef308100a4d630feffc131e3aca2ae12f8a

7 years ago[iwm] Check for lar_disable tunable, and lar_enabled flag from NVM.
adrian [Sun, 4 Jun 2017 21:10:14 +0000 (21:10 +0000)]
[iwm] Check for lar_disable tunable, and lar_enabled flag from NVM.

* LAR can be disabled with the hw.iwm.lar.disable tunable now.

* On Family 8000 devices we need to check the lar_enabled flag from
  nvm_data in addition to the TLV_CAPA_LAR_SUPPORT flag from the firmware.

* Add a separate IWM_DEBUG_LAR debugging flag.

Obtained from: dragonflybsd.git 0593e39cb295aa996ecf789ed4990c3b255f1770

7 years ago[iwm] Move Smart Fifo handling into if_iwm_sf.c, sync with Linux iwlwifi.
adrian [Sun, 4 Jun 2017 21:05:58 +0000 (21:05 +0000)]
[iwm] Move Smart Fifo handling into if_iwm_sf.c, sync with Linux iwlwifi.

* This change also fixes a possible issue in the existing smart-fifo code,
  which set the IWM_SF_CFG_DUMMY_NOTIF_OFF bit on AC8260 chipsets, although
  that's only used in iwlwifi for Family 8000 chipsets connected via SDIO
  interface.

Obtained from: Dragonflybsd.git cb650b01526b0aeef3c4307d926e7f1428997d50

7 years agoAllow defining nofork builtins from builtins.def and move always-safe ones there.
bdrewery [Sun, 4 Jun 2017 21:02:48 +0000 (21:02 +0000)]
Allow defining nofork builtins from builtins.def and move always-safe ones there.

The generated code remains the same.

Reviewed by: jilles
Differential Revision: https://reviews.freebsd.org/D11042

7 years agosh: Fix INTOFF leak when a redirection on a compound command fails.
jilles [Sun, 4 Jun 2017 20:52:55 +0000 (20:52 +0000)]
sh: Fix INTOFF leak when a redirection on a compound command fails.

Reported by: bdrewery

7 years agoOn success, getrandom() Linux system call returns the number of bytes that
dchagin [Sun, 4 Jun 2017 18:35:30 +0000 (18:35 +0000)]
On success, getrandom() Linux system call returns the number of bytes that
were copied to the buffer supplied by the user.

PR:           219464
Submitted by: Maciej Pasternacki
Reported by:  Maciej Pasternacki
MFC after:    1 week

7 years agoRevert r319053 due to lack of sence. As pointed out by kib@ opt_global.h
dchagin [Sun, 4 Jun 2017 18:24:41 +0000 (18:24 +0000)]
Revert r319053 due to lack of sence. As pointed out by kib@ opt_global.h
contains such fundamental settings as e.g. SMP option and fake
opt_global.h almost never match real configured kernels.

Reported by: kib@

7 years agoStart to rename files with common or generic names to be SoC specific. The
andrew [Sun, 4 Jun 2017 09:11:14 +0000 (09:11 +0000)]
Start to rename files with common or generic names to be SoC specific. The
build system doesn't handle two files with the same name.

7 years agoDelete obsolete paragraph; primes(6) is now able to list primes for the
cperciva [Sun, 4 Jun 2017 02:45:18 +0000 (02:45 +0000)]
Delete obsolete paragraph; primes(6) is now able to list primes for the
full range up to 2^64 - 1.

MFC after: 1 week

7 years agoUsing results from
cperciva [Sun, 4 Jun 2017 02:36:37 +0000 (02:36 +0000)]
Using results from
    J. Sorenson and J. Webster, Strong pseudoprimes to twelve prime
    bases, Math. Comp. 86(304):985-1003, 2017.
teach primes(6) to enumerate primes up to 2^64 - 1.  Until Sorenson
and Webster's paper, we did not know how many strong speudoprime tests
were required when testing alleged primes between 3825123056546413051
and 2^64 - 1.

Reported by: Luiz Henrique de Figueiredo
Relnotes: primes(6) now enumerates primes beyond 3825123056546413050,
up to a new limit of 2^64 - 1.
MFC After: 1 week

7 years agonative-xtools: Connect makewhatis.
bdrewery [Sat, 3 Jun 2017 23:13:46 +0000 (23:13 +0000)]
native-xtools: Connect makewhatis.

This speeds up some port staging, namely perl.

7 years agoext2fs(4): Fix a null dererence and clean an unclear switch
cem [Sat, 3 Jun 2017 22:39:50 +0000 (22:39 +0000)]
ext2fs(4): Fix a null dererence and clean an unclear switch

Coverity warned that the switch statement fell through.  While this was
intentional, the pattern wasn't especially clear.  I just changed it to a
conventional if pattern.

Reported by: Coverity
CIDs: 1375851 (false positive), 1375853
Sponsored by: Dell EMC Isilon

7 years agoext2fs(4): Fix a number of broken flag checks
cem [Sat, 3 Jun 2017 22:30:30 +0000 (22:30 +0000)]
ext2fs(4): Fix a number of broken flag checks

Introduced in r319071.

Reported by: Coverity
CIDs: 137584713758481375849
Sponsored by: Dell EMC Isilon

7 years agoFix the ICMP6 handling for TCP.
tuexen [Sat, 3 Jun 2017 21:53:58 +0000 (21:53 +0000)]
Fix the ICMP6 handling for TCP.

The ICMP6 packets might not be contained in a single mbuf. So don't
assume this. Keep the IPv4 and IPv6 code in sync and make explicit
that the syncache code only need the TCP sequence number, not the
complete TCP header.

MFC after: 3 days
Sponsored by: Netflix, Inc.

7 years agoPort the Vybrid code to PLATFORM to help move it into GENERIC.
andrew [Sat, 3 Jun 2017 20:14:46 +0000 (20:14 +0000)]
Port the Vybrid code to PLATFORM to help move it into GENERIC.

7 years agoPort the Samsung ARM code to use PLATFORM and PLATFORM_SMP. This will help
andrew [Sat, 3 Jun 2017 20:02:12 +0000 (20:02 +0000)]
Port the Samsung ARM code to use PLATFORM and PLATFORM_SMP. This will help
move it into the GENERIC kernel config.

7 years agoPort the Xilinx code to use PLATFORM and PLATFORM_SMP. This will help move
andrew [Sat, 3 Jun 2017 19:11:32 +0000 (19:11 +0000)]
Port the Xilinx code to use PLATFORM and PLATFORM_SMP. This will help move
it to be part of the armv6 GENERIC kernel.

7 years agoFix bin/dd/dd2_tests:seek_overflow on UFS and TMPFS
asomers [Sat, 3 Jun 2017 18:29:18 +0000 (18:29 +0000)]
Fix bin/dd/dd2_tests:seek_overflow on UFS and TMPFS

Split the postive and negative parts into separate test cases.  The positive
test case can only run on ZFS, because only ZFS supports files that large.

PR: 219757
Reported by: ngie
MFC after: 18 days
X-MFC-with: 319339

7 years agoRemove TODO for sub testcases added for bug 212160
ngie [Sat, 3 Jun 2017 18:20:23 +0000 (18:20 +0000)]
Remove TODO for sub testcases added for bug 212160

On closer inspection, the past failures no longer occur on ^/head.

PR: 212160
Sponsored by: Dell EMC Isilon

7 years agoFix the testplan after ^/head@r318960
ngie [Sat, 3 Jun 2017 18:12:00 +0000 (18:12 +0000)]
Fix the testplan after ^/head@r318960

The number of executed testcases is 128, not 126.

MFC after: 18 days
MFC with: r318960
Sponsored by: Dell EMC Isilon

7 years agoDon't execute the TODO cases in a subshell
ngie [Sat, 3 Jun 2017 18:10:04 +0000 (18:10 +0000)]
Don't execute the TODO cases in a subshell

This messes up the testcase counter, as seen in bug 219756.

PR: 212160, 219756
Sponsored by: Dell EMC Isilon

7 years agoMark :seek_overflow as an expected failure
ngie [Sat, 3 Jun 2017 17:59:10 +0000 (17:59 +0000)]
Mark :seek_overflow as an expected failure

MFC after: 18 days
MFC with: r319339
PR: 219757
Sponsored by: Dell EMC Isilon

7 years agoStylistic tweaks
ngie [Sat, 3 Jun 2017 17:56:31 +0000 (17:56 +0000)]
Stylistic tweaks

Move opening braces of functions from the last column to column 0.

MFC after: 18 days
MFC with: r319339
Sponsored by: Dell EMC Isilon

7 years agoEliminate duplication of the pmap and pv list unlock operations in
alc [Sat, 3 Jun 2017 17:24:13 +0000 (17:24 +0000)]
Eliminate duplication of the pmap and pv list unlock operations in
pmap_enter() by implementing a single return path.  Otherwise, the
duplication will only increase with the upcoming support for psind == 1.

Reviewed by: kib (some time ago)

7 years agoStop making cpu_initclocks weak when using event timers. A weak symbol
andrew [Sat, 3 Jun 2017 16:24:17 +0000 (16:24 +0000)]
Stop making cpu_initclocks weak when using event timers. A weak symbol
could be overridden in the SoC specific code, but this would break GENERIC
as it is likely to be incorrect.

Remove the versatile implementation of cpu_initclocks as it's unneeded.

7 years agoThe data type returned by vmoff() is too narrow in its range. This could
alc [Sat, 3 Jun 2017 16:19:33 +0000 (16:19 +0000)]
The data type returned by vmoff() is too narrow in its range.  This could
break the transmission of files longer than 4 GB on 32-bit architectures.

Reviewed by: glebius, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D10019

7 years agoMitigate several problems with the softdep_request_cleanup() on busy
kib [Sat, 3 Jun 2017 16:18:50 +0000 (16:18 +0000)]
Mitigate several problems with the softdep_request_cleanup() on busy
host.

Problems start appearing when there are several threads all doing
operations on a UFS volume and the SU workqueue needs a cleanup.  It is
possible that each thread calling softdep_request_cleanup() owns the
lock for some dirty vnode (e.g. all of them are executing mkdir(2),
mknod(2), creat(2) etc) and all vnodes which must be flushed are locked
by corresponding thread. Then, we get all the threads simultaneously
entering softdep_request_cleanup().

There are two problems:
- Several threads execute MNT_VNODE_FOREACH_ALL() loops in parallel.  Due
  to the locking, they quickly start executing 'in phase' with the speed
  of the slowest thread.
- Since each thread already owns the lock for a dirty vnode, other threads
  non-blocking attempt to lock the vnode owned by other thread fail,
  and loops executing without making the progress.
Retry logic does not allow the situation to recover.  The result is
a livelock.

Fix these problems by making the following changes:
- Allow only one thread to enter MNT_VNODE_FOREACH_ALL() loop per mp.
  A new flag FLUSH_RC_ACTIVE guards the loop.
- If there were failed locking attempts during the loop, abort retry
  even if there are still work items on the mp work list.  An
  assumption is that the items will be cleaned when other thread
  either fsyncs its vnode, or unlock and allow yet another thread to
  make the progress.

It is possible now that some calls would get undeserved ENOSPC from
ffs_alloc(), because the cleanup is not aggressive enough. But I do
not see how can we reliably clean up workitems if calling
softdep_request_cleanup() while still owning the vnode lock. I thought
about scheme where ffs_alloc() returns ERESTART and saves the retry
counter somewhere in struct thread, to return to the top level, unlock
the vnode and retry.  But IMO the very rare (and unproven) spurious
ENOSPC is not worth the complications.

Reported and tested by: pho
Style and comments by: mckusick
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoAdd MULTIDELAY support to the mpcore timer driver. This is needed when
andrew [Sat, 3 Jun 2017 15:56:54 +0000 (15:56 +0000)]
Add MULTIDELAY support to the mpcore timer driver. This is needed when
using this with GENERIC.

While here remove the weak symbol, it doesn't seem to be needed anymore.

7 years agoAdd MULTIDELAY support to the sp804 driver.
andrew [Sat, 3 Jun 2017 15:48:03 +0000 (15:48 +0000)]
Add MULTIDELAY support to the sp804 driver.

7 years agoAdd MULTIDELAY to the Beaglebone kenrel config to help moving it to GENERIC.
andrew [Sat, 3 Jun 2017 15:40:34 +0000 (15:40 +0000)]
Add MULTIDELAY to the Beaglebone kenrel config to help moving it to GENERIC.

7 years agoEnable MULTIDELAY in the i.MX5 kernel configs. This will help adding them
andrew [Sat, 3 Jun 2017 15:39:23 +0000 (15:39 +0000)]
Enable MULTIDELAY in the i.MX5 kernel configs. This will help adding them
to GENERIC.

7 years agoRemove RT1310 from universe as it fails to build.
andrew [Sat, 3 Jun 2017 14:45:46 +0000 (14:45 +0000)]
Remove RT1310 from universe as it fails to build.

7 years agomakefs: rename variable for NetBSD diff reduction
emaste [Sat, 3 Jun 2017 14:28:19 +0000 (14:28 +0000)]
makefs: rename variable for NetBSD diff reduction

7 years agoDecode the 'who' argument passed to getrusage().
jhb [Sat, 3 Jun 2017 14:22:15 +0000 (14:22 +0000)]
Decode the 'who' argument passed to getrusage().

Add a new sysdecode_getrusage_who() which decodes the RUSAGE_* constant
passed as the first argument to getrusage().  Use this function in both
kdump and truss to decode the first argument to getrusage().

PR: 215448
Submitted by: Anton Yuzhaninov <citrin+pr@citrin.ru>
MFC after: 1 month

7 years agoClean possible td_su reference on the struct mount being unmounted as
kib [Sat, 3 Jun 2017 14:15:14 +0000 (14:15 +0000)]
Clean possible td_su reference on the struct mount being unmounted as
the last step of ffs_unmount().

It is possible that the mount point is recorded for cleanup in AST
context while softdep flush is executed during unmount.  The workitems
are flushed by other means for the unmount, but the stray reference to
struct mount blocks destruction of mount.  Check for the situation and
manually call vfs_rel() before returning from ffs_unmount().

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoEnsure that cached struct thread does not keep spurious td_su
kib [Sat, 3 Jun 2017 14:12:17 +0000 (14:12 +0000)]
Ensure that cached struct thread does not keep spurious td_su
reference on an UFS mount point.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoAdd a cross-reference to sysdecode_socket_protocol(3).
jhb [Sat, 3 Jun 2017 14:10:09 +0000 (14:10 +0000)]
Add a cross-reference to sysdecode_socket_protocol(3).

7 years agotsan: set noexec stack on aarch64
emaste [Sat, 3 Jun 2017 13:13:57 +0000 (13:13 +0000)]
tsan: set noexec stack on aarch64

This may be refined upstream.

Reviewed by: dim
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11034