]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoaudit(4): add tests for utimes(2) and friends, mprotect, and undelete
Alan Somers [Tue, 19 Jun 2018 16:55:39 +0000 (16:55 +0000)]
audit(4): add tests for utimes(2) and friends, mprotect, and undelete

Includes utimes(2), futimes(2), lutimes(2), futimesat(2), mprotect(2), and
undelete(2).  undelete, for now, is tested only in failure mode.

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

6 years agoMove common GIC interrupt numbers to the common header. These are the same
Andrew Turner [Tue, 19 Jun 2018 16:14:23 +0000 (16:14 +0000)]
Move common GIC interrupt numbers to the common header. These are the same
across the GICv2 and GICv3 drivers so we only need a single copy of them.

Sponsored by: Turing Robotic Industries

6 years agoRemove "diff" line indicator. Next to see if this code works or not.
Sean Bruno [Tue, 19 Jun 2018 15:55:21 +0000 (15:55 +0000)]
Remove "diff" line indicator.  Next to see if this code works or not.

Submitted by: mmacy
Sponsored by: Limelight Networks

6 years agolualoader: Correct kernel_options handling
Kyle Evans [Tue, 19 Jun 2018 15:05:31 +0000 (15:05 +0000)]
lualoader: Correct kernel_options handling

`kernel_options` were being passed as flags to load, rather than to the
kernel being loaded. This is the kernel_options counterpart to r335009.

6 years agoo Implement unw_getcontext()
Ruslan Bukin [Tue, 19 Jun 2018 14:46:59 +0000 (14:46 +0000)]
o Implement unw_getcontext()
o Restore floating-point registers in jumpto()

These are required to native cross build GCC and GDB
(both do require libc++ and libunwind).

These are not tested.

Sponsored by: DARPA, AFRL

6 years agoDon't use TARGET_ARCH in this file, use MACHINE_ARCH instead.
Ruslan Bukin [Tue, 19 Jun 2018 13:28:02 +0000 (13:28 +0000)]
Don't use TARGET_ARCH in this file, use MACHINE_ARCH instead.

TARGET_ARCH is not defined when building ports/packages.

Sponsored by: DARPA, AFRL

6 years agoshare/misc/organization.dot: updates
Kurt Jaeger [Tue, 19 Jun 2018 12:16:19 +0000 (12:16 +0000)]
share/misc/organization.dot: updates

- add krion, philip to postmaster@
- remove trhodes from donations@, email bounces

Approved by: remko

6 years agoDon't try to turn power down MMC bus if it is already down
Ilya Bakulin [Tue, 19 Jun 2018 11:28:50 +0000 (11:28 +0000)]
Don't try to turn power down MMC bus if it is already down

Regulator framework doens't like turning off already turned off
regulators, so we get panic on AllWinner boards.

Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D15890

6 years agoCorrectly define rawscr so initializing it doesn't result in overwriting memory.
Ilya Bakulin [Tue, 19 Jun 2018 11:25:40 +0000 (11:25 +0000)]
Correctly define rawscr so initializing it doesn't result in overwriting memory.

We need 8 bytes of storage for rawscr.

Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D15889

6 years agoSet MMC_DATA_MULTI flag when doing multi-block transfers
Ilya Bakulin [Tue, 19 Jun 2018 11:23:48 +0000 (11:23 +0000)]
Set MMC_DATA_MULTI flag when doing multi-block transfers

Lower layers (MMC / SDHCI controller drivers) may make certain decisions
based on the presence of this flag. The fact that sdhci.c doesn't
look at this flag is another problem that should be fixed separately.

Found when adding MMCCAM support to AllWinner MMC controller driver
where the presence of this flag actually matters.

Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D15888

6 years agoMake sure that the t_peakrate_thr is not compiled in
Randall Stewart [Tue, 19 Jun 2018 11:20:28 +0000 (11:20 +0000)]
Make sure that the t_peakrate_thr is not compiled in
by default until NF can upstream it.

Reviewed by: and suggested lstewart
Sponsored by: Netflix Inc.

6 years agoMove BPFIF_* macro definitions into .c file, where struct bpf_if is
Andrey V. Elsukov [Tue, 19 Jun 2018 10:34:45 +0000 (10:34 +0000)]
Move BPFIF_* macro definitions into .c file, where struct bpf_if is
declared.

They are only used in this file and there is no need to export them via
bpfdesc.h.

