Commit Graph

235324 Commits

Author SHA1 Message Date
Toomas Soome
6938805f41 libsa: gzipfs.c converts pointers to integer types with different sign
Signed versus unsigned char.
2018-08-07 10:53:51 +00:00
Toomas Soome
513f7db592 libsa: dos_checksum() should take unsigned chars
Fix pointers to integers with different sign issue.
2018-08-07 10:48:36 +00:00
Colin Percival
0b4d5eb8fd Replace a pair of 8-bit writes to VGA memory with a single 16-bit write.
The VGA "text mode" buffer has a pair of bytes for each character: One
byte for the character symbol, and an "attribute" byte encoding the
foreground and background colours.  When updating the screen, we were
writing these two bytes separately.

On some virtualized systems, every write results in a glyph being redrawn
into a (graphical) virtual screen; writing these two bytes separately
results in twice as much work being done to draw characters, whereas if
we perform a single 16-bit write instead, the character only needs to be
redrawn once.

On an EC2 c5.4xlarge instance, this change cuts 1.30s from the kernel boot,
speeding it up from 8.90s to 7.60s.

MFC after:	1 week
2018-08-07 08:33:40 +00:00
Cy Schubert
95bdea60e0 Remove redundant and incorrect default definition of AF_INET6. AF_INET6
is defined in sys/socket.h where it's defined as 28.

A bit of trivia: On NetBSD AF_INET6 is defined as 24. On Solaris it is
defined as 26. This is probably why Darren defaulted to 26, because
ipfilter was originally written for SunOS 4 and Solaris many moons ago.

MFC after:	2 weeks
2018-08-07 07:12:59 +00:00
Colin Percival
4222a490f2 Fix copy-and-paste error in previous commit. 2018-08-07 00:51:49 +00:00
John Baldwin
7cf2ca3b01 Remove spurious ABI tags from kdump output.
The abidump routine output an ABI tag when -A was specified for records
that were not displayed due to type or pid filtering.  To fix, split
the code to lookup the ABI from the code to display the ABI, move the
code to display the ABI into dumpheader(), and move dumpheader() later
in the main loop as a simplification.  Previously dumpheader() was
called under a condition that repeated conditions made later in the
main loop.

Reviewed by:	kib
MFC after:	1 month
Sponsored by:	DARPA / AFRL
Differential Revision:	https://reviews.freebsd.org/D16608
2018-08-07 00:10:58 +00:00
John Baldwin
d2aec9714a Make the system C11 atomics headers fully compatible with external GCC.
The <sys/cdefs.h> and <stdatomic.h> headers already included support for
C11 atomics via intrinsincs in modern versions of GCC, but these versions
tried to "hide" atomic variables inside a wrapper structure.  This wrapper
is not compatible with GCC's internal <stdatomic.h> header, so that if
GCC's <stdatomic.h> was used together with <sys/cdefs.h>, use of C11
atomics would fail to compile.  Fix this by not hiding atomic variables
in a structure for modern versions of GCC.  The headers already avoid
using a wrapper structure on clang.

Note that this wrapper was only used if C11 was not enabled (e.g.
via -std=c99), so this also fixes compile failures if a modern version
of GCC was used with -std=c11 but with FreeBSD's <stdatomic.h> instead
of GCC's <stdatomic.h> and this change fixes that case as well.

Reported by:	Mark Millard
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D16585
2018-08-06 23:51:08 +00:00
Navdeep Parhar
1979b51141 cxgbe(4): Allow user-configured and driver-configured traffic classes to
be used simultaneously.  Move sysctl_tc and sysctl_tc_params to
t4_sched.c while here.

MFC after:	3 weeks
Sponsored by:	Chelsio Communications
2018-08-06 23:21:13 +00:00
Navdeep Parhar
7b8f5a200a cxgbe(4): Break up sysctl_bitfield into 8 bit and 16 bit variants. Have
them display the current value of the bitfield rather than the fixed
value that was provided when the sysctl node was created.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2018-08-06 21:54:51 +00:00
Kirk McKusick
68c49bcc40 Put in place the framework for consolodating contiguous blocks into
a smaller number of larger TRIM requests. The hope had been to have
the full TRIM consolodation in place for 12.0, but the algorithms
are still under development and need further testing. With this
framework in place it will be possible to easily add TRIM consolodation
once the optimal strategy has been found.

