]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoImport mandoc snapshot 2017-06-08
bapt [Thu, 8 Jun 2017 19:40:00 +0000 (19:40 +0000)]
Import mandoc snapshot 2017-06-08

It implements missing man(7) macros used in base by kerberos/ntp and makes them
supported by mandoc.

This import should have been done before the removal of groff.

Reported by: gordon

7 years agoImport mandoc 2017-06-08
bapt [Thu, 8 Jun 2017 19:29:07 +0000 (19:29 +0000)]
Import mandoc 2017-06-08

7 years agoAdd tests for ln(1)
asomers [Thu, 8 Jun 2017 19:09:55 +0000 (19:09 +0000)]
Add tests for ln(1)

* Verify that when creating a hard link to a symbolic link, '-L' option
  creates a hard link to the target of the symbolic link
* Verify that when creating a hard link to a symbolic link, '-P' option
  creates a hard link to the symbolic link itself
* Verify that if the target file already exists, '-f' option unlinks it so
  that link may occur
* Verify that if the target file or directory is a symbolic link, '-shf'
  option prevents following the link
* Verify that if the target file or directory is a symbolic link, '-snf'
  option prevents following the link
* Verify that '-s' option creates a symbolic link
* Verify that '-w' option produces a warning if the source of a symbolic
  link does not currently exist

Submitted by: shivansh
Reviewed by: asomers, ngie
MFC after: 1 month
Sponsored by: Google, Inc (GSoC 2017)
Differential Revision: https://reviews.freebsd.org/D11084

7 years agoCorrect an obsolete path to delete.
jkim [Thu, 8 Jun 2017 18:20:32 +0000 (18:20 +0000)]
Correct an obsolete path to delete.

7 years agoBump _FreeBSD_version after removal of groff
bapt [Thu, 8 Jun 2017 17:06:16 +0000 (17:06 +0000)]
Bump _FreeBSD_version after removal of groff

Reported by: antoine

7 years agoremove xo_color_t dup typedef
phil [Thu, 8 Jun 2017 17:00:40 +0000 (17:00 +0000)]
remove xo_color_t dup typedef

7 years agoAdd function to dump PCIE MBUS decoding windows and bars
zbb [Thu, 8 Jun 2017 16:57:06 +0000 (16:57 +0000)]
Add function to dump PCIE MBUS decoding windows and bars

This commit allows to dump PCIE MBUS and bars configuration
for Marvell platforms.

Submitted by:   Michal Mazur <mkm@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Netgate
Differential revision: https://reviews.freebsd.org/D10908

7 years agoRestore DTS node of PCIe controller for A38X boards
zbb [Thu, 8 Jun 2017 16:55:58 +0000 (16:55 +0000)]
Restore DTS node of PCIe controller for A38X boards

Add pcie-controller node as a bus-parent of pcie nodes for Armada38x
boards. This reduces diff between Linux and FreeBSD PCIe device tree
representation to the minimum. This commit also allows for using multiple
PCIe ports, thanks to the recent driver updates, which support such
hierarchy. Restore original PCIe nodes in armada-385.dtsi and
apply necessary changes in hitherto unused armada-380.dtsi.

Submitted by: Michal Mazur <mkm@semihalf.com>
Marcin Wojtas <mw@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield, Netgate
Differential revision: https://reviews.freebsd.org/D10907

7 years agoSupport multi-port PCIe hierarchy in Marvell boards DTS
zbb [Thu, 8 Jun 2017 16:54:02 +0000 (16:54 +0000)]
Support multi-port PCIe hierarchy in Marvell boards DTS

This commit is another part of preparation for PCIe multi-port
support for Marvell SoCs. Some device trees include pcie-controller
node as a bus-parent of pcie nodes. This patch adds support for
new bus, collects and configures device informations and finally
adds PCIB devices as a childs of pcie-controller in Newbus hierarchy.

Submitted by: Marcin Mazurek <mma@semihalf.com>
Obtained form: Semihalf
Sponsored by: Stormshield
Reviewed by:    https://reviews.freebsd.org/D10906

7 years agoFix PCIe window decoding on Armada 38x
zbb [Thu, 8 Jun 2017 16:51:46 +0000 (16:51 +0000)]
Fix PCIe window decoding on Armada 38x

Original PCIe nodes for Marvell SoCs consists of ports' nodes
under main controller node. In order to properly parse
this kind of representation in DT a mechanism for traversing
through the tree required an update. Moreover, processing FDT
data consisting of more than 2 cells had to be fixed,
because the 'reg' property of mrvl,pcie node have additional
parameter in front of 64-bit address. It should be skipped
by default. This commit works properly with old mrvl,pcie
representation for Kirkwood and ArmadaXP SoCs.