6 years agoMove the tp set back to where it was before
Randall Stewart [Tue, 19 Jun 2018 05:28:14 +0000 (05:28 +0000)]
Move the tp set back to where it was before
we started playing with the VNET sets. This
way we have verified the INP settings before
we go to the trouble of de-referencing it.

Reviewed by: and suggested by lstewart
Sponsored by: Netflix Inc.

6 years agotop(1): correct assertion
Eitan Adler [Tue, 19 Jun 2018 05:01:07 +0000 (05:01 +0000)]
top(1): correct assertion

6 years agotop(1): correct header in UP mode
Eitan Adler [Tue, 19 Jun 2018 04:18:23 +0000 (04:18 +0000)]
top(1): correct header in UP mode

Fix an oversight from r334869 which made the same change, but only for
SMP systems. This avoids a segfault while D15801 is being reviewed.

Reviewed by: kevans

6 years agoixl(4): Remove ixlvc.c from files.amd64
Eric Joyner [Tue, 19 Jun 2018 03:11:09 +0000 (03:11 +0000)]
ixl(4): Remove ixlvc.c from files.amd64

ixlvc.c is only used by the VF driver (ixlv), and that driver currently doesn't work.

It will be re-added once the VF driver is finished being ported to iflib.

6 years agoremove ixl iwarp and ixlv from the build until they are in a working state
Matt Macy [Tue, 19 Jun 2018 02:48:53 +0000 (02:48 +0000)]
remove ixl iwarp and ixlv from the build until they are in a working state

6 years agoconvert inpcbinfo hash and info rwlocks to epoch + mutex
Matt Macy [Tue, 19 Jun 2018 01:54:00 +0000 (01:54 +0000)]
convert inpcbinfo hash and info rwlocks to epoch + mutex

- Convert inpcbinfo info & hash locks to epoch for read and mutex for write
- Garbage collect code that handled INP_INFO_TRY_RLOCK failures as
  INP_INFO_RLOCK which can no longer fail

When running 64 netperfs sending minimal sized packets on a 2x8x2 reduces
unhalted core cycles samples in rwlock rlock/runlock in udp_send from 51% to
3%.

Overall packet throughput rate limited by CPU affinity and NIC driver design
choices.

On the receiver unhalted core cycles samples in in_pcblookup_hash went from
13% to to 1.6%

Tested by LLNW and pho@

Reviewed by: jtl
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15686

6 years agoFix amq -i timestamp segmentation violation.
Cy Schubert [Tue, 19 Jun 2018 01:33:03 +0000 (01:33 +0000)]
Fix amq -i timestamp segmentation violation.

MFC after: 1 week

6 years agoaudit(4): add tests for ioctl(2)
Alan Somers [Tue, 19 Jun 2018 01:32:33 +0000 (01:32 +0000)]
audit(4): add tests for ioctl(2)

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

6 years agoDon't bootstrap lld if an external linker is used.
Bryan Drewery [Tue, 19 Jun 2018 01:00:27 +0000 (01:00 +0000)]
Don't bootstrap lld if an external linker is used.

Sponsored by: Dell EMC

6 years agocxgbe(4): Some mailbox commands require access to the Tx pipeline and
Navdeep Parhar [Tue, 19 Jun 2018 00:50:27 +0000 (00:50 +0000)]
cxgbe(4): Some mailbox commands require access to the Tx pipeline and
can time out if it's backed up due to a non-stop deluge of PAUSE frames
from a misbehaving peer.  Detect this situation and toggle MPS TxEn
to allow forward progress.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

6 years agortwn(4): decode some bit fields + merge duplicate code.
Andriy Voskoboinyk [Tue, 19 Jun 2018 00:38:28 +0000 (00:38 +0000)]
rtwn(4): decode some bit fields + merge duplicate code.

Add macros for R12A_RXDMA_PRO register (descriptions were seen in the
RTL8822B vendor driver) and merge 2 r21au_init_burstlen() copies.

No functional change intended.

6 years agoAdd my script for coping with git-svn and the need to rebase
Warner Losh [Tue, 19 Jun 2018 00:27:30 +0000 (00:27 +0000)]
Add my script for coping with git-svn and the need to rebase
changes for different branches. It's a bit rough right now,
but should be good enough for most people to try to use. It's
definitely 'tools' tree quality.

