]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoMFV r357783:
Martin Matuska [Wed, 12 Feb 2020 00:16:56 +0000 (00:16 +0000)]
MFV r357783:
Update libarchive to 3.4.2

Relevant vendor changes:
  PR #1289: atomic extraction support (bsdtar -x --safe-writes)
  PR #1308: big endian fix for UTF16 support in LHA reader
  PR #1326: reject RAR5 files that declare invalid header flags
  Issue #987: fix support 7z archive entries with Delta filter
  Issue #1317: fix compression output buffer handling in XAR writer
  Issue #1319: fix uname or gname longer than 32 characters in pax writer
  Issue #1325: fix use after free when archiving hardlinks in ISO9660 or XAR
  Use localtime_r() and gmtime_r() instead of localtime() and gmtime()

X-MFC-With: r356212,r356365,r356416
MFC after: 1 week

4 years agoUpdate vendor/libarchive/dist to git 3288ebb0353beb51dfb09d444dedbe9235ead53d
Martin Matuska [Tue, 11 Feb 2020 23:48:03 +0000 (23:48 +0000)]
Update vendor/libarchive/dist to git 3288ebb0353beb51dfb09d444dedbe9235ead53d

Libarchive 3.4.2

Relevant vendor changes:
  PR #1289: atomic extraction support (bsdtar -x --safe-writes)
  PR #1308: big endian fix for UTF16 support in LHA reader
  PR #1326: reject RAR5 files that declare invalid header flags
  Issue #987: fix support 7z archive entries with Delta filter
  Issue #1317: fix compression output buffer handling in XAR writer
  Issue #1319: fix uname or gname longer than 32 characters in pax writer
  Issue #1325: fix use after free when archiving hardlinks in ISO9660 or XAR
  Use localtime_r() and gmtime_r() instead of localtime() and gmtime()

4 years agoTemporarily skip flakey test case sys.kern.ptrace_test.ptrace__parent_exits_before_child
Li-Wen Hsu [Tue, 11 Feb 2020 23:17:58 +0000 (23:17 +0000)]
Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__parent_exits_before_child

PR: 244056
Sponsored by: The FreeBSD Foundation

4 years agoTemporarily skip failing test case sys.kern/ptrace_test/ptrace__parent_wait_after_attach
Li-Wen Hsu [Tue, 11 Feb 2020 22:48:12 +0000 (22:48 +0000)]
Temporarily skip failing test case sys.kern/ptrace_test/ptrace__parent_wait_after_attach

PR: 244055
Sponsored by: The FreeBSD Foundation

4 years agoTemporarily skip sys.geom.class.multipath.failloop.failloop in CI
Li-Wen Hsu [Tue, 11 Feb 2020 22:21:22 +0000 (22:21 +0000)]
Temporarily skip sys.geom.class.multipath.failloop.failloop in CI

This case uses `dtrace -c` but it has some issues at the moment

PR: 244053
Sponsored by: The FreeBSD Foundation

4 years agoRemove assertion from TASK_INIT() macro, since some users of
Gleb Smirnoff [Tue, 11 Feb 2020 20:59:41 +0000 (20:59 +0000)]
Remove assertion from TASK_INIT() macro, since some users of
sys/taskqueue.h may not have includes that define MPASS. It
was useful during testing of r357771, but can be omitted now.
An invalid value of priority will yield only in potential
priority inversion, not a crash.

This fixes compilation of ports/x11/nvidia-driver.

4 years agoReduce nc timeout in sys.mac.portacl.*
Li-Wen Hsu [Tue, 11 Feb 2020 20:41:51 +0000 (20:41 +0000)]
Reduce nc timeout in sys.mac.portacl.*

It is not necessary to wait that long for localhost.

Sponsored by: The FreeBSD Foundation

4 years agolibmemstat: Catch up with r357776.
Mark Johnston [Tue, 11 Feb 2020 20:15:49 +0000 (20:15 +0000)]
libmemstat: Catch up with r357776.

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

4 years agoReduce lock hold time in keg_drain().
Mark Johnston [Tue, 11 Feb 2020 20:06:33 +0000 (20:06 +0000)]
Reduce lock hold time in keg_drain().

Maintain a count of free slabs in the per-domain keg structure and use
that to clear the free slab list in constant time for most cases.  This
helps minimize lock contention induced by reclamation, in preparation
for proactive trimming of excesses of free memory.

Reviewed by: jeff, rlibby
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D23532

4 years agoRevert https://svnweb.freebsd.org/changeset/base/357761
Michael Tuexen [Tue, 11 Feb 2020 20:02:20 +0000 (20:02 +0000)]
Revert https://svnweb.freebsd.org/changeset/base/357761

This was suggested by cem@

4 years agoFix duplicate target warning.
Alexander Leidinger [Tue, 11 Feb 2020 19:39:59 +0000 (19:39 +0000)]
Fix duplicate target warning.

4 years agoMark lio taskqueue as requiring network epoch.
Gleb Smirnoff [Tue, 11 Feb 2020 19:13:34 +0000 (19:13 +0000)]
Mark lio taskqueue as requiring network epoch.

