freebsd.git
5 years agopraudit(1): return 0 on success
asomers [Sun, 17 Jun 2018 17:10:35 +0000 (17:10 +0000)]
praudit(1): return 0 on success

Cherry pick https://github.com/openbsm/openbsm/commit/ed83bb3

Submitted by: aniketp
Reviewed by: rwatson, 0mp
Obtained from: OpenBSM
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Pull Request: https://github.com/openbsm/openbsm/pull/32

5 years agoMake the pNFS NFSv4.1 client return a Flexible File layout upon error.
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.

MFC after: 2 weeks

5 years agoaudit(4): Add tests for a few syscalls in the ad class
asomers [Sun, 17 Jun 2018 16:24:46 +0000 (16:24 +0000)]
audit(4): Add tests for a few syscalls in the ad class

The ad audit class is for administrative commands.  This commit adds test
for settimeofday, adjtime, and getfh.

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

5 years agoaudit(4): add tests for extattr_get_file(2) and friends
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.

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

5 years agoBuild LOCAL_LIB_DIRS along with system lib dirs, rather than building them
ian [Sun, 17 Jun 2018 14:13:45 +0000 (14:13 +0000)]
Build LOCAL_LIB_DIRS along with system lib dirs, rather than building them
in parallel with LOCAL_DIRS and all the other system post-libs stuff.

5 years agoFix false positive on failure
slavash [Sun, 17 Jun 2018 07:08:47 +0000 (07:08 +0000)]
Fix false positive on failure

When running mckey, errors may happen in the init/connect stage.
When leaving multicast groups, we override this value.

Fix that by saving the return value from rdma_leave_multicast to different
parameter, and only in case of failure in rdma_leave_multicast override it.

MFC after:      1 week
Approved by:    hselasky (mentor), kib (mentor)
Sponsored by:   Mellanox Technologies

5 years agosysrc.subr: Fix display when value is "-n"
dteske [Sun, 17 Jun 2018 06:25:32 +0000 (06:25 +0000)]
sysrc.subr: Fix display when value is "-n"

PR: bin/226406
Reported by: Marius Halden <marius.halden@modirum.com>
MFC after: 1 week
X-MFC-to: stable/11
Sponsored by: Smule, Inc.

5 years agosysrc.subr: Fix handling of files with missing newline at EOF
dteske [Sun, 17 Jun 2018 06:03:48 +0000 (06:03 +0000)]
sysrc.subr: Fix handling of files with missing newline at EOF

PR: bin/203435
Reported by: Andreas Sommer <andreas.sommer87@googlemail.com>
MFC after: 1 week
X-MFC-to: stable/11
Sponsored by: Smule, Inc.

5 years agorootgen.sh: complete all profiles except GELI+MBR (not supported)
allanjude [Sun, 17 Jun 2018 05:55:31 +0000 (05:55 +0000)]
rootgen.sh: complete all profiles except GELI+MBR (not supported)

This extends the test suite to generate images for every combination of:
amd64: mbr/gpt geli/nogeli ufs/zfs legacy/uefi/both

Except for mbr+geli, which is not currently possible.

Reviewed by: imp (previous version)
Sponsored by: Klara Systems
Differential Revision: https://reviews.freebsd.org/D15846

5 years agopwd: mark usage as dead
eadler [Sun, 17 Jun 2018 05:14:50 +0000 (05:14 +0000)]
pwd: mark usage as dead

5 years agosysrc(8): Exit with failure on API error
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.

5 years agogptboot, zfsboot, gptzfsboot: Enable the video and serial consoles early
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

5 years agoaudit(4): add tests for chflags and friends
asomers [Sun, 17 Jun 2018 03:10:25 +0000 (03:10 +0000)]
audit(4): add tests for chflags and friends

chflags, fchflags, and lchflags (but not chflagsat) are included.

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

5 years agoFreeBSD/amd64 requires 256MiB to boot UEFI, 128MB simply doesn't work.
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.