6 years agoSwitch to creating UEFI ESPs using loader.efi instead of boot1.efi.
Warner Losh [Mon, 18 Jun 2018 23:16:47 +0000 (23:16 +0000)]
Switch to creating UEFI ESPs using loader.efi instead of boot1.efi.
Cope for the fact that laoder.efi, not being boot1, doesn't read
/boot.config by setting boot_serial and force the serial console.

Also add sysctl so we can display the boot method.

Provide a variable, do_boot1_efi, if you want to use boot1 for
testing. But since it's transient, it's just a variable and not
available on the command line.

6 years agolibnv: add note about nvlist_pack and nvlist_unpack
Mariusz Zaborski [Mon, 18 Jun 2018 23:00:15 +0000 (23:00 +0000)]
libnv: add note about nvlist_pack and nvlist_unpack

Fix small typo as well.

Submitted by: Mindaugas Rasiukevicius <rmind@netbsd.org>

6 years agolibnv: Add nvlist_append_*_array() family of functions.
Mariusz Zaborski [Mon, 18 Jun 2018 22:57:32 +0000 (22:57 +0000)]
libnv: Add nvlist_append_*_array() family of functions.

The nvlist_append_{bool,number,string,nvlist,descriptor}_array() functions
allows to dynamically extend array stored in the nvlist.

Submitted by: Mindaugas Rasiukevicius <rmind@netbsd.org>

6 years agoremove epoch_test from default build
Matt Macy [Mon, 18 Jun 2018 22:27:29 +0000 (22:27 +0000)]
remove epoch_test from default build

6 years agolibnv: add regression test for r335344.
Mariusz Zaborski [Mon, 18 Jun 2018 22:22:06 +0000 (22:22 +0000)]
libnv: add regression test for r335344.

6 years agolibnv: clean parent in nvlist_array when removing it.
Mariusz Zaborski [Mon, 18 Jun 2018 22:21:28 +0000 (22:21 +0000)]
libnv: clean parent in nvlist_array when removing it.

When we are removing element form the nvlist we should also clean parent,
because the array is not a part of the nvlist anymore.

Submitted by: Mindaugas Rasiukevicius <rmind@netbsd.org>

6 years agolibnv: Remove nvlist argument from cnvlist_{take,free}_* functions.
Mariusz Zaborski [Mon, 18 Jun 2018 21:26:58 +0000 (21:26 +0000)]
libnv: Remove nvlist argument from cnvlist_{take,free}_* functions.

All information which are need for those operations is already stored in
the cookie.

We decided not to bump libnv version because this API is not used yet in the
base system.

Reviewed by: pjd

6 years agolibnv: add const to cookies arguments
Mariusz Zaborski [Mon, 18 Jun 2018 21:23:40 +0000 (21:23 +0000)]
libnv: add const to cookies arguments

Pointed out by: pjd@

6 years agolibnv: change name of cookie from cookiep to cookie.
Mariusz Zaborski [Mon, 18 Jun 2018 21:18:20 +0000 (21:18 +0000)]
libnv: change name of cookie from cookiep to cookie.

The name was inconsistent with rest of the library.
No functional change intended.

Pointed out by: pjd@

6 years agoixl(4): Update version number to 2.0.0-k
Eric Joyner [Mon, 18 Jun 2018 20:32:53 +0000 (20:32 +0000)]
ixl(4): Update version number to 2.0.0-k

And update copyrights to current year.

MFC after: 1 month
Sponsored by: Intel Corporation

6 years agoixl(4): Update to use iflib
Eric Joyner [Mon, 18 Jun 2018 20:12:54 +0000 (20:12 +0000)]
ixl(4): Update to use iflib

Update the driver to use iflib in order to bring performance,
maintainability, and (hopefully) stability benefits to the driver.

The driver currently isn't completely ported; features that are missing:

- VF driver (ixlv)
- SR-IOV host support
- RDMA support

The plan is to have these re-added to the driver before the next FreeBSD release.

Reviewed by: gallatin@
Contributions by: gallatin@, mmacy@, krzysztof.galazka@intel.com
Tested by: jeffrey.e.pieper@intel.com
MFC after: 1 month
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D15577

6 years agoRemove stray debugging line.
Warner Losh [Mon, 18 Jun 2018 19:53:11 +0000 (19:53 +0000)]
Remove stray debugging line.

Noticed by: ian@

6 years agoRemove now-empty geli directory
Warner Losh [Mon, 18 Jun 2018 19:40:21 +0000 (19:40 +0000)]
Remove now-empty geli directory