4 years agoUse NET_TASK_INIT() and NET_GROUPTASK_INIT() for drivers that process
Gleb Smirnoff [Tue, 11 Feb 2020 18:57:07 +0000 (18:57 +0000)]
Use NET_TASK_INIT() and NET_GROUPTASK_INIT() for drivers that process
incoming packets in taskqueue context.

Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D23518

4 years agoAdd flag to struct task to mark the task as requiring network epoch.
Gleb Smirnoff [Tue, 11 Feb 2020 18:48:07 +0000 (18:48 +0000)]
Add flag to struct task to mark the task as requiring network epoch.

When processing a taskqueue and a task has associated epoch, then
enter for duration of the task.  If consecutive tasks belong to the
same epoch, batch them.  Now we are talking about the network epoch
only.

Shrink the ta_priority size to 8-bits.  No current consumers use
a priority that won't fit into 8 bits.  Also complexity of
taskqueue_enqueue() is a square of maximum value of priority, so
we unlikely ever want to go over UCHAR_MAX here.

Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D23518

4 years agovfs: fix vhold race in mnt_vnode_next_lazy_relock
Mateusz Guzik [Tue, 11 Feb 2020 18:19:56 +0000 (18:19 +0000)]
vfs: fix vhold race in mnt_vnode_next_lazy_relock

vdrop can set the hold count to 0 and wait for the ->mnt_listmtx held by
mnt_vnode_next_lazy_relock caller. The routine incorrectly asserted the
count has to be > 0.

Reported by: pho
Tested by: pho

4 years agoAdd missing EPOCH(9) wrapper in ipfw(8).
Hans Petter Selasky [Tue, 11 Feb 2020 18:16:29 +0000 (18:16 +0000)]
Add missing EPOCH(9) wrapper in ipfw(8).

Backtrace:
panic()
ip_output()
dyn_tick()
softclock_call_cc()
softclock()
ithread_loop()

Differential Revision: https://reviews.freebsd.org/D23599
Reviewed by: glebius@ and ae@
Found by: mmacy@
Reported by: jmd@
Sponsored by: Mellanox Technologies

4 years agoDon't start an SCTP timer using a net, which has been removed.
Michael Tuexen [Tue, 11 Feb 2020 18:15:57 +0000 (18:15 +0000)]
Don't start an SCTP timer using a net, which has been removed.

Submitted by: Taylor Brandstetter
MFC after: 1 week

4 years agoamd64: remove redundant sa->code assignment from cpu_fetch_syscall_args_fallback
Mateusz Guzik [Tue, 11 Feb 2020 18:15:23 +0000 (18:15 +0000)]
amd64: remove redundant sa->code assignment from cpu_fetch_syscall_args_fallback

It is already set in the only caller.

4 years agocapsicum: restore the cap_rights_contains symbol
Mateusz Guzik [Tue, 11 Feb 2020 18:13:53 +0000 (18:13 +0000)]
capsicum: restore the cap_rights_contains symbol

It is expected to be provided by libc.

PR: 244033
Reported by:  Jan Kokemueller

4 years agoif_media.h: Add 50G KR4 ethernet media type.
Konstantin Belousov [Tue, 11 Feb 2020 18:03:45 +0000 (18:03 +0000)]
if_media.h: Add 50G KR4 ethernet media type.

Submitted by: Adam Peace <adam.e.peace@gmail.com>
Reviewed by: hselasky
Differential revision: https://reviews.freebsd.org/D23620

4 years agoif_media.c: staticize and constify ifmedia description structures used under IFMEDIA_...
Konstantin Belousov [Tue, 11 Feb 2020 17:45:01 +0000 (17:45 +0000)]
if_media.c: staticize and constify ifmedia description structures used under IFMEDIA_DEBUG.

The reason for this change is to make it clear the scope of the in-kernel usage
of IFM_TYPE_DESCRIPTIONS and IFM_SUBTYPE_ETHERNET_DESCRIPTIONS macros.  Also it
is somewhat better C.

Reviewed by: hselasky
Sponsored by: Mellanox Technologies
Differential revision: https://reviews.freebsd.org/D23620

4 years agoif_media.c: use __FBSDID().
Konstantin Belousov [Tue, 11 Feb 2020 17:41:45 +0000 (17:41 +0000)]
if_media.c: use __FBSDID().

Reviewed by: hselasky
Sponsored by: Mellanox Technologies
Differential revision: https://reviews.freebsd.org/D23620

4 years agoAdd PCI Express driver for the ARM Neoverse N1 System Development
Ruslan Bukin [Tue, 11 Feb 2020 15:12:09 +0000 (15:12 +0000)]
Add PCI Express driver for the ARM Neoverse N1 System Development
Platform (N1SDP).

Neoverse N1 is a high-performance ARM microarchitecture designed
by the ARM Holdings for the server market.

The PCI part on N1SDP was shipped untested and suffers from some
integration issues.

For instance accessing to not existing BDFs causes System Error
(SError) exception. To mitigate this, the firmware scans the bus,
catches SErrors and creates a table with valid BDFs. That allows
us to filter-out accesses to invalid BDFs in this driver.