The only functional change with this patch is the elimination of TRIM
requests for blocks that are freed before they have been likely to
have been written.

Reviewed by: kib
Discussed with: Warner Losh and Chuck Silvers
Sponsored by: Netflix
2018-08-06 21:09:11 +00:00
Colin Percival
a7ec419d93 Add EC2PUBLICSNAP option to EC2 builds; this passes a (recently added)
flag to bsdec2-image-upload instructing it to mark the snapshot of its
root disk as public (which is independent from marking the created AMIs
as public).

Requested by:	Amazon
2018-08-06 19:21:32 +00:00
Navdeep Parhar
564ec04ea8 Fix typo in cxgbe/t4_tom. 2018-08-06 19:09:55 +00:00
Jonathan T. Looney
9eef6002c3 Bump date after r337384.
Reported by:	bz
2018-08-06 18:42:37 +00:00
Jonathan T. Looney
95a914f631 Address concerns about CPU usage while doing TCP reassembly.
Currently, the per-queue limit is a function of the receive buffer
size and the MSS.  In certain cases (such as connections with large
receive buffers), the per-queue segment limit can be quite large.
Because we process segments as a linked list, large queues may not
perform acceptably.

The better long-term solution is to make the queue more efficient.
But, in the short-term, we can provide a way for a system
administrator to set the maximum queue size.

We set the default queue limit to 100.  This is an effort to balance
performance with a sane resource limit.  Depending on their
environment, goals, etc., an administrator may choose to modify this
limit in either direction.

Reviewed by:	jhb
Approved by:	so
Security:	FreeBSD-SA-18:08.tcp
Security:	CVE-2018-6922
2018-08-06 17:36:57 +00:00
Emmanuel Vadot
7b7dbfa9b3 release: arm: Copy the dtb to the fat partition
When booting via EFI on arm we have no way to know the dtb file to load
and we always use the one provided from the bootloader.
This works in most case but :

 U-Boot have some really old DTB for some boards, the sync from Linux isn't done automatically for all boards
 Some boards (like TI BeagleBone series) use one u-boot for all the model and it doesn't embed the DTBs
 Some boards (like IMX6 based ones), don't embed the DTB

We want u-boot to load and patch the DTB with the mac address or the display
node enabled or not.

Reviewed by:	gjb, imp
Differential Revision:	https://reviews.freebsd.org/D16596
2018-08-06 17:21:20 +00:00
Mark Johnston
976e100378 dhclient: Don't chroot if we are in capability mode.
The main dhclient process is Capsicumized but also chroots to
restrict filesystem access.  With r322369, pidfile(3) maintains a
directory descriptor for the pidfile, which can cause the chroot
to fail in certain cases.  To minimize the problem, only chroot
if we fail to enter capability mode, and store dhclient pidfiles
in a subdirectory of /var/run, thus restricting access via
pidfile(3)'s directory descriptor.

PR:		223327
Reviewed by:	cem, oshogbo
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D16584
2018-08-06 16:22:01 +00:00
Ruslan Bukin
7db2360401 Increase timeout for timedmutex_test:mutex2, timedmutex_test:mutex3
tests.

Default value is 300. It takes ~310s to complete each of these tests
in QEMU/RISC-V.

Sponsored by:	DARPA, AFRL
2018-08-06 15:55:58 +00:00
Andrew Turner
b17f3d298d Default to armv5te in LINT on arm. This should fix building LINT there. 2018-08-06 14:40:45 +00:00
Mateusz Piotrowski
293f5f0209 Fix "mandoc -Tlint" warnings.
Reviewed by:	bcr
Approved by:	mat (mentor)
Differential Revision:	https://reviews.freebsd.org/D15580
2018-08-06 11:45:28 +00:00
Mateusz Piotrowski
70866c8dbd Fix synopsis of the -t option.
While here:

 - Remove deprecated ".Tn" macros.
 - Improve formatting and fix typos in the description of
   the -t option.

Reviewed by:	bcr
Approved by:	mat (mentor)
Differential Revision:	https://reviews.freebsd.org/D16541
2018-08-06 11:38:55 +00:00
Hans Petter Selasky
549dcdb34e Implement current_work() function in the LinuxKPI.
Tested by:	Johannes Lundberg <johalun0@gmail.com>
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2018-08-06 10:48:20 +00:00
Randall Stewart
936b2b64ae This fixes a bug in Rack where we were
not properly using the correct value for
Delayed Ack.