6 years agoIntroduce arm64 linuxulator stubs
Ed Maste [Mon, 18 Jun 2018 19:34:34 +0000 (19:34 +0000)]
Introduce arm64 linuxulator stubs

This provides stub implementations of arm64 Linux vdso and machdep,
ptrace, and futex sufficient for executing an arm64 Linux 'hello world'
binary.

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

6 years agolinuxulator: add debugging for invalid capget/capset version
Ed Maste [Mon, 18 Jun 2018 18:43:45 +0000 (18:43 +0000)]
linuxulator: add debugging for invalid capget/capset version

Sponsored by: Turing Robotic Industries Inc.

6 years agoThe IP, TCP, and UDP provider report IP addresses as strings.
Michael Tuexen [Mon, 18 Jun 2018 18:35:29 +0000 (18:35 +0000)]
The IP, TCP, and UDP provider report IP addresses as strings.
In some cases, the required information is not available and the
UDP provider reported an empty string in this case and the IP
and TCP provider reported a NULL pointer.

This patch changes the value provided in this case to the string
"<unknown>". This make the behaviour consistent and in-line with
the behaviour of Solaris.

Reviewed by: markj@, dteske@, gnn@
Differential Revision: https://reviews.freebsd.org/D15855

6 years agoRegen arm64 linuxulator sysent files after r335323
Ed Maste [Mon, 18 Jun 2018 18:10:11 +0000 (18:10 +0000)]
Regen arm64 linuxulator sysent files after r335323

6 years agoarm64 linuxulator: add dup syscall entry
Ed Maste [Mon, 18 Jun 2018 18:08:19 +0000 (18:08 +0000)]
arm64 linuxulator: add dup syscall entry

Missed in r333027

Sponsored by: Turing Robotic Industries Inc.

6 years agoiflib: Style fixes
Eric Joyner [Mon, 18 Jun 2018 17:27:43 +0000 (17:27 +0000)]
iflib: Style fixes

MFC after: 1 week

6 years agostand: move libgeliboot into libsa.
Warner Losh [Mon, 18 Jun 2018 16:24:42 +0000 (16:24 +0000)]
stand: move libgeliboot into libsa.

Reduce by 1 the number of crazy libraries we need in stand by moving
geli into libsa (where architecturally it belonged all along). This
just moves things around without any code changes.

6 years agoaudit(4): Add tests for {get/set}auid, {get/set}audit, {get/set}audit_addr
Alan Somers [Mon, 18 Jun 2018 15:37:43 +0000 (15:37 +0000)]
audit(4): Add tests for {get/set}auid, {get/set}audit, {get/set}audit_addr

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

6 years agoaudit(4): add tests for send, recv, sendto, and recvfrom
Alan Somers [Mon, 18 Jun 2018 15:27:31 +0000 (15:27 +0000)]
audit(4): add tests for send, recv, sendto, and recvfrom

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

6 years agoaudit(4): add tests for extattr_set_file and friends
Alan Somers [Mon, 18 Jun 2018 15:07:10 +0000 (15:07 +0000)]
audit(4): add tests for extattr_set_file and friends

Includes extattr_{set_file, _set_fd, _set_link, _delete_file, _delete_fd,
_delete_link}

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

6 years agoMove to using the inp->vnet pointer has suggested by lstewart.
Randall Stewart [Mon, 18 Jun 2018 14:10:12 +0000 (14:10 +0000)]
Move to using the inp->vnet pointer has suggested by lstewart.
This is far better since the hpts system is using the inp
as its basis anyway. Unfortunately his comments came late.

Sponsored by: Netflix Inc.

6 years agoImprove spelling and capitalize "Kerberos".
Edward Tomasz Napierala [Mon, 18 Jun 2018 13:49:44 +0000 (13:49 +0000)]
Improve spelling and capitalize "Kerberos".

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agolinsysfs: depend on linux_common module on arm64, as on amd64
Ed Maste [Mon, 18 Jun 2018 13:26:45 +0000 (13:26 +0000)]
linsysfs: depend on linux_common module on arm64, as on amd64

Sponsored by: Turing Robotic Industries

6 years agoFix bad logic in iovlist_truncate().
Ed Schouten [Mon, 18 Jun 2018 06:01:28 +0000 (06:01 +0000)]
Fix bad logic in iovlist_truncate().

To conform to RFC 5426, this function is intended to truncate messages
if they exceed the message size limits. Unfortunately, the amount of
space was computed the wrong way around, causing messages to be
truncated entirely.

