Commit Graph

248253 Commits

Author SHA1 Message Date
Mateusz Piotrowski
676ff51e8a 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
2020-02-09 15:13:56 +00:00
Konstantin Belousov
24d57fa83e 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
2020-02-09 12:30:50 +00:00
Konstantin Belousov
48fcb46311 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
2020-02-09 12:29:51 +00:00
Konstantin Belousov
fc908e5001 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
2020-02-09 12:27:22 +00:00
Konstantin Belousov
aef199e563 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
2020-02-09 12:22:43 +00:00
Konstantin Belousov
a1fd89b45f 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
2020-02-09 12:12:03 +00:00
Konstantin Belousov
944cf37bb5 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
2020-02-09 12:10:37 +00:00
Konstantin Belousov
f88c67a625 Regen. 2020-02-09 11:53:37 +00:00
Konstantin Belousov
146fc63fce 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
2020-02-09 11:53:12 +00:00
Kyle Evans
850e0825a2 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.
2020-02-09 04:05:30 +00:00
Kyle Evans
469c887f36 NetBSD: tests: Import NFS O_SEARCH test fix 2020-02-09 04:01:46 +00:00
Ruslan Bukin
d987842d1e Enter the network epoch in the xdma interrupt handler if required
by a peripheral device driver.

Sponsored by:	DARPA, AFRL
2020-02-08 23:07:29 +00:00
Alexander Motin
12373e9519 Bind CTL backends taskqueues to the CTL process.
MFC after:	2 weeks
2020-02-08 21:59:46 +00:00
Eitan Adler
66a23ebe19 memset.3: better fix previous typo
Upon re-reading the whole sentence this is a better fix.

MFC with: r357681
2020-02-08 21:17:48 +00:00
Ruslan Bukin
a00eed9676 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
2020-02-08 21:02:20 +00:00
Eitan Adler
3f8bd4b7bf memset.3: fix a a duplicate word 2020-02-08 20:56:38 +00:00
Mateusz Guzik
2f7f11b7de 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
2020-02-08 15:52:20 +00:00
Mateusz Guzik
3eb6b656c2 vfs: remove now useless ENODEV handling from vn_fullpath consumers
Noted by:	ngie
2020-02-08 15:51:08 +00:00
Konstantin Belousov
300b525d29 Correct the function name in the comment.
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2020-02-08 15:06:06 +00:00
Andrew Turner
eb43a03acb 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
2020-02-08 13:35:56 +00:00
Marcin Wojtas
73f20bb3a9 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
2020-02-08 13:33:47 +00:00
Marcin Wojtas
3599e81c97 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
2020-02-08 13:25:39 +00:00
Mateusz Guzik
8f2b73dc86 vfs: use newly added zpcpu routines instead of direct access where appropriate 2020-02-07 22:45:09 +00:00
Mateusz Guzik
ea77ce6ef9 rms: use newly added zpcpu routines instead of direct access where appropriate 2020-02-07 22:44:41 +00:00
Mateusz Guzik
c77649d8e7 Add zpcpu_{set,add,sub}_protected.
The _protected suffix follows counter(9).
2020-02-07 22:43:58 +00:00
Kyle Evans
14d3b06919 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
2020-02-07 22:36:37 +00:00
Konstantin Belousov
53071ed1c9 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
2020-02-07 22:28:04 +00:00
Konstantin Belousov
fc9134243d acpi_hpet: Add Hygon Dhyana support.
Submitted by:	Pu Wen <puwen@hygon.cn>
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D23555
2020-02-07 22:26:11 +00:00
Konstantin Belousov
8e3d7caee5 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
2020-02-07 22:21:44 +00:00
Kyle Evans
c81929d343 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
2020-02-07 21:36:14 +00:00
Ed Maste
5aa0576b33 Miscellaneous typo fixes
Submitted by:	Gordon Bergling <gbergling_gmail.com>
Differential Revision:	https://reviews.freebsd.org/D23453
2020-02-07 19:53:07 +00:00
Vincenzo Maffione
723180da59 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
2020-02-07 19:26:26 +00:00
Dimitry Andric
bc02c18c48 Merge ^/head r357408 through r357661. 2020-02-07 19:08:37 +00:00
Dimitry Andric
d54b0ffe9d Correctly recognize linker versions greater than 10.0.
MFC after:	3 days
2020-02-07 19:04:27 +00:00
Warner Losh
9133f3d097 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@
2020-02-07 17:47:08 +00:00
Mateusz Guzik
e2b81f518a amd64: clean up counter(9)
- stop open-coding access to per-cpu data, use common macros instead
- consistently use counter_t type where appropriate
2020-02-07 16:22:02 +00:00
Alexander Motin
8d8e484d9c 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
2020-02-07 15:50:47 +00:00
Pedro F. Giffuni
a1b769b32d typo: stray spaces.
No functional change
2020-02-07 15:16:04 +00:00
Pedro F. Giffuni
2512630061 typo: s/impelmentation/implementation/.
No functional change
2020-02-07 15:14:29 +00:00
Ruslan Bukin
a8692c16c9 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
2020-02-07 14:36:28 +00:00
Baptiste Daroussin
79208b1025 Fix most of the style warnings 2020-02-07 12:26:38 +00:00
Scott Long
69e85eb8ae 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
2020-02-07 12:15:39 +00:00
Scott Long
b041593ae7 Touch up some of the iocfacts fields 2020-02-07 11:48:26 +00:00
Baptiste Daroussin
89fd163c4e Update diff(1) TODO removing what has been implemented 2020-02-07 10:18:01 +00:00
Baptiste Daroussin
64793e748c diff: implement -y (--side-by-side) along with -W and --suppress-common-lines
PR:		219933
Submitted by:	fehmi noyan isi <fnoyanisi@yahoo.com>
MFC after:	3 weeks
2020-02-07 10:17:13 +00:00
Scott Long
d176b8039e Ever since the block layer expanded its command syntax beyond just
BIO_READ and BIO_WRITE, we've handled this expanded syntax poorly in
drivers when the driver doesn't support a particular command.  Do a
sweep and fix that.

Reported by:	imp
2020-02-07 09:22:08 +00:00
Ryan Libby
a2abae8dc9 smr.h: fix build after r357641
r357641 missed committing the change to sys/sys/smr.h.

Reported by:	jkim
Submitted by:	jeff
Reviewed by:	rlibby
Differential Revision:	https://reviews.freebsd.org/D23464
2020-02-07 00:47:58 +00:00
John Baldwin
f5a7e78d32 Tidy the _set_tp function for RISC-V.
- Use a constant for the offset instead of a magic number.
- Use an addi instruction that writes to tp directly instead of a mv
  that writes the result of a compiler-generated addi.

Reviewed by:	mhorne
MFC after:	1 week
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D23521
2020-02-06 21:46:15 +00:00
Mark Johnston
b09e7a4f42 Remove more manual additions of -DSMP.
Since r357598 this should no longer be necessary.
2020-02-06 21:01:19 +00:00
Jeff Roberson
a40068e524 Fix a race in smr_advance() that could result in unnecessary poll calls.
This was relatively harmless but surprising to see in counters.  The
race occurred when rd_seq was read after the goal was updated and we
incorrectly calculated the delta between them.

Reviewed by:	rlibby
Differential Revision:	https://reviews.freebsd.org/D23464
2020-02-06 20:51:46 +00:00