Commit Graph

223607 Commits

Author SHA1 Message Date
Bryan Drewery
3c4c0efd1d vm.defer_swapspace_pageouts was removed in r308474. 2017-06-07 19:36:17 +00:00
Justin Hibbits
287e7a861a 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
2017-06-07 18:08:11 +00:00
Alan Cox
d90bf7d850 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
2017-06-07 16:04:34 +00:00
Kevin Lo
a8cf90eb9a 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
2017-06-07 09:10:24 +00:00
Enji Cooper
245e210cc6 Add some basic tests for chmod(1)
MFC after:	1 month
Sponsored by:	Dell EMC Isilon
2017-06-07 05:33:56 +00:00
Gleb Smirnoff
b3244df799 Provide typedef for socket upcall function.
While here change so_gen_t type to modern uint64_t.
2017-06-07 01:48:11 +00:00
Gleb Smirnoff
b94f68dc52 Remove a piece of dead code. 2017-06-07 01:21:34 +00:00
Stephen J. Kiernan
63c1ff65d1 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
2017-06-06 22:17:55 +00:00
Stephen J. Kiernan
ba01ab64cc 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
2017-06-06 21:51:04 +00:00
Enji Cooper
7c91b65f54 Add testcases for cat -b
MFC after:	1 month
Sponsored by:	Dell EMC Isilon
2017-06-06 21:50:00 +00:00
Stephen J. Kiernan
366dbfa5c0 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
2017-06-06 21:40:35 +00:00
Jilles Tjoelker
79fb1e455e 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.
2017-06-06 21:08:05 +00:00
Enji Cooper
9086e0e068 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
2017-06-06 21:03:43 +00:00
Alan Cox
761097c85e 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
2017-06-06 16:52:07 +00:00
Enji Cooper
2d15c3cb12 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
2017-06-06 16:04:27 +00:00
Glen Barber
2c4227aaa2 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
2017-06-06 14:08:54 +00:00
Hans Petter Selasky
25b3ef2c99 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
2017-06-06 10:12:58 +00:00
Will Andrews
c384464d25 tsearch_test: Test twalk & add some determinism. 2017-06-06 03:40:45 +00:00
Alan Cox
03bdd65f18 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
2017-06-06 03:32:17 +00:00
Allan Jude
e28f9b7d03 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
2017-06-06 02:15:00 +00:00
Allan Jude
24ffc64926 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
2017-06-06 02:03:22 +00:00
Glen Barber
92ed3d6edd Revert r319608, the dtb path was correct the first time. Sigh.
MFC after:	3 days
MFC with:	r319603, r319608
Sponsored by:	The FreeBSD Foundation
2017-06-05 20:18:55 +00:00
Glen Barber
9d349b6fc0 Fix the source path for the cubieboard2 dtb hard link.
MFC after:	3 days
MFC with:	r319603
Sponsored by:	The FreeBSD Foundation
2017-06-05 19:41:06 +00:00
Alan Cox
3e78e98337 The variable "breakout" is used like a Boolean, so actually define it as
one.

Reviewed by:	kib
MFC after:	5 days
2017-06-05 18:07:56 +00:00
Alan Cox
064650c180 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
2017-06-05 17:14:16 +00:00
Glen Barber
dc09cfbf08 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
2017-06-05 17:05:06 +00:00
Bryan Drewery
231ad771d9 Clarify -q is only for pgrep.
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-06-05 16:00:10 +00:00
Toomas Soome
a87f43927c ANSIfy md5 functions
Update the function declarations.

Reviewed by:	dim
Differential Revision:	https://reviews.freebsd.org/D11055
2017-06-05 11:55:26 +00:00
Konstantin Belousov
3df7ebc4ed 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
2017-06-05 11:40:30 +00:00
Edward Tomasz Napierala
77c97f893a Remove unused tlb_write_random().
Sponsored by:	DARPA, AFRL
2017-06-05 11:04:22 +00:00
Edward Tomasz Napierala
ab1318b7ed Remove extraneous parentheses.
Sponsored by:	DARPA, AFRL
2017-06-05 10:59:47 +00:00
John Baldwin
b60a095b93 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>
2017-06-05 05:25:50 +00:00
Bryan Drewery
c8fab231f1 META_MODE: Force a host tool rebuild for ino64 in r318736.
Sponsored by:	Dell EMC Isilon
2017-06-05 05:17:42 +00:00
Bryan Drewery
1a9cc831dd 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
2017-06-05 05:17:39 +00:00
Bryan Drewery
ffe0978fbe 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
2017-06-05 05:17:36 +00:00
Jilles Tjoelker
8d4cde8e6d 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.
2017-06-04 21:58:02 +00:00
Jilles Tjoelker
9086b30bc4 tests/sys/aio: Add missing mode to open() calls with O_CREAT. 2017-06-04 21:39:37 +00:00
Adrian Chadd
d17a5d1bce [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
2017-06-04 21:28:52 +00:00
Adrian Chadd
d057daedda [iwmfw] bump built firmware now to version 22 for 7265D and 8000C. 2017-06-04 21:28:03 +00:00
Adrian Chadd
13811c2677 [iwmfw] 8000C ver 22 firmware. 2017-06-04 21:27:39 +00:00
Adrian Chadd
ab5bad9ee3 [iwmfw] add 7265D-22 firmware 2017-06-04 21:26:31 +00:00
Adrian Chadd
f0949f0cc6 [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
2017-06-04 21:21:44 +00:00
Adrian Chadd
50c5bb10c5 [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
2017-06-04 21:14:23 +00:00
Adrian Chadd
51382483c4 [iwm] Set command code for PHY_DB as well.
Obtained from:	dragonflybsd.git 58318c956a74382d1286ccabaf767012fdcfe1a2
2017-06-04 21:13:13 +00:00
Adrian Chadd
eecff6a7e0 [iwm] Set correct state in smart-fifo configuration.
Obtained from:	dragonflybsd.git 666737f64b4f6dd42ffd9f0ace9fc46ccc1ebaab
2017-06-04 21:12:11 +00:00
Adrian Chadd
e470115fc5 [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
2017-06-04 21:11:28 +00:00
Adrian Chadd
19d956ec90 [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
2017-06-04 21:10:14 +00:00
Adrian Chadd
cd684deca9 [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
2017-06-04 21:05:58 +00:00
Bryan Drewery
3ecb77f014 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
2017-06-04 21:02:48 +00:00
Jilles Tjoelker
eab4998278 sh: Fix INTOFF leak when a redirection on a compound command fails.
Reported by:	bdrewery
2017-06-04 20:52:55 +00:00