dteske [Sun, 17 Jun 2018 20:32:43 +0000 (20:32 +0000)]
sysrc.subr: Fix a comment for accuracy
PR: bin/203435
Reported by: Andreas Sommer <andreas.sommer87@googlemail.com>
MFC after: 6 days
X-MFC-to: stable/11
X-MFC-with: r335280
Sponsored by: Smule, Inc.
eadler [Sun, 17 Jun 2018 19:44:24 +0000 (19:44 +0000)]
README: add generic notes about GENERIC and NOTES
Inform new users what GENERIC and NOTES are. These are useful for people
perusing the tree without a great deal of specific fbsd knowledge.
See discussion of r334073 for further motivation.
dim [Sun, 17 Jun 2018 19:24:40 +0000 (19:24 +0000)]
Fix build of ndis with base gcc on i386
Casting from rman_res_t to a pointer results in "cast to pointer from
integer of different size" warnings with base gcc on i386, so use an
intermediate cast to uintptr_t to suppress it. In this case, the I/O
port range is effectively limited to the range of 0..65535.
Reviewed by: imp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D15746
dim [Sun, 17 Jun 2018 19:14:05 +0000 (19:14 +0000)]
Fix build of aibs with base gcc on i386
Add a few intermediate casts to intptr_t to suppress "cast to pointer
from integer of different size" warnings from gcc. In this case, the
'arg2' part of SYSCTL_HANDLER_ARGS is used to pass in a pointer, via an
intermediate intmax_t, so no information is lost.
Reviewed by: avg
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D15725
rmacklem [Sun, 17 Jun 2018 16:30:06 +0000 (16:30 +0000)]
Make the pNFS NFSv4.1 client return a Flexible File layout upon error.
The Flexible File layout LayoutReturn operation has argument fields where
an I/O error encountered when attempting I/O on a DS can be reported back
to the MDS.
This patch adds code to the client to do this for the Flexible File layout
mirrored case.
This patch should only affect mounts using the "pnfs" option against servers
that support the Flexible File layout.
asomers [Sun, 17 Jun 2018 15:22:27 +0000 (15:22 +0000)]
audit(4): add tests for extattr_get_file(2) and friends
This commit includes extattr_{get_file, get_fd, get_link, list_file,
list_fd, list_link}. It does not include any syscalls that modify, set, or
delete extended attributes, as those are in a different audit class.
dteske [Sun, 17 Jun 2018 03:33:29 +0000 (03:33 +0000)]
sysrc(8): Exit with failure on API error
Fix exit status when f_sysrc_set() fails. Errors in the underlying API
provided by bsdconfig(8) -- /usr/share/bsdconfig/sysrc.subr -- were not
being communicated back to the command-line. This was affecting ansible
modules using sysrc as they were not able to accurately test for error.
PR: bin/211448
Reported by: Christian Schwarz <me@cschwarz.com>
MFC after: 3 days
X-MFC-to: stable/11
Sponsored by: Smule, Inc.
allanjude [Sun, 17 Jun 2018 03:18:56 +0000 (03:18 +0000)]
gptboot, zfsboot, gptzfsboot: Enable the video and serial consoles early
Normally the serial console is not enabled until /boot.config is read and
we know how the serial console should be configured. Initialize the
consoles early in 'dual' mode (serial & keyboard) with a default serial
rate of 115200. Then serial is re-initialized once the disk is decrypted
and the /boot.config file can be read.
This allows the GELIBoot passphrase to be provided via the serial console.
PR: 221526
Requested by: many
Reviewed by: imp
Sponsored by: Klara Systems
Differential Revision: https://reviews.freebsd.org/D15862
imp [Sun, 17 Jun 2018 02:49:42 +0000 (02:49 +0000)]
FreeBSD/amd64 requires 256MiB to boot UEFI, 128MB simply doesn't work.
128MiB still works for Legacy booting, however. Go ahead and do 256MiB
for all amd64 boxes, since the number of such boxes < 256MiB is
vanishingly small.
imp [Sun, 17 Jun 2018 01:26:57 +0000 (01:26 +0000)]
Many netboot scenarios don't have /boot/defaults/loader.conf. As
a fallback, also check /boot/kernel/kernel existing as well, since
that's the fallback behavior of the loader.
rmacklem [Sat, 16 Jun 2018 19:45:06 +0000 (19:45 +0000)]
Fix NFSv4.1 client side handling of "soft,retrans=2" mounts.
Normally "soft,retrans=2" cannot be safely used on NFSv4 mounts, since
the RPC can fail and leave the open/lock state in an undefined state.
Doing I/O on a pNFS DS is an exception to this, since no open/lock state
is maintained on the DS server.
It is useful to do "soft,retrans=2" connections to a DS when it is mirrored,
so that the client can detect failure of the DS. As such, mounts from the MDS
to the DSs should use these mount options when mirroring is enabled.
However, the NFSv4.1 client still leaves the session in an undefined state
when this happens.
This patch fixes the problem by setting the session defunct, so it will
no longer be used.
The patch also sets "retries=2" on the connections done by the client to
a DS, which is the internal equivalent of "soft,retrans=2".
The client does not know if the server implements mirroring at connection
time, but always doing this should be safe, since it will fall back on doing
I/O via the MDS as a proxy when there is a failure doing an I/O RPC to the DS.
This patch should not affect non-pNFS client mounts.
allanjude [Sat, 16 Jun 2018 15:16:02 +0000 (15:16 +0000)]
Avoid reading past the end of the disk in zfsboot.c and biosdisk.c
The GELI boot code rounds reads up to 4k, since the encrypted sectors are
4k, and must be decrypted as a unit. With oddball sized disks (almost
always virtual), this can lead to reading past the end of the disk.
ae [Sat, 16 Jun 2018 08:26:23 +0000 (08:26 +0000)]
Switch RIB and RADIX_NODE_HEAD lock from rwlock(9) to rmlock(9).
Using of rwlock with multiqueue NICs for IP forwarding on high pps
produces high lock contention and inefficient. Rmlock fits better for
such workloads.
mmel [Sat, 16 Jun 2018 08:25:38 +0000 (08:25 +0000)]
Fix handling of enable counter for shared GPIO line in fixed regulator.
For most regulators, the regulator_stop() method can be transformed to
regulator disable. But, in some cases, we needs to maintain shared data
across multiple regulators (e.g. single GPIO pin which works as enable
for multiple regulates). In this case, the implementation of regulator
should perform his own enable counting therefore it is necessary to
distinguish between the regulator enable/disable method (which
increments/decrements enable counter for shared resource) and regulator
stop method (which don't affect it).
So:
- add regnode_stop() method to regulator framework and default it to
regnode_enable(..., false, ...)
- implement it in regulator_fixed with proper enable counting.
While I'm in, also fix handling of always_on property. If any of regulators
sharing same GPIO pin have it enabled, then none of them can disable regulator.
allanjude [Sat, 16 Jun 2018 04:50:40 +0000 (04:50 +0000)]
biosdisk.c remove redundant variable
`rdev` and `disk` serve the same purpose, read the partition table without
the `d_offset` or `d_slice` set, so the read is relative to the start of
the disk. Reuse the already initialized `disk` instead of making another
copy later.
np [Fri, 15 Jun 2018 23:42:22 +0000 (23:42 +0000)]
cxgbe(4): Add a hw.cxgbe.starve_fl sysctl that can be used to starve the
freelists of netmap receive queues. This is primarily to test various
congestion scenarios in the chip.
glebius [Fri, 15 Jun 2018 21:36:16 +0000 (21:36 +0000)]
Since 'ticks' is an int, it may wrap around and cr_ticks at a certain
counter_rate will be greater than ticks, resulting in counter_ratecheck()
failure. To fix this take an absolute value of the difference between
ticks and cr_ticks.
np [Fri, 15 Jun 2018 21:23:03 +0000 (21:23 +0000)]
cxgbe(4): Track the number of received frames separately from the number
of descriptors processed. Add the ability to gather a certain maximum
number of frames in the driver's rx before waking up netmap rx. If
there aren't enough frames then netmap rx will be woken up as usual.
rmacklem [Fri, 15 Jun 2018 19:45:15 +0000 (19:45 +0000)]
Add a command that copies or migrates a data file from one DS to another.
This command can be used by a sysadmin to either copy or migrate a data
file on one DS to another DS.
Its main use is to recover data files onto a mirrored DS after the DS has
been repaired and brought back online.
rmacklem [Fri, 15 Jun 2018 19:35:08 +0000 (19:35 +0000)]
Add a command the displays and modifies the pNFS server's extended attribute.
This command allows a sysadmin to display or modify the pnfsd.dsfile extended
attribute used by the pNFS MDS server in various ways.
Its main use is to set a DS's IP address to 0.0.0.0 when that DS has failed,
so that it will not be used for the file when brought back online after
being repaired.
imp [Fri, 15 Jun 2018 19:07:37 +0000 (19:07 +0000)]
There's no need to walk through the tables looking for the smbios
table if we're just going to ignore it on arm, so expand, slightly,
the reach of the ifdef. Move the buffer to the inner block so we
don't have a separate #ifdef far away from these lines.
The issue on arm is that smbios_detect does unaligned accesses, which
in the u-boot implementing EFI context causes a crash.
imp [Fri, 15 Jun 2018 19:07:26 +0000 (19:07 +0000)]
Provide a more direct interface to tell ZFS what the preferred handle
is. We tell the ZFS code now, and it checks rather than having a
callback to do the checks.
This will allow us to have a more graceful fallback code. In the
future, it's anticipated that we may fallback to a more global search
(or implement a command to do so) when reqeusted by the user, or we
detect a violation of the UEFI Boot Manager protocol severe enough to
warrant this backstop. For now, it just allows us to get rid of img as
a global.
cem [Fri, 15 Jun 2018 19:02:53 +0000 (19:02 +0000)]
Retain offset compatibility with pre-12.0 dumps
As a follow-up to r324965, which adds support for compressed kernel dumps,
readjust dump header members slightly to mostly preserve ABI with earlier
(11.x and older) dumps.
jhibbits [Fri, 15 Jun 2018 18:55:02 +0000 (18:55 +0000)]
Check for a 'pci' prefix rather than a full match in get_addr_props
Summary:
Newer OPAL device trees, such as those on POWER9 systems, use 'pciex' for
device_type, not 'pci'. Rather than enumerating all possible variants, just
check for a 'pci' prefix.
bdrewery [Fri, 15 Jun 2018 18:50:24 +0000 (18:50 +0000)]
lib32: Fix lib/libpmc/pmu-events files ending up in source directory.
This could happen with either WITHOUT_AUTO_OBJ=yes or MAKELEVEL>0 for
the initial 'make buildworld' command.
This now ensures that build-tools targets have 'make obj' ran if needed.
This is especially problematic for pmu-events since it is not directly
connected in the build. Normally the 'make includes' call right before
this implicitly creates the objdir with a 'make obj' already but
misses pmu-events because it is disconnected from lib/libpmc. Fixing that
would make this new 'make obj' pointless but it is being added to avoid
this problem in the future should another tool be connected like this.
kevans [Fri, 15 Jun 2018 17:29:32 +0000 (17:29 +0000)]
extres/regulator: Switch boot_on/always_on sysctl to uint8
These are represented as booleans on the kernel-side, but were being exposed
as int. This was causing some funky things to happen when read later with
sysctl(8), e.g. randomly reading super-high when the value was actually
'0'/false.
emaste [Fri, 15 Jun 2018 16:28:50 +0000 (16:28 +0000)]
ldd: reference readelf instead of objdump in warning message
We have an obsolete GNU objdump 2.17.50 in the base system, which will
be removed in the future. Suggest readelf(1) for examining ELF files
instead; for most use cases it is the preferred tool anyhow.
PR: 229046
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
emaste [Fri, 15 Jun 2018 16:14:42 +0000 (16:14 +0000)]
elf.5: add readelf cross-reference
objdump is sometimes used in cases where readelf is more appropriate,
but the obsolete GNU objdump we have in the base system will be removed
in the future.
.Xr readelf from elf.5 to improve the odds the more appropriate tool
will be found.
PR: 229046
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
chuck [Fri, 15 Jun 2018 15:22:27 +0000 (15:22 +0000)]
Add linprocfs support for min_free_kbytes
This adds linprocfs support for proc/sys/vm/min_free_kbytes which the
free program requires for correct operation. The approach mirrors the
approach used in illumos.
emaste [Fri, 15 Jun 2018 14:41:51 +0000 (14:41 +0000)]
linuxulator: do not include legacy syscalls on arm64
Existing linuxulator platforms (i386, amd64) support legacy syscalls,
such as non-*at ones like open, but arm64 and other new platforms do
not.
Wrap these in #ifdef LINUX_LEGACY_SYSCALLS, #defined in the MD linux.h
files. We may need finer grained control in the future but this is
sufficient for now.
emaste [Fri, 15 Jun 2018 14:29:41 +0000 (14:29 +0000)]
Correct debug control for linuxulator faccessat
The Linuxulator provides per-syscall debug control via the
compat.linux.debug sysctl. There's generally a 1:1 mapping between
sysctl setting and syscall, but faccessat was controlled by the access
setting, perhaps due to copy-paste.
kevans [Fri, 15 Jun 2018 13:14:45 +0000 (13:14 +0000)]
Revert r335173 at request of mmel@
This was the wrong solution to the problem; regulator_shutdown invokes
regnode_stop. regulator_stop is not a refcounting method, but it invokes
regnode_enable, which is.
mmel@ has a proposed patch/solution to instead provide regnode_fixed_stop
behavior that properly takes shared GPIO pins into account.
tuexen [Fri, 15 Jun 2018 12:28:43 +0000 (12:28 +0000)]
When retransmitting TCP SYN-ACK segments with the TCP timestamp option
enabled use an updated timestamp instead of reusing the one used in
the initial TCP SYN-ACK segment.
This patch ensures that an updated timestamp is used when sending the
SYN-ACK from the syncache code. It was already done if the
SYN-ACK was retransmitted from the generic code.
This makes the behaviour consistent and also conformant with
the TCP specification.
Reviewed by: jtl@, Jason Eggleston
MFC after: 1 month
Sponsored by: Neflix, Inc.
Differential Revision: https://reviews.freebsd.org/D15634
rmacklem [Fri, 15 Jun 2018 11:52:34 +0000 (11:52 +0000)]
Add a command that disables a pNFS server mirrored DS.
This command can be used by a sysadmin to disable a malfunctioning pNFS server
mirrored DS. It is safe to use when a mirrored DS has already been disabled
via an I/O or network partitioning error.
manu [Fri, 15 Jun 2018 08:36:21 +0000 (08:36 +0000)]
allwinner: ccung: Fully subclass the clock drivers
Each clock drivers if now fully subclassed, this have the advantage that
we can control the probe order.
Some clocks can have parents from other drivers, for example clocks in the
sun8i_r driver uses clocks from the main clock driver.
This worked before because the sun8i_r node is after the main ccu node in the
dtb and driver are probed in DTB order. This cannot work with the Display
Engine clocks as it is the first node in the DTB.