Reported by: Michael Grimm on stable@
MFC after: 3 days

6 years agolibcapsicum: adding missing man page links
Eitan Adler [Mon, 18 Jun 2018 04:58:48 +0000 (04:58 +0000)]
libcapsicum: adding missing man page links

6 years agodc: make use of caph_enter
Eitan Adler [Mon, 18 Jun 2018 04:54:09 +0000 (04:54 +0000)]
dc: make use of caph_enter

We already use caph library so this makes sense.

6 years agoFix 32-bit build after 335307
Alan Somers [Mon, 18 Jun 2018 04:12:58 +0000 (04:12 +0000)]
Fix 32-bit build after 335307

This was correct in the final version on Phabricator, but somehow I screwed
up applying the patch locally.

Reported by: linimon
Pointy-hat-to: asomers
MFC after: 2 weeks
X-MFC-With: 335307

6 years agotop(1): use more modern signal code
Eitan Adler [Mon, 18 Jun 2018 02:06:16 +0000 (02:06 +0000)]
top(1): use more modern signal code

Rather than manually build signal masks use functions designed for that
reason. Also use sigprocmask instead of sigblock.

6 years agoRevert r335263, since it can cause crashes in unusual circumstances.
Rick Macklem [Sun, 17 Jun 2018 23:08:54 +0000 (23:08 +0000)]
Revert r335263, since it can cause crashes in unusual circumstances.
This needs to be fixed in a different way.

6 years agobsdconfig: Fix a bug when editing users
Devin Teske [Sun, 17 Jun 2018 22:09:43 +0000 (22:09 +0000)]
bsdconfig: Fix a bug when editing users

The usermgmt API was stomping on a global ($user_gid to be specific)
so things would appear to work fine until you tried to make a second
pass into the API with the now-tainted variable contents.

Fixed by localizing menu-specific contents as to not leak outside API.

PR: bin/208774
Reported by: Martin Waschbuesch <martin@waschbuesch.de>
MFC after: 1 week
X-MFC-to: stable/11, stable/10
Sponsored by: Smule, Inc.

6 years agoaudit(4): add tests for Sys V shared memory syscalls
Alan Somers [Sun, 17 Jun 2018 21:29:35 +0000 (21:29 +0000)]
audit(4): add tests for Sys V shared memory syscalls

includes shmget, shmat, shmdt, and shmctl

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

6 years agobsdconfig: Make examples optional
Devin Teske [Sun, 17 Jun 2018 21:09:21 +0000 (21:09 +0000)]
bsdconfig: Make examples optional

PR: bin/228485
Submitted by: Dmitry Wagin <dmitry.wagin@ya.ru>
Reported by: Dmitry Wagin <dmitry.wagin@ya.ru>
MFC after: 1 week
Sponsored by: Smule, Inc.

6 years agoUpdate VirtIO definitions from Linux virtio_config.h and virtio_ring.h headers
Bryan Venteicher [Sun, 17 Jun 2018 20:45:48 +0000 (20:45 +0000)]
Update VirtIO definitions from Linux virtio_config.h and virtio_ring.h headers

6 years agoacpi: Add support for Thinkpads Mic led
Eitan Adler [Sun, 17 Jun 2018 20:44:20 +0000 (20:44 +0000)]
acpi: Add support for Thinkpads Mic led

PR: 229074
Submitted by: "Ali Abdallah" <aliovx@gmail.com>

6 years agoAssorted fixes to MSI-X/MSI/INTx setup in iflib(9):
Marius Strobl [Sun, 17 Jun 2018 20:33:02 +0000 (20:33 +0000)]
Assorted fixes to MSI-X/MSI/INTx setup in iflib(9):
- In iflib_msix_init(), VMMs with broken MSI-X activation are trying
  to be worked around by manually enabling PCIM_MSIXCTRL_MSIX_ENABLE
  before calling pci_alloc_msix(9). Apart from constituting a layering
  violation, this has the problem of leaving PCIM_MSIXCTRL_MSIX_ENABLE
  enabled when falling back to MSI or INTx when e. g. MSI-X is black-
  listed and initially also when disabled via hw.pci.enable_msix. The
  later in turn was incorrectly worked around in r325166.
  Since r310806, pci(4) itself has code to deal with broken MSI-X
  handling of VMMs, so all of these workarounds in iflib(9) can go,
  fixing non-working interrupts when falling back to MSI/INTx. In
  any case, possibly further adjustments to broken MSI-X activation
  of VMMs like enabling r310806 by default in VM environments need to
  be placed into pci(4), not iflib(9). [1]
