]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoRemove unused file.
kib [Sat, 16 Jun 2018 17:11:23 +0000 (17:11 +0000)]
Remove unused file.

The thr_new(2) syscall is called through libc stub.  r154212 stopped
generating it for libthr but did not cleaned the unused remnants.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoRemove some empty directories
kib [Sat, 16 Jun 2018 16:16:24 +0000 (16:16 +0000)]
Remove some empty directories

6 years agoaudit(4): add tests for chown(2) and friends
asomers [Sat, 16 Jun 2018 15:38:59 +0000 (15:38 +0000)]
audit(4): add tests for chown(2) and friends

Includes chown, fchown, lchown, and fchownat

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15825

6 years agoaudit(4): add tests for bind(2), bindat(2), and listen(2)
asomers [Sat, 16 Jun 2018 15:25:08 +0000 (15:25 +0000)]
audit(4): add tests for bind(2), bindat(2), and listen(2)

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15843

6 years agoAvoid reading past the end of the disk in zfsboot.c and biosdisk.c
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.

Reviewed by: imp, tsoome
Sponsored by: Klara Systems
Differential Revision: https://reviews.freebsd.org/D15844

6 years agoRework ofed build.
kib [Sat, 16 Jun 2018 15:05:05 +0000 (15:05 +0000)]
Rework ofed build.

Aligns the build with the FreeBSD traditional approach to not build in
contrib/, and to track inter-dependencies between libraries.

With help from: bdrewery
Reviewed by: bdrewery, hselasky
Sponsored by: Mellanox Technologies
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D15648

6 years agoSwitch RIB and RADIX_NODE_HEAD lock from rwlock(9) to rmlock(9).
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.

Reviewed by: melifaro, olivier
Obtained from: Yandex LLC
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D15789

6 years agoFix handling of enable counter for shared GPIO line in fixed regulator.
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.

Tested by: kevans
MFC after: 3 weeks

6 years agobiosdisk.c: fix type in debug printf
allanjude [Sat, 16 Jun 2018 06:23:07 +0000 (06:23 +0000)]
biosdisk.c: fix type in debug printf

Sponsored by: Klara Systems

6 years agobiosdisk.c: add missing \n to error message
allanjude [Sat, 16 Jun 2018 05:58:33 +0000 (05:58 +0000)]
biosdisk.c: add missing \n to error message

Sponsored by: Klara Systems

6 years agobiosdisk.c remove redundant variable
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.

Sponsored by: Klara Systems

6 years agoCorrect logic error in biosdisk.c:bd_realstrategy()
allanjude [Sat, 16 Jun 2018 02:50:29 +0000 (02:50 +0000)]
Correct logic error in biosdisk.c:bd_realstrategy()

The wrong condition is used when evaluating the return of disk_ioctl()
This results in reaching the 'We should not get here' branch in most casts

Reviewed by: imp
Sponsored by: Klara Systems
Differential Revision: https://reviews.freebsd.org/D15839

6 years agoAssert that a build is done before an install.
bdrewery [Sat, 16 Jun 2018 00:35:19 +0000 (00:35 +0000)]
Assert that a build is done before an install.

This should also catch cases where the wrong MAKEOBJDIRPREFIX is used for
install.

MFC after: 2 weeks
Sponsored by: Dell EMC

6 years agocxgbe(4): Add a hw.cxgbe.starve_fl sysctl that can be used to starve the
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.

Sponsored by: Chelsio Communications

6 years agoSince 'ticks' is an int, it may wrap around and cr_ticks at a certain
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.

Reported by: jtl
Sponsored by: Netflix

6 years agocxgbe(4): Track the number of received frames separately from the number
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.

hw.cxgbe.nm_rx_nframes

Sponsored by: Chelsio Communications

6 years agoUse the .Fx macro in the man page.
rmacklem [Fri, 15 Jun 2018 21:07:14 +0000 (21:07 +0000)]
Use the .Fx macro in the man page.

Reported by: bjk

6 years agoUse the .Fx macro in the man page.
rmacklem [Fri, 15 Jun 2018 21:04:28 +0000 (21:04 +0000)]
Use the .Fx macro in the man page.