Sponsored by:	Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D16579
2018-08-06 09:22:07 +00:00
Hans Petter Selasky
db119089be Implement atomic_long_cmpxchg() function in the LinuxKPI.
Submitted by:	Johannes Lundberg <johalun0@gmail.com>
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2018-08-06 08:40:02 +00:00
Hans Petter Selasky
f698bc4d76 Define __poll_t type in the LinuxKPI.
Submitted by:	Johannes Lundberg <johalun0@gmail.com>
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2018-08-06 08:35:16 +00:00
Emmanuel Vadot
d19afc9abf aw_thermal: Add nvmem and H5 support
Now that aw_sid expose nvmem interface, use that to read the calibration
data.
Add support for H5 SoC.
Fix the bindings, we used to have non-upstreamed bindings. Switch to the
one that have been sent upstream. They are not stable yet, so we switch
from custom, wrong, bindings to correct, proposed bindings
2018-08-06 05:36:00 +00:00
Emmanuel Vadot
97eb836f8b aw_sid: Add nvmem interface
Rework aw_sid so it can work with the nvmem interface.
Each SoC expose a set of fuses (for now rootkey/boardid and, if available,
the thermal calibration data). A fuse can be private or public, reading private
fuse needs to be done via some registers instead of reading directly.
Each fuse is exposed as a sysctl.
For now leave the possibility for a driver to read any fuse without using
the nvmem interface as the awg and emac driver use this to generate a mac
address.
2018-08-06 05:35:24 +00:00
Ben Widawsky
94b92b567c git-svn-init: Clarify branch creation commands
Suggested by:	eadler
Reviewed by:	eadler
Approved by:	emaste (mentor)
Differential Revision:	https://reviews.freebsd.org/D16593
2018-08-06 01:08:43 +00:00
Ian Lepore
f38b2297a3 Document 64-bit arm in terms of arch name (aarch64) not machine (arm64).
Other architectures are documented in terms of the name that is displayed by
'uname -p', aka MACHINE_ARCH and TARGET_ARCH in the build system, now
aarch64 matches the rest of them.

PR:		220297
2018-08-05 22:24:38 +00:00
Rick Macklem
9725268c01 Add a reference to pnfsserver.4 to the nfsd.8 man page.
This is a content change.
2018-08-05 20:36:48 +00:00
Rick Macklem
b11b70595a Update the pnfs.4 man page to reference the pnfsserver.4 man page.
This is a content change.
2018-08-05 20:20:04 +00:00
Rick Macklem
69934c3d64 Add pnfsserver.4 to the Makefile for nfsd. 2018-08-05 20:15:33 +00:00
Rick Macklem
d47b206871 Add a man page that describes the setup of a pNFS service.
This is a content change.
2018-08-05 20:14:07 +00:00
Rick Macklem
25705dd5d0 Copy all bits of a file handle in case there is padding in the structure.
At least on x86, fhandle_t is a packed structure, so I believe an
assignment will copy all the bits. However, for some current/future
architectures, there might be padding in the structure that doesn't get
copied via an assignment.
Since NFS assumes a file handle is an opaque blob of bits that can be
compared via memcmp()/bcmp(), all the bits including any padding must be
copied.
This patch replaces the assignments with a call to a byte copy function.
Spotted during code inspection.
2018-08-05 19:21:50 +00:00
Toomas Soome
8750586c61 loader: bd_open() should cleanup from disk_open() error
Since bd_open() does early increment for reference counter and bcache
allocation, it also should undo those in case of the error.

Also remove unused variables rdev, g_err.
2018-08-05 19:17:07 +00:00
Toomas Soome
d1e22b8f08 loader: 337353 did miss to rename 2 write instances
2 write instances got somehow missed.
2018-08-05 18:24:35 +00:00
Toomas Soome
7bb45e615a loader: cstyle cleanup for biosdisk.c
Also switch u_int to uint32_t. Also replace "write" by "dowrite".
No functional changes intended.
2018-08-05 18:19:40 +00:00
Kristof Provost
91e0f2d200 pf: Increase default hash table size
Now that we (by default) limit the number of states to 100.000 it makse sense
to also adjust the default size of the hash table.