Submitted by: Wojciech Macek <wma@semihalf.com>
Michal Mazur <mkm@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield, Netgate
Differential revision: https://reviews.freebsd.org/D10905

7 years agoEnable MBUS bridge configuration in mv_rtc driver
zbb [Thu, 8 Jun 2017 16:48:09 +0000 (16:48 +0000)]
Enable MBUS bridge configuration in mv_rtc driver

This patch fixes sporadic problems with updating time
with mv_rtc driver by configuring access to it via MBUS.
For this purpose already existing second set of resources
in rtc@3800 node of Armada 38x DT is used.

Submitted by: Dominik Ermel <der@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential revision: https://reviews.freebsd.org/D10901

7 years agoAdd reset capability to mv_rtc driver
zbb [Thu, 8 Jun 2017 16:46:38 +0000 (16:46 +0000)]
Add reset capability to mv_rtc driver

This commit enables optional reset of the RTC, in case
its registers' contents did not sustain the reboot or power-off/on
sequence. Without it, further usage of RTC is impossible
(e.g. writing values to RTC_TIME register will not succeed).

The reset is performed only if Clock Correction register
does not comprise RTC_NOMINAL_TIMING, what helps to distinguish,
whether the software configured RTC before or it comprises
the default value.

Submitted by: Bartosz Szczepanek <bsz@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential revision: https://reviews.freebsd.org/D10900

7 years agoFix an off-by-one error in the VM page array on some systems.
jhb [Thu, 8 Jun 2017 16:18:41 +0000 (16:18 +0000)]
Fix an off-by-one error in the VM page array on some systems.

r31386 changed how the size of the VM page array was calculated to be
less wasteful.  For most systems, the amount of memory is divided by
the overhead required by each page (a page of data plus a struct vm_page)
to determine the maximum number of available pages.  However, if the
remainder for the first non-available page was at least a page of data
(so that the only memory missing was a struct vm_page), this last page
was left in phys_avail[] but was not allocated an entry in the VM page
array.  Handle this case by explicitly excluding the page from
phys_avail[].

Reviewed by: alc
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D11000

7 years agoWhen allocating swap blocks, if the available number of free blocks in a
alc [Thu, 8 Jun 2017 15:48:54 +0000 (15:48 +0000)]
When allocating swap blocks, if the available number of free blocks in a
subtree is already zero, then setting the "largest contiguous free block"
hint for that subtree to anything other than zero makes no sense.  To be
clear, assigning a value to the hint that is too large is not a correctness
problem, only a pessimization.

Dragonfly BSD has applied the same change to blst_meta_alloc() but not
blst_meta_fill().

MFC after: 6 weeks

7 years agoImport libxo-0.8.0:
phil [Thu, 8 Jun 2017 13:04:01 +0000 (13:04 +0000)]
Import libxo-0.8.0:
 - addition of --libxo colors=xxxxx color map (so I never see "blue")
 - fix bugs from -fsanitize=address and =undefined
 - utf-8 changes (remove support fore 6 byte utf-8 values, which are "historical")
 - add comments
 - fix man pages
 - update test cases

Submitted by: phil
Reviewed by: sjg
Approved by: sjg (mentor)

7 years agohyperv/pcib: use the device serial number as PCI domain
dexuan [Thu, 8 Jun 2017 12:11:30 +0000 (12:11 +0000)]
hyperv/pcib: use the device serial number as PCI domain

Currently the PCI domain is initialized with the instance GUID in
vmbus_pcib_attach(). It turns out the GUID can change across VM reboot,
while some users want a persistent value for PCI domain. The solution is
that we can change to use the device serial number, which starts with 1
and is unique within a VM.

Obtained from: Haiyang Zhang
MFC after: 1 day
Sponsored by: Microsoft

7 years agoDecode arguments passed to msync().
jhb [Thu, 8 Jun 2017 08:10:57 +0000 (08:10 +0000)]
Decode arguments passed to msync().

7 years agoDecode flags passed to mount(), nmount(), and unmount().
jhb [Thu, 8 Jun 2017 08:07:51 +0000 (08:07 +0000)]
Decode flags passed to mount(), nmount(), and unmount().

7 years agoThis code was missing socket unlock and socket buffer lock, but it
glebius [Thu, 8 Jun 2017 06:37:11 +0000 (06:37 +0000)]
This code was missing socket unlock and socket buffer lock, but it
worked since right now these two locks are the same.