Reported by: bjk

6 years agoUse the .Fx macro in the man page.
rmacklem [Fri, 15 Jun 2018 21:02:33 +0000 (21:02 +0000)]
Use the .Fx macro in the man page.

Reported by: bjk

6 years agoBump __FreeBSD_version after r335227
cem [Fri, 15 Jun 2018 20:57:02 +0000 (20:57 +0000)]
Bump __FreeBSD_version after r335227

The kerneldumpheader ABI is used by at least the netdumpd port.  Bump
__FreeBSD_version to reflect the change.

Reported by: markj
Sponsored by: Dell EMC Isilon

6 years agoAdd a command that copies or migrates a data file from one DS to another.
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.

6 years agoarm64 linuxulator: add linux_dummy.c based on amd64
emaste [Fri, 15 Jun 2018 19:42:52 +0000 (19:42 +0000)]
arm64 linuxulator: add linux_dummy.c based on amd64

A later change should deduplicate the multiple copies of this file.

Sponsored by: Turing Robotic Industries

6 years agoAdd a command the displays and modifies the pNFS server's extended attribute.
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.

6 years agoPut in temporary hacks for jevents.
bdrewery [Fri, 15 Jun 2018 19:19:36 +0000 (19:19 +0000)]
Put in temporary hacks for jevents.

- Handle 'make clean'
- Don't try building it locally, just fail instead.

jevents should really be merged into lib/libpmc/Makefile.

6 years agoarm64: add arm64 linux.h based on i386 linuxulator and Linux headers
emaste [Fri, 15 Jun 2018 19:09:17 +0000 (19:09 +0000)]
arm64: add arm64 linux.h based on i386 linuxulator and Linux headers

Sponsored by: Turing Robotic Industries

6 years agoThere's no need to walk through the tables looking for the smbios
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.

6 years agoMove arg parsing into its own routine for possible later reuse.
imp [Fri, 15 Jun 2018 19:07:31 +0000 (19:07 +0000)]
Move arg parsing into its own routine for possible later reuse.

6 years agoProvide a more direct interface to tell ZFS what the preferred handle
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.

Sponsored by: Netflix

6 years agoMigrate has_keyboard to bool.
imp [Fri, 15 Jun 2018 19:07:06 +0000 (19:07 +0000)]
Migrate has_keyboard to bool.

6 years agoRetain offset compatibility with pre-12.0 dumps
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.

Reviewed by: markj
X-MFC-With: r324965
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D15829

6 years agoCheck for a 'pci' prefix rather than a full match in get_addr_props
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.

Reviewed by: nwhitehorn, breno.leitao_gmail.com
Differential Revision: https://reviews.freebsd.org/D15817

6 years agolib32: Fix lib/libpmc/pmu-events files ending up in source directory.
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.

Reported by: rgrimes, kib, kevans
Sponsored by: Dell EMC

6 years agoRemove empty directory
imp [Fri, 15 Jun 2018 18:46:01 +0000 (18:46 +0000)]
Remove empty directory

6 years agocxgbe(4): sysctls to display the local and intr CPUs for the adapter.
np [Fri, 15 Jun 2018 18:04:44 +0000 (18:04 +0000)]
cxgbe(4): sysctls to display the local and intr CPUs for the adapter.