- Also remove the pci_enable_busmaster(9) call from iflib_msix_init(),
  which is already more properly invoked from iflib_device_attach().
- When falling back to MSI/INTx, release the MSI-X BAR resource again.
- When falling back to INTx, ensure scctx->isc_vectors is set to 1 and
  not to something higher from a device with more than one MSI message
  supported.
- Make the nearby ring_state(s) stuff (static) const.

Discussed with: jhb at BSDCan 2018 [1]
Reviewed by: imp, jhb
Differential Revision: https://reviews.freebsd.org/D15729

6 years agosysrc.subr: Fix a comment for accuracy
Devin Teske [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.

6 years agogpart: add EFI alias for MBR partition scheme
Ed Maste [Sun, 17 Jun 2018 20:10:48 +0000 (20:10 +0000)]
gpart: add EFI alias for MBR partition scheme

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D15870

6 years agoSort geom/part mbr/ebr/ldm alias table entries
Ed Maste [Sun, 17 Jun 2018 20:06:27 +0000 (20:06 +0000)]
Sort geom/part mbr/ebr/ldm alias table entries

Having the table entries in alpha order simplifies future additions.

Sponsored by: The FreeBSD Foundation

6 years agoREADME: add generic notes about GENERIC and NOTES
Eitan Adler [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.

Requested by: jhb

6 years agostand/common/disk.c: Update debug printf
Allan Jude [Sun, 17 Jun 2018 19:31:35 +0000 (19:31 +0000)]
stand/common/disk.c: Update debug printf

This was missed in r330809 because it is compiled out by default

Sponsored by: Klara Systems

6 years agoFix build of ndis with base gcc on i386
Dimitry Andric [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

6 years agoFix build of aibs with base gcc on i386
Dimitry Andric [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

6 years agoliby: rewrite yyerror.h
Eitan Adler [Sun, 17 Jun 2018 18:05:27 +0000 (18:05 +0000)]
liby: rewrite yyerror.h

In order to prevent confusion about copyright, rewrite from scratch
yyerror.h. See discussion on r335270 for details.

6 years agoaudit(4): add tests for connect, connectat, and accept
Alan Somers [Sun, 17 Jun 2018 17:43:55 +0000 (17:43 +0000)]
audit(4): add tests for connect, connectat, and accept

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

6 years agopraudit(1): add tests
Alan Somers [Sun, 17 Jun 2018 17:31:16 +0000 (17:31 +0000)]
praudit(1): add tests

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

6 years agopraudit(1): return 0 on success
Alan Somers [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

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

6 years agoaudit(4): Add tests for a few syscalls in the ad class
Alan Somers [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

6 years agoaudit(4): add tests for extattr_get_file(2) and friends
Alan Somers [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

6 years agoBuild LOCAL_LIB_DIRS along with system lib dirs, rather than building them
Ian Lepore [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.

6 years agoFix false positive on failure
Slava Shwartsman [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

6 years agosysrc.subr: Fix display when value is "-n"
Devin Teske [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.

6 years agosysrc.subr: Fix handling of files with missing newline at EOF
Devin Teske [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.

6 years agorootgen.sh: complete all profiles except GELI+MBR (not supported)
Allan Jude [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

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

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

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

6 years agoaudit(4): add tests for chflags and friends
Alan Somers [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

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

6 years agogvinum: revert WARNS change in Makefile
Eitan Adler [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.

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

6 years agoddb: unbreak ppc
Eitan Adler [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

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

Tested with amd64, arm64, i386, mips

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

Tested with amd64, i386

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

WARNS++

Tested with amd64, arm64, i386, mips

6 years agogvinum: build with WARNS=6
Eitan Adler [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

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

Tested with amd64, arm64, i386, mips

6 years agounits: fix some nits
Eitan Adler [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

6 years agoFix comparison between pointer and char literal
Devin Teske [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

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

6 years agoFix typo.
Andrey V. Elsukov [Sat, 16 Jun 2018 19:21:09 +0000 (19:21 +0000)]
Fix typo.

Reported by: rpokala

6 years agoaudit(4): add tests for pathconf(2) and friends
Alan Somers [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

6 years agoaudit(4): add tests for POSIX message queues
Alan Somers [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