Also the root complex config space (BDF == 0) has an unusual
location in memory map, so remapping accesses to it is required.

Finally, the config space is restricted to 32-bit accesses only.

This was tested on the ARM boxes kindly provided by the ARM Ltd
to the DARPA CHERI Project.

In collaboration with: andrew
Reviewed by: andrew
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D23349

4 years agoUse an int instead of a bool variable, since bool is not supported
Michael Tuexen [Tue, 11 Feb 2020 14:00:27 +0000 (14:00 +0000)]
Use an int instead of a bool variable, since bool is not supported
on all platforms the stack is running on in userland.

4 years agoMFV r357712: file 5.38.
Xin LI [Tue, 11 Feb 2020 07:02:48 +0000 (07:02 +0000)]
MFV r357712: file 5.38.

MFC after: 2 weeks

4 years agobackup-passwd: mask out all passwords in the diff
Kyle Evans [Tue, 11 Feb 2020 06:12:02 +0000 (06:12 +0000)]
backup-passwd: mask out all passwords in the diff

The previous expression borked if a username had a plus or hyphen in it.
This is needlessly restrictive- at leSt a hyphen in the middle is valid.
Instead of playing this game, let's just assume the username can't contain a
colon and mask out the second field.

Submitted by: sigsys gmail com
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D23548

4 years agoMount /dev while deinstalling pkg inside EC2 AMIs.
Colin Percival [Tue, 11 Feb 2020 04:05:45 +0000 (04:05 +0000)]
Mount /dev while deinstalling pkg inside EC2 AMIs.

This gets rid of (harmless) warnings:
"pkg: Cannot open /dev/null:No such file or directory".

MFC after: 2 weeks

4 years agoRemove /qemu from EC2 ARM AMIs
Colin Percival [Tue, 11 Feb 2020 04:03:22 +0000 (04:03 +0000)]
Remove /qemu from EC2 ARM AMIs

I forgot to do this as part of r345858 -- I added it to the
vm_extra_pre_umount in vmimage.subr but forgot that function
was overridden in the EC2 build.

MFC after: 2 weeks

4 years agovfs: fix device count leak on vrele racing with vgone
Mateusz Guzik [Mon, 10 Feb 2020 22:28:54 +0000 (22:28 +0000)]
vfs: fix device count leak on vrele racing with vgone

The race is:

CPU1                                CPU2
                                    devfs_reclaim_vchr
make v_usecount 0
                                      VI_LOCK
                                      sees v_usecount == 0, no updates
                                      vp->v_rdev = NULL;
                                      ...
                                      VI_UNLOCK
VI_LOCK
v_decr_devcount
  sees v_rdev == NULL, no updates

In this scenario si_devcount decrement is not performed.

Note this can only happen if the vnode lock is not held.

Reviewed by: kib
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D23529

4 years agoRestore the behavior of allowing empty string in a string sysctl
Li-Wen Hsu [Mon, 10 Feb 2020 20:53:59 +0000 (20:53 +0000)]
Restore the behavior of allowing empty string in a string sysctl

Added as a special case to avoid unnecessary memory operations.

Reviewed by: delphij
Sponsored by: The FreeBSD Foundation

4 years agoFix for unbalanced EPOCH(9) usage in the generic kernel interrupt
Hans Petter Selasky [Mon, 10 Feb 2020 20:23:08 +0000 (20:23 +0000)]
Fix for unbalanced EPOCH(9) usage in the generic kernel interrupt
handler.

Interrupt handlers are removed via intr_event_execute_handlers() when
IH_DEAD is set. The thread removing the interrupt is woken up, and
calls intr_event_update(). When this happens, the ie_hflags are
cleared and re-built from all the remaining handlers sharing the
event. When the last IH_NET handler is removed, the IH_NET flag will
be cleared from ih_hflags (or ie_hflags may still be being rebuilt in
a different context), and the ithread_execute_handlers() may return
with ie_hflags missing IH_NET. This can lead to a scenario where
IH_NET was present before calling ithread_execute_handlers, and is not
present at its return, meaning the need for epoch must be cached
locally.

This can happen when loading and unloading network drivers. Also make
sure the ie_hflags is not cleared before being updated.

This is a regression issue after r357004.

Backtrace:
panic()
# trying to access epoch tracker on stack of dead thread
_epoch_enter_preempt()
ifunit_ref()
ifioctl()
fo_ioctl()
kern_ioctl()
sys_ioctl()
syscallenter()
amd64_syscall()

Differential Revision: https://reviews.freebsd.org/D23483
Reviewed by: glebius@, gallatin@, mav@, jeff@ and kib@
Sponsored by: Mellanox Technologies

4 years agoUse __riscv instead of __riscv__
Warner Losh [Mon, 10 Feb 2020 18:28:02 +0000 (18:28 +0000)]
Use __riscv instead of __riscv__

I misread arch(7) when I added this...

Noticed by: jhb@ and mhorne@

4 years agoModify the vm.panic_on_oom sysctl to take a count of events.
Jonathan T. Looney [Mon, 10 Feb 2020 18:06:38 +0000 (18:06 +0000)]
Modify the vm.panic_on_oom sysctl to take a count of events.