The driver assumes the list can change (even though it does't right now)
and queries it every time the sysctl runs.

sysctl dev.<nexus>.<inst>.local_cpus
sysctl dev.<nexus>.<inst>.intr_cpus

sysctl dev.t6nex.0.local_cpus
sysctl dev.t6nex.0.intr_cpus

Sponsored by: Chelsio Communications

6 years agoRemove obsolete asf(8)
emaste [Fri, 15 Jun 2018 17:44:21 +0000 (17:44 +0000)]
Remove obsolete asf(8)

kgdb now handles kernel module state internally, so the asf tool serves
no purpose.

PR: 229046
Reviewed by: brooks
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D15827

6 years agoAdd deprecation notice in asf.8
emaste [Fri, 15 Jun 2018 17:38:07 +0000 (17:38 +0000)]
Add deprecation notice in asf.8

PR: 229046
Reviewed by: jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

6 years agoextres/regulator: Switch boot_on/always_on sysctl to uint8
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.

Reviewed by: manu

6 years agoobjdump.1: manually apply r229046 to the rendered man page
emaste [Fri, 15 Jun 2018 17:16:27 +0000 (17:16 +0000)]
objdump.1: manually apply r229046 to the rendered man page

6 years agolibcompat: Only build libmagic build tool if MK_FILE is yes.
bdrewery [Fri, 15 Jun 2018 17:03:57 +0000 (17:03 +0000)]
libcompat: Only build libmagic build tool if MK_FILE is yes.

Sponsored by: Dell EMC

6 years agoAdd deprecation notice to objdump man page
emaste [Fri, 15 Jun 2018 17:03:49 +0000 (17:03 +0000)]
Add deprecation notice to objdump man page

PR: 229046
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D13881

6 years agoOnly build jevents if MK_PMC is yes and only for amd64 in libcompat.
bdrewery [Fri, 15 Jun 2018 16:48:09 +0000 (16:48 +0000)]
Only build jevents if MK_PMC is yes and only for amd64 in libcompat.

Sponsored by: Dell EMC

6 years agoaudit(4): Add a few tests for network-related syscalls
asomers [Fri, 15 Jun 2018 16:41:28 +0000 (16:41 +0000)]
audit(4): Add a few tests for network-related syscalls

Add tests for socket(2), socketpair(2), and setsockopt(2)

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15803

6 years agoCorrect kern.pre.mk comment: objcopy, not objdump, copies objects.
emaste [Fri, 15 Jun 2018 16:32:18 +0000 (16:32 +0000)]
Correct kern.pre.mk comment: objcopy, not objdump, copies objects.

PR: 229046
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

6 years agoldd: reference readelf instead of objdump in warning message
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

6 years agosrc.conf.5: regen after r335210, *BINUTILS description updates
emaste [Fri, 15 Jun 2018 16:25:36 +0000 (16:25 +0000)]
src.conf.5: regen after r335210, *BINUTILS description updates

Sponsored by: The FreeBSD Foundation

6 years agoMake virtio queue re-initialization steps to be similar to
br [Fri, 15 Jun 2018 16:19:10 +0000 (16:19 +0000)]
Make virtio queue re-initialization steps to be similar to
original initialization, so we don't miss few registers to
configure.

This fixes vtnet(4) operation with QEMU's virtio-net-device.

Tested in QEMU with FreeBSD/RISC-V.

Reviewed by: bryanv
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15821

6 years agoRemove objcopy from BINUTILS option descriptions
emaste [Fri, 15 Jun 2018 16:18:39 +0000 (16:18 +0000)]
Remove objcopy from BINUTILS option descriptions

As of r306649 objcopy is always ELF Tool Chain's elfcopy; binutils
objcopy is never used.

PR: 229046
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

6 years agoelf.5: add readelf cross-reference
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

6 years agoaudit(4): improve formatting in tests/sys/audit/open.c
asomers [Fri, 15 Jun 2018 15:36:10 +0000 (15:36 +0000)]
audit(4): improve formatting in tests/sys/audit/open.c

[skip ci]

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15797

6 years agoaudit(4): add tests for access(2), chmod(2), and friends
asomers [Fri, 15 Jun 2018 15:32:02 +0000 (15:32 +0000)]
audit(4): add tests for access(2), chmod(2), and friends

access(2), eaccess(2), faccessat(2), chmod(2), fchmod(2), lchmod(2), and
fchmodat(2).

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15805
Differential Revision: https://reviews.freebsd.org/D15808

6 years agoFix markup in zfs(8); no content change
vangyzen [Fri, 15 Jun 2018 15:28:31 +0000 (15:28 +0000)]
Fix markup in zfs(8); no content change

Sponsored by: Dell EMC

6 years agoAdd linprocfs support for min_free_kbytes
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.

Reviewed by: imp (mentor), emaste
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D15563

6 years agolinuxulator: do not include legacy syscalls on arm64
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.

Reviewed by: andrew
Sponsored by: Turing Robotic Industries
Differential Revision: https://reviews.freebsd.org/D15237

6 years agoCorrect debug control for linuxulator faccessat
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.

Sponsored by: Turing Robotic Industries

6 years agolinprocfs: add TracerPid to /proc/pid/status.
kib [Fri, 15 Jun 2018 13:56:58 +0000 (13:56 +0000)]
linprocfs: add TracerPid to /proc/pid/status.
Also fix the value of parent pid if the process is traced.

Submitted by: Yanko Yankulov <yanko.yankulov@gmail.com>
MFC after: 1 week

6 years agoAdd stubbed arm64 linuxulator /proc/cpuinfo handler
emaste [Fri, 15 Jun 2018 13:53:37 +0000 (13:53 +0000)]
Add stubbed arm64 linuxulator /proc/cpuinfo handler

Sponsored by: Turing Robotic Industries

6 years agoRevert r335173 at request of mmel@
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.

6 years agoWhen retransmitting TCP SYN-ACK segments with the TCP timestamp option
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

6 years agoAdd an entry into the Makefile for pnfsdskill.
rmacklem [Fri, 15 Jun 2018 11:54:55 +0000 (11:54 +0000)]
Add an entry into the Makefile for pnfsdskill.

pnfsdskill was added by r335192. This commit adds an entry for it to the
Makefile.

6 years agoAdd a command that disables a pNFS server mirrored DS.
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.

6 years agoallwinner: ccung: Fully subclass the clock drivers
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.

Tested on:    A83T, H5 A64
Tested on:    A20 (kevans)

6 years agoAdded option to cluster-align the start of the root directory.
delphij [Fri, 15 Jun 2018 06:03:40 +0000 (06:03 +0000)]
Added option to cluster-align the start of the root directory.

Obtained from: Android
Obtained from: https://android.googlesource.com/platform/system/core/+/052f27562154d175267999106bd6bf18fc8c363e
Obtained from: https://android.googlesource.com/platform/system/core/+/8218b6aae9cd4a19fa074a8a8203fe9275b35447
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D15672

6 years agobsdgrep(1): Remove redundant initialization; unconditionally assigned later
kevans [Fri, 15 Jun 2018 03:31:30 +0000 (03:31 +0000)]
bsdgrep(1): Remove redundant initialization; unconditionally assigned later

6 years agoofw_reg_to_paddr(): Fix minor typo in KASSERT message
jhibbits [Fri, 15 Jun 2018 03:28:05 +0000 (03:28 +0000)]
ofw_reg_to_paddr(): Fix minor typo in KASSERT message

6 years agoQuiet coretemp probe
mmacy [Fri, 15 Jun 2018 02:28:36 +0000 (02:28 +0000)]
Quiet coretemp probe

Only the first device will print
coretemp0: <CPU On-Die Thermal Sensors> numa-domain 0 on cpu0
instead of all hyper threads

Submitted by: kbowling
Reviewed by: imp, sbruno
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15727

6 years agoproc0_post: Fix some locking issues
bdrewery [Fri, 15 Jun 2018 00:36:41 +0000 (00:36 +0000)]
proc0_post: Fix some locking issues

- Filter out PRS_NEW procs as rufetch() tries taking the thread lock
  which may not yet be initialized.
- Hold PROC_LOCK to ensure stability of iterating the threads.
- p_rux fields are protected by the process statlock as well.

MFC after: 2 weeks
Reviewed by: kib
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D15809

6 years agoUse M_EXEC when calling malloc() to allocate the memory to store the module,
cognet [Thu, 14 Jun 2018 23:10:10 +0000 (23:10 +0000)]
Use M_EXEC when calling malloc() to allocate the memory to store the module,
as it'll contain executable code.

6 years agoExit with an error if a linker hints file can't be found.
jhb [Thu, 14 Jun 2018 22:31:30 +0000 (22:31 +0000)]
Exit with an error if a linker hints file can't be found.

Continuing with a NULL hints variable just triggers a segfault later on.
The other error cases in this function all exit for an error rather than
warning.

Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D15579

6 years agoTCPOUTFLAGS no longer exists since r334843.
glebius [Thu, 14 Jun 2018 22:25:10 +0000 (22:25 +0000)]
TCPOUTFLAGS no longer exists since r334843.

6 years agoProvide the ip6_plen in network byte order when calling ip6_output().
tuexen [Thu, 14 Jun 2018 21:30:52 +0000 (21:30 +0000)]
Provide the ip6_plen in network byte order when calling ip6_output().

This is not strictly required by ip6_output(), since it overrides it,
but it is needed for upcoming dtrace support.

6 years agoRegen after 335177 (rename sys_obreak to sys_break).
brooks [Thu, 14 Jun 2018 21:29:31 +0000 (21:29 +0000)]
Regen after 335177 (rename sys_obreak to sys_break).

6 years agoName the implementation of brk and sbrk sys_break().
brooks [Thu, 14 Jun 2018 21:27:25 +0000 (21:27 +0000)]
Name the implementation of brk and sbrk sys_break().

The break() system call was renamed (several times) starting in v3
AT&T UNIX when C was invented and break was a language keyword. The
last vestage of a need for it to be called something else (eg obreak)
was removed in r225617 which consistantly prefixed all syscall
implementations.

Reviewed by: emaste, kib (older version)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15638

6 years agoWhitespace changes.
tuexen [Thu, 14 Jun 2018 21:22:14 +0000 (21:22 +0000)]
Whitespace changes.

6 years agoAdd a new man page that briefly describes the pNFS variant of the NFSv4.1
rmacklem [Thu, 14 Jun 2018 21:12:08 +0000 (21:12 +0000)]
Add a new man page that briefly describes the pNFS variant of the NFSv4.1
protocol.

This is a content change.

6 years agoDocument the "-p" and "-m" options added to nfsd.c by r335172.
rmacklem [Thu, 14 Jun 2018 20:55:33 +0000 (20:55 +0000)]
Document the "-p" and "-m" options added to nfsd.c by r335172.

This is a content change.

6 years agoextres/regulator: Properly refcount gpio regulators
kevans [Thu, 14 Jun 2018 20:37:25 +0000 (20:37 +0000)]
extres/regulator: Properly refcount gpio regulators

regnode::enable_cnt is generally used to refcount regulator nodes. For
GPIOs, the refcount was done on the gpio_entry since more than one regulator
can share a GPIO.

GPIO regulators were not taking part in the node refcount, since they had
their own mechanism. This caused some fallout after manu started disabling
everybody's unused regulators in r331989.

Refcount it.

Glanced over by: manu

6 years agoAdd the "-p" and "-m" options to nfsd.c for the pNFS service.
rmacklem [Thu, 14 Jun 2018 20:36:55 +0000 (20:36 +0000)]
Add the "-p" and "-m" options to nfsd.c for the pNFS service.

The "-p" option specifies that the nfsd should run a pNFS service instead
of a regular NFS service. The "-m" option is only meaningful when used with
"-p" to specify that mirroring on the DSs should be done and on how many of
them.
This change requires the kernel changes committed as r334930.
The man page update will be committed as a separate commit soon.

6 years agoHandle the race between fork/vm_object_split() and faults.
kib [Thu, 14 Jun 2018 19:41:02 +0000 (19:41 +0000)]
Handle the race between fork/vm_object_split() and faults.

If fault started before vmspace_fork() locked the map, and then during
fork, vm_map_copy_entry()->vm_object_split() is executed, it is
possible that the fault instantiate the page into the original object
when the page was already copied into the new object (see
vm_map_split() for the orig/new objects terminology). This can happen
if split found a busy page (e.g. from the fault) and slept dropping
the objects lock, which allows the swap pager to instantiate
read-behind pages for the fault.  Then the restart of the scan can see
a page in the scanned range, where it was already copied to the upper
object.

Fix it by instantiating the read-ahead pages before
swap_pager_getpages() method drops the lock to allocate pbuf.  The
object scan would see the whole range prefilled with the busy pages
and not proceed the range.

Note that vm_fault rechecks the map generation count after the object
unlock, so that it restarts the handling if raced with split, and
re-lookups the right page from the upper object.

In collaboration with: alc
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agomx25l: compat_data is only defined when FDT is
manu [Thu, 14 Jun 2018 19:01:40 +0000 (19:01 +0000)]
mx25l: compat_data is only defined when FDT is

Reported by: O. Hartmann <ohartmann@walstatt.org>

6 years agoa10_ahci: Correct clock indices for new bindings
kevans [Thu, 14 Jun 2018 18:34:02 +0000 (18:34 +0000)]
a10_ahci: Correct clock indices for new bindings

r329104 imported 4.15 DTS which brought CCU to a10/a20. In the process, they
swapped the ordering of 'clocks' for allwinner,sun4i-a10-ahci on both
sun4i-a10 and sun7i-a20 from PLL, Gate to Gate, PLL.

Swap it in the driver.

6 years agoaw_ccung: Add a10/a20 support
kevans [Thu, 14 Jun 2018 17:50:29 +0000 (17:50 +0000)]
aw_ccung: Add a10/a20 support

Note: At this time, this has only been tested on a single board from one of
the supported SoCs. This is enough to boot the board from MMC and have
functional USB- which is still an improvement over where we were at just
before with no functional clocks.

Differential Revision: https://reviews.freebsd.org/D15810

6 years agoaw_ccung: Support clock factors where factor=0, factor is effectively 1
kevans [Thu, 14 Jun 2018 17:36:02 +0000 (17:36 +0000)]
aw_ccung: Support clock factors where factor=0, factor is effectively 1

This happens in two cases for a20 clocks:

pll_core for 'n' factor:
factor=0, val=1
factor=n, val=n

ahb divisor:
factor=0,val=/2
factor=n,val=/2^n

Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D15806

6 years agoarm timer: Use the default get_cntxct by default
manu [Thu, 14 Jun 2018 17:32:23 +0000 (17:32 +0000)]
arm timer: Use the default get_cntxct by default

Reported by: kevans

6 years agoSplit the PowerISA 3.0 HPT implementation from historic
jhibbits [Thu, 14 Jun 2018 17:23:51 +0000 (17:23 +0000)]
Split the PowerISA 3.0 HPT implementation from historic

PowerISA 3.0 makes several changes to not only the format of the HPT but
also the behavior surrounding it.  For instance, TLBIE no longer requires
serialization.  Removing this lock cuts buildworld time in half on a
18-core/72-thread POWER9 system, demonstrating that this lock is highly
contended on such a system.

There was odd behavior observed trying to make this change in a
backwards-compatible manner in moea64_native.c, so the best option was to
fully split it, and largely revert the original changes adding POWER9
support to the original file.

Suggested by: nwhitehorn

6 years agomx25l: Add pnp info
manu [Thu, 14 Jun 2018 17:21:09 +0000 (17:21 +0000)]
mx25l: Add pnp info

6 years agospi: Add SPIBUS_PNP_INFO macro
manu [Thu, 14 Jun 2018 17:20:47 +0000 (17:20 +0000)]
spi: Add SPIBUS_PNP_INFO macro

The PNP info string is the same as the SIMPLEBUS one but driver should
depend on spibus and not simplebus

6 years agoaw_spi: Add pnp info
manu [Thu, 14 Jun 2018 17:19:44 +0000 (17:19 +0000)]
aw_spi: Add pnp info

6 years agoarm timer: Add workaround for Allwinner A64 timer
manu [Thu, 14 Jun 2018 17:18:15 +0000 (17:18 +0000)]
arm timer: Add workaround for Allwinner A64 timer

The timer present in allwinner A64 SoC is unstable, value can jump backward
or forward.
It was found that when bit 11 and upper roll over the low bits can sometimes
being read as all as 1 or all as 0.
Simply ignore the values for those cases.

6 years agoFix da(4) locking when probing SMR drives.
ken [Thu, 14 Jun 2018 17:08:44 +0000 (17:08 +0000)]
Fix da(4) locking when probing SMR drives.

Probing host aware and host managed SMR drives got broken in revision
330796.

The added cam_periph_lock() calls were in areas in dadone() where
the peripheral lock was already held.

Since then, dadone() has been split into separate functions that are
dedicated to each probe state.

The result is that when probing a host aware drive, I ran into a recursive
lock acquisition in dadone_probeatalogdir(). I would have run into the
same problem in dadone_probeataiddir(), and in dadone_probeatasup() and
dadone_probeatazone() in the error paths had the probe continued.

The solution is to take out all of the extra cam_periph_lock() calls. I
also added cam_periph_assert(periph, MA_OWNED) near the top of each of
the dadone_* calls. These make it clear to anyone coming along in the
the future that the lock is held in the probe done functions.

Also add a locking assert in daprobedone(), to make it clear that it must
be called with the periph lock held.

Sponsored by: Spectra Logic
Differential Revision: https://reviews.freebsd.org/D15764

6 years agolibsa: open() should use NULL instead of typecasted 0
tsoome [Thu, 14 Jun 2018 16:11:50 +0000 (16:11 +0000)]
libsa: open() should use NULL instead of typecasted 0

6 years agodevmatch: Address some rc nits
kevans [Thu, 14 Jun 2018 16:09:29 +0000 (16:09 +0000)]
devmatch: Address some rc nits

- devmatch_enable in rc.conf(5) was not gating the start of devmatch

- Use quietstart in devd/devmatch to suppress dozens of 'Cannot start'
  messages and other spurious messages from rc.subr(8) that aren't
  necessarily helpful.

Discussed with: imp

6 years agoFix CTR formatting for moea64_native bootstrap
jhibbits [Thu, 14 Jun 2018 16:01:11 +0000 (16:01 +0000)]
Fix CTR formatting for moea64_native bootstrap

On very large memory systems 'size' can become 2GB or larger, resulting in a
negative value being formatted.  Also, moea64_pteg_count is already a long, so
format it as such.

6 years agoaudit(4): add tests for fhopen, fhstat, and fhstatfs
asomers [Thu, 14 Jun 2018 15:04:49 +0000 (15:04 +0000)]
audit(4): add tests for fhopen, fhstat, and fhstatfs

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15798

6 years agoAdd missing BPF_MTAP2() for outbound packets.
ae [Thu, 14 Jun 2018 15:04:30 +0000 (15:04 +0000)]
Add missing BPF_MTAP2() for outbound packets.

6 years agoConvert if_me(4) driver to use encap_lookup_t method and be lockless on
ae [Thu, 14 Jun 2018 14:53:24 +0000 (14:53 +0000)]
Convert if_me(4) driver to use encap_lookup_t method and be lockless on
data path.

6 years agoaudit(4): fix typo from r335136
asomers [Thu, 14 Jun 2018 14:53:01 +0000 (14:53 +0000)]
audit(4): fix typo from r335136

Typo in Makefile accidentally disabled some older tests

MFC after: 2 weeks
X-MFC-With: 335136

6 years agoaudit(4): add tests for flock, fcntl, and fsync
asomers [Thu, 14 Jun 2018 13:42:58 +0000 (13:42 +0000)]
audit(4): add tests for flock, fcntl, and fsync

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15795

6 years agolinuxolator/amd64: Don't mangle %r10 on return from syscall for EJUSTRETURN.
kib [Thu, 14 Jun 2018 12:35:57 +0000 (12:35 +0000)]
linuxolator/amd64: Don't mangle %r10 on return from syscall for EJUSTRETURN.

This fixes the %r10 content for rt_sigreturn.

Submitted by: Yanko Yankulov <yanko.yankulov@gmail.com>
MFC after: 1 week

6 years agotop(1): remove myself from top.1
eadler [Thu, 14 Jun 2018 12:14:51 +0000 (12:14 +0000)]
top(1): remove myself from top.1

I wrote some, but not enough for the man page.

6 years agoIn m_megapullup() use m_getjcl() to allocate 9k or 16k mbuf when requested.
ae [Thu, 14 Jun 2018 11:15:39 +0000 (11:15 +0000)]
In m_megapullup() use m_getjcl() to allocate 9k or 16k mbuf when requested.

It is better to try allocate a big mbuf, than just silently drop a big
packet. A better solution could be reworking of libalias modules to be
able use m_copydata()/m_copyback() instead of requiring the single
contiguous buffer.

PR: 229006
MFC after: 1 week