7 years agoThe desired lock here is socket buffer, not socket.
glebius [Thu, 8 Jun 2017 06:34:09 +0000 (06:34 +0000)]
The desired lock here is socket buffer, not socket.

Right now they match, but won't in future.

7 years agoFix a degenerate case when soisdisconnected() would call soisconnected().
glebius [Thu, 8 Jun 2017 06:16:47 +0000 (06:16 +0000)]
Fix a degenerate case when soisdisconnected() would call soisconnected().

This happens when closing a socket with upcall, and trace is: soclose()->
... protocol ... -> soisdisconnected() -> socantrcvmore_locked() ->
sowakeup() -> soisconnected().

Right now this case is innocent for two reasons.  First, soisconnected()
doesn't clear SS_ISDISCONNECTED flag.  Second, the mutex to lock the
socket is the socket receive buffer mutex, and sodisconnected() first
disables the receive buffer. But in future code, the mutex to lock
socket is different to buffer mutex, and we would get undesired mutex
recursion.

The fix is to check SS_ISDISCONNECTED flag before calling upcall.

7 years agoMake the test to leave one connection on the incomplete queue
glebius [Thu, 8 Jun 2017 06:13:53 +0000 (06:13 +0000)]
Make the test to leave one connection on the incomplete queue
before exiting.  This examines some race conditions in kernel.

7 years agoImprove this unit test: make sure that the accept filter actually works.
glebius [Thu, 8 Jun 2017 05:12:11 +0000 (05:12 +0000)]
Improve this unit test: make sure that the accept filter actually works.

Before this test just checked scenario of setting and removing the accept
filter at different states of the socket.  Now it also checks that accept
filter works: we connect to the server, and then check that we can't accept,
then we send 1 byte of data and check again.

7 years agoMake the VNC authentication build with LibreSSL on HardenedBSD and TrueOS.
araujo [Thu, 8 Jun 2017 04:54:15 +0000 (04:54 +0000)]
Make the VNC authentication build with LibreSSL on HardenedBSD and TrueOS.

PR: 219790
Submitted by: Shirkdog <mshirk@daemon-security.com>
Reviewed by: grehan and rgrimes
MFC after: 4 weeks.
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D11071

7 years agoDecode arguments to mlock(), mlockall(), and munlock().
jhb [Thu, 8 Jun 2017 04:50:50 +0000 (04:50 +0000)]
Decode arguments to mlock(), mlockall(), and munlock().

7 years agoDecode arguments to minherit().
jhb [Thu, 8 Jun 2017 04:45:13 +0000 (04:45 +0000)]
Decode arguments to minherit().

7 years agoDecode arguments passed to extended attribute related system calls.
jhb [Thu, 8 Jun 2017 04:31:15 +0000 (04:31 +0000)]
Decode arguments passed to extended attribute related system calls.

The cmd argument passed to extattrctl() is not decoded as a string constant
but is just printed in hex.  The value is filesystem-specific but in
practice is only used with UFS1 filesystems.

7 years agoAllow sysctl kern.vm_guest to return bhyve when running under bhyve.
araujo [Thu, 8 Jun 2017 04:02:14 +0000 (04:02 +0000)]
Allow sysctl kern.vm_guest to return bhyve when running under bhyve.

Submitted by: Sean Fagan <sef@ixsystems.com>
Reviewed by: grehan
MFH: 4 weeks.
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D11090

7 years agoDecode arguments to ACL related system calls.
jhb [Thu, 8 Jun 2017 03:51:17 +0000 (03:51 +0000)]
Decode arguments to ACL related system calls.

This only decodes the raw arguments but not the contents of the struct acl
objects.

7 years agopatch: if reading fails, do not go into infinite loop asking for a filename.
pfg [Thu, 8 Jun 2017 03:15:08 +0000 (03:15 +0000)]
patch: if reading fails, do not go into infinite loop asking for a filename.

This can happen if no tty is available.

Obtained from: OpenBSD (CVS rev 1.54)
MFC after: 5 days

7 years agoRemove ARM and MIPS from linuxkpi ioremap_attr definition
jhibbits [Thu, 8 Jun 2017 02:44:34 +0000 (02:44 +0000)]
Remove ARM and MIPS from linuxkpi ioremap_attr definition

ARM and MIPS fail universe builds.

ARM and MIPS are missing the following:
* VM_MEMATTR_WRITE_THROUGH
* VM_MEMATTR_WRITE_COMBINING

Pointy-hat to: jhibbits

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@