Currently, the vm.panic_on_oom sysctl is a boolean which controls the
behavior of the VM system when it encounters an out-of-memory situation.
If set to 0, the VM system kills the largest process. If set to any other
value, the VM system will initiate a panic.

This change makes the sysctl a count of events. If set to 0, the VM system
kills the largest process. If set to any other value, the VM system will
kill the largest process until it has seen the specified number of
out-of-memory events. Once it reaches the specified number of events, it
will initiate a panic.

This change is helpful in capturing cores when the system is in a perpetual
cycle of out-of-memory events (as opposed to just hitting one or two
sporadic out-of-memory events).

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D23601

4 years agoRemove ifdefs for ia64 and sparc64.
Warner Losh [Mon, 10 Feb 2020 17:17:08 +0000 (17:17 +0000)]
Remove ifdefs for ia64 and sparc64.

Reivewed by: cy@, bcr@
Differential Revision: https://reviews.freebsd.org/D23593

4 years agoRefresh architecture list with latest:
Warner Losh [Mon, 10 Feb 2020 17:17:03 +0000 (17:17 +0000)]
Refresh architecture list with latest:

Remove: sparc, sparc64 (twice), ia64, alpha
Add: riscv64

Remove now-useless sparc64 ifdef

Reivewed by: cy@, bcr@
Differential Revision: https://reviews.freebsd.org/D23593

4 years agoRemove sparc64 specific eeprom command
Warner Losh [Mon, 10 Feb 2020 17:16:59 +0000 (17:16 +0000)]
Remove sparc64 specific eeprom command

This command was only ever for sparc64, so remove it. Remove
usr.sbin/Makeiile.sparc64 as well since it only references ofwdump
(cross platform) and eeprom.

Reivewed by: cy@, bcr@
Differential Revision: https://reviews.freebsd.org/D23593

4 years agoFor valid arch values (really $MACHINE), remove references to alpha
Warner Losh [Mon, 10 Feb 2020 17:16:54 +0000 (17:16 +0000)]
For valid arch values (really $MACHINE), remove references to alpha
and sparc64. Add references to arm64 and riscv

Reivewed by: cy@, bcr@
Differential Revision: https://reviews.freebsd.org/D23593

4 years agoFix a comment for the SUN geom class.
Warner Losh [Mon, 10 Feb 2020 17:16:50 +0000 (17:16 +0000)]
Fix a comment for the SUN geom class.

Reivewed by: cy@, bcr@
Differential Revision: https://reviews.freebsd.org/D23593

4 years agoFix comment. It mentioned sparc64 specifically, but alignment issues
Warner Losh [Mon, 10 Feb 2020 17:16:45 +0000 (17:16 +0000)]
Fix comment. It mentioned sparc64 specifically, but alignment issues
are present elsewhere.

Reivewed by: cy@, bcr@
Differential Revision: https://reviews.freebsd.org/D23593

4 years agoRemove sparc64 ifdef
Warner Losh [Mon, 10 Feb 2020 17:16:41 +0000 (17:16 +0000)]
Remove sparc64 ifdef

Now we default to setting the hardware clock to UTC
everywhere. sparc64 was the old odd-man out before.

Reivewed by: cy@, bcr@
Differential Revision: https://reviews.freebsd.org/D23593

4 years agoRemove sparc64 example.
Warner Losh [Mon, 10 Feb 2020 17:16:26 +0000 (17:16 +0000)]
Remove sparc64 example.

Reivewed by: cy@, bcr@
Differential Revision: https://reviews.freebsd.org/D23593

4 years agoRevert r357710 and 357711 until they can be debugged
Scott Long [Mon, 10 Feb 2020 14:27:28 +0000 (14:27 +0000)]
Revert r357710 and 357711 until they can be debugged

4 years agovfs: fix lock recursion in vrele
Mateusz Guzik [Mon, 10 Feb 2020 13:54:34 +0000 (13:54 +0000)]
vfs: fix lock recursion in vrele

vrele is supposed to be called with an unlocked vnode, but this was never
asserted for if v_usecount was > 0. For such counts the lock is never touched
by the routine. As a result the kernel has several consumers which expect
vunref semantics and get away with calling vrele since they happen to never do
it when this is the last reference (and for some of them this may happen to be
a guarantee).

Work around the problem by changing vrele semantics to tolerate being called
with a lock. This eliminates a possible bug where the lock is already held and
vputx takes it anyway.

Reviewed by: kib
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D23528

4 years agoTidy up zpcpu_replace*
Mateusz Guzik [Mon, 10 Feb 2020 13:52:25 +0000 (13:52 +0000)]
Tidy up zpcpu_replace*

- only compute the target address once
- remove spurious type casting, zpcpu_get already return the correct type

While here add missing newlines to other routines.

4 years agoMake linux(4) use kern_socketpair(9) instead of going through
Edward Tomasz Napierala [Mon, 10 Feb 2020 13:24:14 +0000 (13:24 +0000)]
Make linux(4) use kern_socketpair(9) instead of going through
sys_socketpair().  It's a cleanup; no functional changes.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D22814