5 years agogvinum: revert WARNS change in Makefile
eadler [Sun, 17 Jun 2018 01:39:22 +0000 (01:39 +0000)]
gvinum: revert WARNS change in Makefile

Architectures that passed on a local build universe, failed on
tinderbox. Revert the number change for now while I investigate.

5 years agoMany netboot scenarios don't have /boot/defaults/loader.conf. As
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.

5 years agoddb: unbreak ppc
eadler [Sun, 17 Jun 2018 00:00:24 +0000 (00:00 +0000)]
ddb: unbreak ppc

usr/src/powerpc.powerpcspe/tmp/usr/include/strings.h:62:
warning: shadowed declaration is here

5 years agoliby: build with WARNS=6
eadler [Sat, 16 Jun 2018 23:50:34 +0000 (23:50 +0000)]
liby: build with WARNS=6

Tested with amd64, arm64, i386, mips

5 years agonetrate: build with WARNS=6
eadler [Sat, 16 Jun 2018 23:49:22 +0000 (23:49 +0000)]
netrate: build with WARNS=6

Tested with amd64, i386

5 years agoquotacheck: build with WARNS=3
eadler [Sat, 16 Jun 2018 23:47:59 +0000 (23:47 +0000)]
quotacheck: build with WARNS=3

WARNS++

Tested with amd64, arm64, i386, mips

5 years agogvinum: build with WARNS=6
eadler [Sat, 16 Jun 2018 23:45:59 +0000 (23:45 +0000)]
gvinum: build with WARNS=6

This also removes an unused and uninitialized variable.

Tested with amd64, arm64, i386, mips

5 years agoddb: build with WARNS=6
eadler [Sat, 16 Jun 2018 23:44:18 +0000 (23:44 +0000)]
ddb: build with WARNS=6

Tested with amd64, arm64, i386, mips

5 years agounits: fix some nits
eadler [Sat, 16 Jun 2018 21:07:46 +0000 (21:07 +0000)]
units: fix some nits

- prefer braces to abusing the `,` operator
- mark dead function as dead
- remove dead break

5 years agoFix comparison between pointer and char literal
dteske [Sat, 16 Jun 2018 20:00:41 +0000 (20:00 +0000)]
Fix comparison between pointer and char literal

PR: misc/204252
Reported by: David Binderman <dcb314@hotmail.com>
MFC after: 3 days
X-MFC-to: stable/11, stable/10

5 years agoFix NFSv4.1 client side handling of "soft,retrans=2" mounts.
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.

MFC after: 2 weeks

5 years agoFix typo.
ae [Sat, 16 Jun 2018 19:21:09 +0000 (19:21 +0000)]
Fix typo.

Reported by: rpokala

5 years agoaudit(4): add tests for pathconf(2) and friends
asomers [Sat, 16 Jun 2018 18:29:24 +0000 (18:29 +0000)]
audit(4): add tests for pathconf(2) and friends

pathconf, lpathconf, and fpathconf are included

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

5 years agoaudit(4): add tests for POSIX message queues
asomers [Sat, 16 Jun 2018 18:22:35 +0000 (18:22 +0000)]
audit(4): add tests for POSIX message queues

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

5 years agorootgen.sh: Don't copy various bits of the bootcode from the running system
allanjude [Sat, 16 Jun 2018 17:45:44 +0000 (17:45 +0000)]
rootgen.sh: Don't copy various bits of the bootcode from the running system

We want to use the versions of the bootcode we just built, rather than
ones from whatever happens to be in /boot on the test machine

These were incorrectly added by me in r334888

5 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

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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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.

5 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

5 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.

5 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.

5 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

5 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.

5 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.

5 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

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

5 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

5 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

5 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

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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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.

5 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

5 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.

5 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.

5 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)

5 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

5 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

5 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

5 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

5 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

5 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.

5 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

5 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.

5 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.

5 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).