Based on the benchmarking results in
https://github.com/ocochard/netbenches/blob/master/Atom_C2758_8Cores-Chelsio_T540-CR/pf-states_hashsize/results/fbsd12-head.r332390/README.md
128K entries offers a good compromise between performance and memory use.

Users may still overrule this setting with the net.pf.states_hashsize and
net.pf.source_nodes_hashsize loader(8) tunables.
2018-08-05 13:54:37 +00:00
Kristof Provost
5abe8cb6de zfsboot: Fix startup crash
On a FreeNAS mini XL, with geli encrypted drives the loader crashed in
geli_read().

When we iterate over the list of disks and allocate the zfsdsk structures we
don’t zero out the gdev pointer. In one case that resulted in geli_read()
(called on the bogus pointer) dividing by zero.

Use calloc() to ensure the zfsdsk structure is always zeroed, so the pointer is
initialised to NULL. As a side benefit it gets rid of one #ifdef
LOADER_GELI_SUPPORT.
2018-08-05 11:15:28 +00:00
Vladimir Kondratyev
26f3e847c3 uep(4): add evdev support
To compile this driver with evdev support enabled, place
following lines into the kernel configuration file:

options EVDEV_SUPPORT
device evdev

Note: Native and evdev modes are mutually exclusive.

Reviewed by:	gonzo, wblock (docs)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D11156
2018-08-05 11:14:13 +00:00
Emmanuel Vadot
69acf61478 allwinner: a64: Add THS clock support
The clock for the thermal sensor controller was missing when this driver
was made.
2018-08-05 06:16:36 +00:00
Emmanuel Vadot
aed85e3011 extres: clkdiv: Fix div_with_table
We didn't allowed a divider register value of 0 which can exists and
also didn't wrote the value but the divider, which result of a wrong
frequency to be selected
2018-08-05 06:15:35 +00:00
Emmanuel Vadot
4573cd3914 arm: allwinner: Disconnect A10/A20 HDMI driver
It doesn't work since 2 years when we stopped patching DTS.
The DTS now have the correct bindings but they are a lot different
from our hacked ones we used to have (and more representative of the
reality).
2018-08-05 06:10:13 +00:00
Emmanuel Vadot
c204112317 arm: allwinner: Remove old unused clocks
Remove the old clocks for allwinner as now all the SoCs have been converted
to clkng.
The only old clock now is the gmac clock which still lives under the /clocks
dts node.
2018-08-05 06:08:23 +00:00
Brad Davis
624a22b84e Fix build after r337340.
Approved by:	will (mentor)
2018-08-05 04:20:52 +00:00
Brad Davis
0ab0a723ed Move autofs related configs to usr.sbin/autofs/
This is prep for pkgbase to have config files tagged as such.

Approved by:	will (mentor)
Differential Revision:	https://reviews.freebsd.org/D16492
2018-08-04 22:41:17 +00:00
Brad Davis
99a84b826f Move portsnap.conf to head/usr.sbin/portsnap/portsnap/
This is prep for pkgbase to have config files tagged as such.

Approved by:	will (mentor)
Differential Revision:	https://reviews.freebsd.org/D16554
2018-08-04 22:31:29 +00:00
Brad Davis
6e6d254d7c Move freebsd-update.conf to usr.sbin/freebsd-update.
This is prep for pkgbase so that config files are tagged as such.

Approved by:	will (mentor)
Differential Revision:	https://reviews.freebsd.org/D16556
2018-08-04 22:25:41 +00:00
Brad Davis
4d2cf170d3 Move etc/minfree to sbin/savecore/.
This is prep for pkgbase to have config files tagged as such.

Approved by:	will (mentor)
Differential Revision:	https://reviews.freebsd.org/D16558
2018-08-04 22:15:59 +00:00
Conrad Meyer
ba9ace7436 settimeofday(2): Remove stale note about timezone
Contrary to the removed comment, the kernel does appear to use the timezone
argument of settimeofday.  The comment dates to the BSD4.4 import; I assume it
is just stale.
2018-08-04 22:08:24 +00:00
Conrad Meyer
2c77ec5419 date(1): Add ISO 8601 formatting option
The new flag is named '-I'.  It is documented in the manual page and covered
by basic unit tests.
2018-08-04 21:54:30 +00:00