4 years agoAdd USB host controller PCI ID's for Hygon.
Hans Petter Selasky [Mon, 10 Feb 2020 11:09:56 +0000 (11:09 +0000)]
Add USB host controller PCI ID's for Hygon.

Differential Revision: https://reviews.freebsd.org/D23564
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoUse humanize_number to format available and bad space sizes.
Xin LI [Mon, 10 Feb 2020 04:16:41 +0000 (04:16 +0000)]
Use humanize_number to format available and bad space sizes.

Reviewed by: mckusick (earlier version)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D23050

4 years agocron(8): rip out do_univ
Kyle Evans [Mon, 10 Feb 2020 02:44:29 +0000 (02:44 +0000)]
cron(8): rip out do_univ

This was an old Dynix hack, the function is a NOP on FreeBSD. We have no
need to retain this; Dynix was discontinued long ago.

4 years agocron(8): convert vfork() usage to fork()
Kyle Evans [Mon, 10 Feb 2020 02:40:23 +0000 (02:40 +0000)]
cron(8): convert vfork() usage to fork()

vfork() is error-prone, and the usage here definitely grew to not be
clearly OK given vfork-semantics; e.g. setusercontext(3) within the child.

Rip out vfork() and the rest of the references to it. fork is heavier, but
it's unclear that the difference will be all that obvious.

Reported by: Andrew Gierth and sigsys@gmail.com

4 years agoVendor import of file 5.38
Xin LI [Mon, 10 Feb 2020 01:33:52 +0000 (01:33 +0000)]
Vendor import of file 5.38

4 years agoMissed a file in r357710, add it here.
Scott Long [Mon, 10 Feb 2020 00:26:41 +0000 (00:26 +0000)]
Missed a file in r357710, add it here.

4 years agoAdd rudamentary support for UFS to probe whether a block device supports the
Scott Long [Mon, 10 Feb 2020 00:23:20 +0000 (00:23 +0000)]
Add rudamentary support for UFS to probe whether a block device supports the
BIO_SPEEDUP command.  Add complimentary support to the CAM periphs that
support it.

4 years agoImplement atomic_testandclear_{32,int,long} for 32-bit arm. Also, replace
Ian Lepore [Mon, 10 Feb 2020 00:05:04 +0000 (00:05 +0000)]
Implement atomic_testandclear_{32,int,long} for 32-bit arm.  Also, replace
the existing implementation of atomic_testandset with the same new algorithm,
which uses fewer instructions and fewer registers.

4 years agoStop the PMTU and HB timer when removing a net, not when freeing it.
Michael Tuexen [Sun, 9 Feb 2020 22:40:05 +0000 (22:40 +0000)]
Stop the PMTU and HB timer when removing a net, not when freeing it.

Submitted by: Taylor Brandstetter
MFC after: 1 week

4 years agologin.conf(5): update commented-out standard, too
Kyle Evans [Sun, 9 Feb 2020 22:35:49 +0000 (22:35 +0000)]
login.conf(5): update commented-out standard, too

MAIL now has a mail capability, instead, as of r357560.

4 years agoCleanup timer handling.
Michael Tuexen [Sun, 9 Feb 2020 22:05:41 +0000 (22:05 +0000)]
Cleanup timer handling.

Submitted by: Taylor Brandstetter
MFC after: 1 week

4 years agomips: mark GOOGLETEST broken, due to no fault of its own
Kyle Evans [Sun, 9 Feb 2020 18:53:53 +0000 (18:53 +0000)]
mips: mark GOOGLETEST broken, due to no fault of its own

As explained in the comment; GOOGLETEST cannot currently be compiled on any
mips variant at the moment due to the cross toolchain seemingly using the
wrong spec and not pulling in libgcc. We'll be fine when llvm 10 lands, at
which point this should be reverted most expeditiously.

4 years agoAdd a missing word in rc.conf.5
Mateusz Piotrowski [Sun, 9 Feb 2020 15:13:56 +0000 (15:13 +0000)]
Add a missing word in rc.conf.5

PR: 243972
Submitted by: PauAmma <pauamma@gundo.com>
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D23584

4 years agoAdd procstat(1) sigfastblock command to show process sigfastblock word address.
Konstantin Belousov [Sun, 9 Feb 2020 12:30:50 +0000 (12:30 +0000)]
Add procstat(1) sigfastblock command to show process sigfastblock word address.

Tested by: pho
Disscussed with: cem, emaste, jilles
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D12773

4 years agoAdd sysctl kern.proc.sigfastblk for reporting sigfastblock word address.
Konstantin Belousov [Sun, 9 Feb 2020 12:29:51 +0000 (12:29 +0000)]
Add sysctl kern.proc.sigfastblk for reporting sigfastblock word address.

Tested by: pho
Disscussed with: cem, emaste, jilles
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D12773

4 years agoUse sigfastblock(2) for masking signals in libthr.
Konstantin Belousov [Sun, 9 Feb 2020 12:27:22 +0000 (12:27 +0000)]
Use sigfastblock(2) for masking signals in libthr.

Ensure proper handshake to transfer sigfastblock(2) blocking word
ownership from rtld to libthr.

Unfortunately sigfastblock(2) is not enough to stop intercepting
signals in libthr, because critical sections must ensure more than
just signal blocking.

Tested by: pho
Disscussed with: cem, emaste, jilles
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D12773

4 years agoUse sigfastblock(2) in rtld.
Konstantin Belousov [Sun, 9 Feb 2020 12:22:43 +0000 (12:22 +0000)]
Use sigfastblock(2) in rtld.

This allows for rtld to not issue two sigprocmask(2) syscalls for each
symbol binding operation in single-threaded processes.  Rtld needs to
block signals as part of locking to ensure signal safety of the bind
process, because signal handlers might need to lazily resolve symbol
references.

As result, number of syscalls issued on startup by simple programs not
using libthr, is typically reduced 2x.  For instance, for hello world,
I see:
non-sigfastblock
# (truss ./hello > /dev/null) |& wc -l
      63
sigfastblock
# (truss ./hello > /dev/null) |& wc -l
      37

Tested by: pho
Disscussed with: cem, emaste, jilles
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D12773

4 years agoAdd AT_BSDFLAGS support to _elf_aux_info(3).
Konstantin Belousov [Sun, 9 Feb 2020 12:12:03 +0000 (12:12 +0000)]
Add AT_BSDFLAGS support to _elf_aux_info(3).

Tested by: pho
Disscussed with: cem, emaste, jilles
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D12773

4 years agoAdd AT_BSDFLAGS auxv entry.
Konstantin Belousov [Sun, 9 Feb 2020 12:10:37 +0000 (12:10 +0000)]
Add AT_BSDFLAGS auxv entry.

The intent is to provide bsd-specific flags relevant to interpreter
and C runtime.  I did not want to reuse AT_FLAGS which is common ELF
auxv entry.

Use bsdflags to report kernel support for sigfastblock(2).  This
allows rtld and libthr to safely infer the syscall presence without
SIGSYS.  The tunable kern.elf{32,64}.sigfastblock blocks reporting.

Tested by: pho
Disscussed with: cem, emaste, jilles
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D12773

4 years agoRegen.
Konstantin Belousov [Sun, 9 Feb 2020 11:53:37 +0000 (11:53 +0000)]
Regen.

4 years agoAdd a way to manage thread signal mask using shared word, instead of syscall.
Konstantin Belousov [Sun, 9 Feb 2020 11:53:12 +0000 (11:53 +0000)]
Add a way to manage thread signal mask using shared word, instead of syscall.

A new syscall sigfastblock(2) is added which registers a uint32_t
variable as containing the count of blocks for signal delivery.  Its
content is read by kernel on each syscall entry and on AST processing,
non-zero count of blocks is interpreted same as the signal mask
blocking all signals.

The biggest downside of the feature that I see is that memory
corruption that affects the registered fast sigblock location, would
cause quite strange application misbehavior. For instance, the process
would be immune to ^C (but killable by SIGKILL).

With consumers (rtld and libthr added), benchmarks do not show a
slow-down of the syscalls in micro-measurements, and macro benchmarks
like buildworld do not demonstrate a difference. Part of the reason is
that buildworld time is dominated by compiler, and clang already links
to libthr. On the other hand, small utilities typically used by shell
scripts have the total number of syscalls cut by half.

The syscall is not exported from the stable libc version namespace on
purpose.  It is intended to be used only by our C runtime
implementation internals.

Tested by: pho
Disscussed with: cem, emaste, jilles
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D12773

4 years agoMFV r357687: Import NFS fix for O_SEARCH tests
Kyle Evans [Sun, 9 Feb 2020 04:05:30 +0000 (04:05 +0000)]
MFV r357687: Import NFS fix for O_SEARCH tests

The version that ended upstream was ultimately slightly different than the
version committed here; notably, statvfs() is used but it's redefined
appropriately to statfs() on FreeBSD since we don't provide the fstypename
for the former interface.

4 years agoNetBSD: tests: Import NFS O_SEARCH test fix
Kyle Evans [Sun, 9 Feb 2020 04:01:46 +0000 (04:01 +0000)]
NetBSD: tests: Import NFS O_SEARCH test fix

4 years agoEnter the network epoch in the xdma interrupt handler if required
Ruslan Bukin [Sat, 8 Feb 2020 23:07:29 +0000 (23:07 +0000)]
Enter the network epoch in the xdma interrupt handler if required
by a peripheral device driver.

Sponsored by: DARPA, AFRL

4 years agoBind CTL backends taskqueues to the CTL process.
Alexander Motin [Sat, 8 Feb 2020 21:59:46 +0000 (21:59 +0000)]
Bind CTL backends taskqueues to the CTL process.

MFC after: 2 weeks

4 years agomemset.3: better fix previous typo
Eitan Adler [Sat, 8 Feb 2020 21:17:48 +0000 (21:17 +0000)]
memset.3: better fix previous typo

Upon re-reading the whole sentence this is a better fix.

MFC with: r357681

4 years agoFix a KASSERT since chained mbufs are accepted by the xdma bounce
Ruslan Bukin [Sat, 8 Feb 2020 21:02:20 +0000 (21:02 +0000)]
Fix a KASSERT since chained mbufs are accepted by the xdma bounce
buffer loader. m_copydata() will copy entire chain to a single buffer.

Sponsored by: DARPA, AFRL

4 years agomemset.3: fix a a duplicate word
Eitan Adler [Sat, 8 Feb 2020 20:56:38 +0000 (20:56 +0000)]
memset.3: fix a a duplicate word

4 years agovfs: tidy up vget_finish and vn_lock
Mateusz Guzik [Sat, 8 Feb 2020 15:52:20 +0000 (15:52 +0000)]
vfs: tidy up vget_finish and vn_lock

- remove assertion which duplicates vn_lock
- use VNPASS instead of retyping the failure
- report what flags were passed if panicking on them

4 years agovfs: remove now useless ENODEV handling from vn_fullpath consumers
Mateusz Guzik [Sat, 8 Feb 2020 15:51:08 +0000 (15:51 +0000)]
vfs: remove now useless ENODEV handling from vn_fullpath consumers

Noted by: ngie

4 years agoCorrect the function name in the comment.
Konstantin Belousov [Sat, 8 Feb 2020 15:06:06 +0000 (15:06 +0000)]
Correct the function name in the comment.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

4 years agoImplement the Linux/arm64 VDSO gettimeofday and clock_gettime
Andrew Turner [Sat, 8 Feb 2020 13:35:56 +0000 (13:35 +0000)]
Implement the Linux/arm64 VDSO gettimeofday and clock_gettime

These are used by Centos 7 and will be needed for the
emulators/linux_base-c7 port.

Sponsored by: DARPA, AFRL

4 years agoImplement jumbo frame support in mvneta driver
Marcin Wojtas [Sat, 8 Feb 2020 13:33:47 +0000 (13:33 +0000)]
Implement jumbo frame support in mvneta driver

This patch introduces processing of the frames
up to 9kB by the mvneta driver. Some versions of
this NIC limit TX checksum offloading, depending
on the frame size, so add appropriate handling
of this feature.

Submitted by: Kornel Duleba
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D23225

4 years agoDestroy RX DMA tag on detach in mvneta driver
Marcin Wojtas [Sat, 8 Feb 2020 13:25:39 +0000 (13:25 +0000)]
Destroy RX DMA tag on detach in mvneta driver

This patch fixes deinitialization sequence of the mvneta
driver by adding missing bus_dma_tag_destroy call.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Obtained from: Semihalf
MFC after: 1 week
Sponsored by: Stormshield

4 years agovfs: use newly added zpcpu routines instead of direct access where appropriate
Mateusz Guzik [Fri, 7 Feb 2020 22:45:09 +0000 (22:45 +0000)]
vfs: use newly added zpcpu routines instead of direct access where appropriate

4 years agorms: use newly added zpcpu routines instead of direct access where appropriate
Mateusz Guzik [Fri, 7 Feb 2020 22:44:41 +0000 (22:44 +0000)]
rms: use newly added zpcpu routines instead of direct access where appropriate

4 years agoAdd zpcpu_{set,add,sub}_protected.
Mateusz Guzik [Fri, 7 Feb 2020 22:43:58 +0000 (22:43 +0000)]
Add zpcpu_{set,add,sub}_protected.

The _protected suffix follows counter(9).

4 years agoO_SEARCH test: mark revokex an expected fail on NFS
Kyle Evans [Fri, 7 Feb 2020 22:36:37 +0000 (22:36 +0000)]
O_SEARCH test: mark revokex an expected fail on NFS

The revokex test does not work when the scratch directory is created on NFS.
Given the nature of NFS, it likely can never work without looking like a
security hole since O_SEARCH would rely on the server knowing that the
directory did have +x at the time of open and that it's OK for it to have
been revoked based on POSIX specification for O_SEARCH.

This does mean that O_SEARCH is only partially functional on NFS in general,
but I suspect the execute bit getting revoked in the process is likely not
common.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D23573

4 years agopmc: Add Hygon Dhyana support.
Konstantin Belousov [Fri, 7 Feb 2020 22:28:04 +0000 (22:28 +0000)]
pmc: Add Hygon Dhyana support.

To make the PMC tool pmcstat working properly on Hygon platform, add
support for Hygon Dhyana family 18h by using the PMC initialization
code path of AMD family 17h.

Submitted by: Pu Wen <puwen@hygon.cn>
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D23562

4 years agoacpi_hpet: Add Hygon Dhyana support.
Konstantin Belousov [Fri, 7 Feb 2020 22:26:11 +0000 (22:26 +0000)]
acpi_hpet: Add Hygon Dhyana support.

Submitted by: Pu Wen <puwen@hygon.cn>
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D23555

4 years agolinux futex_put(): do not touch futex after dropping our reference.
Konstantin Belousov [Fri, 7 Feb 2020 22:21:44 +0000 (22:21 +0000)]
linux futex_put(): do not touch futex after dropping our reference.

Reported and tested by: Steve Roome <me@stephenroome.com>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

4 years agogeli taste: allow GELIBOOT tagged providers as well
Kyle Evans [Fri, 7 Feb 2020 21:36:14 +0000 (21:36 +0000)]
geli taste: allow GELIBOOT tagged providers as well

Currently the installer will tag geliboot partitions with both BOOT and
GELIBOOT; the former allows the kernel to taste it at boot, while the latter
is what loaders keys off of.

However, it seems reasonable to assume that if a provider's been tagged with
GELIBOOT that the kernel should also take that as a hint to taste/attach at
boot. This would allow us to stop tagging GELIBOOT partitions with BOOT in
bsdinstall, but I'm not sure that there's a compelling reason to do so any
time soon.

Reviewed by: oshogbo
Differential Revision: https://reviews.freebsd.org/D23387

4 years agoMiscellaneous typo fixes
Ed Maste [Fri, 7 Feb 2020 19:53:07 +0000 (19:53 +0000)]
Miscellaneous typo fixes

Submitted by: Gordon Bergling <gbergling_gmail.com>
Differential Revision: https://reviews.freebsd.org/D23453

4 years agonetmap: improve netmap(4) and vale(4) man pages
Vincenzo Maffione [Fri, 7 Feb 2020 19:26:26 +0000 (19:26 +0000)]
netmap: improve netmap(4) and vale(4) man pages

Clean up obsolete sysctl descriptions and add missing ones.

PR: 243838
Reviewed by: bcr
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23546

4 years agoCorrectly recognize linker versions greater than 10.0.
Dimitry Andric [Fri, 7 Feb 2020 19:04:27 +0000 (19:04 +0000)]
Correctly recognize linker versions greater than 10.0.

MFC after: 3 days

4 years agoSupress not supported message
Warner Losh [Fri, 7 Feb 2020 17:47:08 +0000 (17:47 +0000)]
Supress not supported message

For the moment, supress the operation not supported messages at this level.  In
the fullness of time, we will have better error tracking so we can diagnose
issues in the future.

Reviewed by: scottl@

4 years agoamd64: clean up counter(9)
Mateusz Guzik [Fri, 7 Feb 2020 16:22:02 +0000 (16:22 +0000)]
amd64: clean up counter(9)

- stop open-coding access to per-cpu data, use common macros instead
- consistently use counter_t type where appropriate

4 years agoRemove duplicate dbufs accounting.
Alexander Motin [Fri, 7 Feb 2020 15:50:47 +0000 (15:50 +0000)]
Remove duplicate dbufs accounting.

Since AVL already has embedded element counter, use dn_dbufs_count
only for dbufs not counted there (bonus buffers) and just add them.
This removes two atomics per dbuf life cycle.

According to profiler it reduces time spent by dbuf_destroy() inside
bottlenecked dbuf_evict_thread() from 13.36% to 9.20% of the core.

This counter is used only on illumos, so for FreeBSD it was just a
waste of time.

MFC after: 2 weeks

4 years agotypo: stray spaces.
Pedro F. Giffuni [Fri, 7 Feb 2020 15:16:04 +0000 (15:16 +0000)]
typo: stray spaces.

No functional change

4 years agotypo: s/impelmentation/implementation/.
Pedro F. Giffuni [Fri, 7 Feb 2020 15:14:29 +0000 (15:14 +0000)]
typo: s/impelmentation/implementation/.

No functional change

4 years agoFix xae(4) driver attachement on the Government Furnished Equipment (GFE)
Ruslan Bukin [Fri, 7 Feb 2020 14:36:28 +0000 (14:36 +0000)]
Fix xae(4) driver attachement on the Government Furnished Equipment (GFE)
riscv cores.

GFE cores come with standard DTS file that lacks standard 'dmas ='
property, which means xae(4) could not find a DMA controller to use.

The 'dmas' property could not be added to the DTS file because the
ethernet controller and DMA engine parts in Linux are implemented
in a single driver.

Instead of 'dmas' property the standard Xilinx 'axistream-connected'
property is provided, so fallback to use it instead.

Suggested by: James Clarke <jrtc27@jrtc27.com>
Reviewed by: James Clarke <jrtc27@jrtc27.com>
Sponsored by: DARPA, AFRL

4 years agoFix most of the style warnings
Baptiste Daroussin [Fri, 7 Feb 2020 12:26:38 +0000 (12:26 +0000)]
Fix most of the style warnings

4 years agoAdvertise the MPI Message Version that's contained in the IOCFacts message
Scott Long [Fri, 7 Feb 2020 12:15:39 +0000 (12:15 +0000)]
Advertise the MPI Message Version that's contained in the IOCFacts message
in the sysctl block for the driver.  mpsutil/mprutil needs this so it can
know how big of a buffer to allocate when requesting the IOCFacts from the
controller.  This eliminates the kernel console messages about wrong
allocation sizes.

Reported by: imp

4 years agoTouch up some of the iocfacts fields
Scott Long [Fri, 7 Feb 2020 11:48:26 +0000 (11:48 +0000)]
Touch up some of the iocfacts fields

4 years agoUpdate diff(1) TODO removing what has been implemented
Baptiste Daroussin [Fri, 7 Feb 2020 10:18:01 +0000 (10:18 +0000)]
Update diff(1) TODO removing what has been implemented