Commit Graph

253641 Commits

Author SHA1 Message Date
Vincenzo Maffione
ed188a7ece netmap: pkt-gen: minor corrections to documentation
Submitted by:	Brian Poole <brian90013@gmail.com>
MFC after:	3 days
2020-10-03 09:23:34 +00:00
Emmanuel Vadot
b48668250e pwm_backlight: Fix 32 bits build
Reported by:	jenkins, mjg
2020-10-03 08:31:28 +00:00
Navdeep Parhar
73f6606b47 cxgbe(4): set up the firmware flowc for the tid before send_abort_rpl.
MFC after:	3 days
Sponsored by:	Chelsio Communications
2020-10-02 23:48:57 +00:00
Emmanuel Vadot
90b8c0ea10 Fix LINT: Add backlight to NOTES 2020-10-02 20:52:09 +00:00
Emmanuel Vadot
4a84542103 pwm_backlight: Restrict module to armv7 and aarch64
Both powerpc64 and riscv uses fdt but don't use EXT_RESOURCES.

Reported by:	jenkins
2020-10-02 19:56:54 +00:00
Mark Johnston
2913cc4637 vm_pageout: Avoid rounding down the inactive scan target
With helper page daemon threads, enabled by default in r364786, we
divide the inactive target by the number of threads, rounding down, and
sum the total number of pages freed by the threads.  This sum is
compared with the original target, but by rounding down we might lose
pages, causing the page daemon control loop to conclude that inactive
queue scanning isn't keeping up with demand for free pages.  Typically
this results in excessive swapping.

Fix the problem by accounting for the error in the main pagedaemon
thread's target.  Note that by default the problem will manifest only in
systems with >16 CPUs in a NUMA domain.

Reviewed by:	cem
Discussed with:	dougm
Reported and tested by:	dhw, glebius
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26610
2020-10-02 19:16:06 +00:00
Mark Johnston
06d8bdcbf7 uma: Use the bucket cache for cross-domain allocations
uma_zalloc_domain() allocates from the requested domain instead of
following a first-touch policy (the default for most zones).  Currently
it is only used by malloc_domainset(), and consumers free returned items
with free(9) since r363834.

Previously uma_zalloc_domain() worked by always going to the keg for an
item.  As a result, the use of UMA zone caches was unbalanced: we free
items to the caches, but always allocate from the keg, skipping the
caches.

Make some effort to allocate from the UMA caches when performing a
cross-domain allocation.  This avoids blowing up the caches when
something is performing many transient allocations with
malloc_domainset().

Reported and tested by:	dhw, glebius
Sponsored by:		The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26427
2020-10-02 19:04:29 +00:00
Mark Johnston
5afdf5c1ca uma: Use LIFO for non-SMR bucket caches
When SMR was introduced, zone_put_bucket() was changed to always place
full buckets at the end of the queue.  However, it is generally
preferable to use recently used buckets since their items are more
likely to be resident in cache.  So, for buckets that have no constraint
on item reuse, use a last-in-first-out ordering as we did before.

Reviewed by:	rlibby
Tested by:	dhw, glebius
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26426
2020-10-02 19:04:09 +00:00
Mark Johnston
952c8964ba uma: Remove newlines from panic messages
Sponsored by:	The FreeBSD Foundation
2020-10-02 19:03:42 +00:00
Mark Johnston
c88285c54a Fix the INVARIANTS build for 32-bit platforms
Reported by:	Jenkins
MFC with:	r366368
2020-10-02 18:54:37 +00:00
Mark Johnston
afd95785c0 newlocale(3): Fix a memory leak.
newlocale() optionally takes a "base" locale, from which components not
specified in the mask are inherited.  POSIX says that newlocale() may
modify "base" and return it, or free "base" and return a newly allocated
locale.  We were not doing either, so applications which use newlocale()
to modify an existing base locale end up leaking memory on FreeBSD.

This diff fixes the leak by releasing a reference to the base locale
before returning.  This is less efficient than modifying "base"
directly, but is simpler for an initial bug fix.  Also, update the man
page to clarify behaviour with respect to "base".

PR:		249416
MFC after:	3 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26522
2020-10-02 18:35:55 +00:00
Emmanuel Vadot
1e145e73b8 Bump __FreeBSD_version after latest linuxkpi changes 2020-10-02 18:29:25 +00:00
Emmanuel Vadot
a91b408a36 linuxkpi: Add dmi_* function
dmi function are used to get smbios values.
The DRM subsystem and drivers use it to enabled (or not) quirks.

Reviewed by:	hselasky
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26046
2020-10-02 18:28:00 +00:00
Emmanuel Vadot
2b68c97337 linuxkpi: Add backlight support
Add backlight function to linuxkpi.
Graphics drivers expose the backlight of the panel directly so allow them to use the backlight subsystem so
user can use backlight(8) to configure them.

Reviewed by:	hselasky
Relnotes:	yes
Differential Revision:	The FreeBSD Foundation
2020-10-02 18:26:41 +00:00
Emmanuel Vadot
38d94a4bc7 Add pwm_backlight
Driver for pwm-backlight compatible device.

Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26252
2020-10-02 18:23:27 +00:00
Emmanuel Vadot
9ddaa99d9d Add backlight(8)
This tool is used to configure registered backlights.
It can incr/decr (default to 10%) or accept a percentage value directly.

Reviewed by:	manpages (gbe@)
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26251
2020-10-02 18:21:30 +00:00
Emmanuel Vadot
675aae732d Add backlight subsystem
This is a simple subsystem that allow drivers to register as a backlight.
Each backlight creates a device node under /dev/backlight/backlightX and
an alias based on the name provided.

Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26250
2020-10-02 18:18:01 +00:00
Mark Johnston
f31695cc64 Implement sparse core dumps
Currently we allocate and map zero-filled anonymous pages when dumping
core.  This can result in lots of needless disk I/O and page
allocations.  This change tries to make the core dumper more clever and
represent unbacked ranges of virtual memory by holes in the core dump
file.

Add a new page fault type, VM_FAULT_NOFILL, which causes vm_fault() to
clean up and return an error when it would otherwise map a zero-filled
page.  Then, in the core dumper code, prefault all user pages and handle
errors by simply extending the size of the core file.  This also fixes a
bug related to the fact that vn_io_fault1() does not attempt partial I/O
in the face of errors from vm_fault_quick_hold_pages(): if a truncated
file is mapped into a user process, an attempt to dump beyond the end of
the file results in an error, but this means that valid pages
immediately preceding the end of the file might not have been dumped
either.

The change reduces the core dump size of trivial programs by a factor of
ten simply by excluding unaccessed libc.so pages.

PR:		249067
Reviewed by:	kib
Tested by:	pho
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26590
2020-10-02 17:50:22 +00:00
Mark Johnston
fec41f0751 Simplify the check for non-dumpable VM object types
OBJT_DEFAULT, _SWAP, _VNODE and _PHYS is exactly the set of
non-fictitious object types, so just check for OBJ_FICTITIOUS.  The
check no longer excludes dead objects, but such objects have to be
handled regardless.

No functional change intended.

Reviewed by:	alc, dougm, kib
Tested by:	pho
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26589
2020-10-02 17:49:13 +00:00
Nick O'Brien
3f59a7f97b flash: Add support for SPI flash s25fl512s
Reviewed by:	kp
Approved by:	kp (mentor)
Sponsored by:	Axiado
2020-10-02 17:33:56 +00:00
Alan Somers
d262168916 fusefs tests: quell Coverity "Argument cannot be negative" warnings
Must abort tests early if open(2) fails.

Reported by:	Coverity
Coverity CID:	1432810 and many others
Reviewed by:	kevans
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D26635
2020-10-02 17:06:05 +00:00
Mateusz Piotrowski
180db5ef22 Correct the documented size of kern.msgbufsize
The correct value is 96KB after r226090.

PR:		249971
Submitted by:	johannes@jo-t.de
MFC after:	3 days
2020-10-02 15:37:51 +00:00
Mateusz Guzik
aa34e791fa cache: update the commentary for path parsing 2020-10-02 14:50:03 +00:00
Ed Maste
da6e5efe92 libmd: add dependency workaround for r366344
r366344 fixed and reenabled the assembly optimized skein implementation,
but skein_block objects were not being rebuilt in no-clean builds. This
resulted in failing no-clean builds. SKEIN_USE_ASM controls which
routines come from C vs assembly, and with no explicit dependency
r366344's change to SKEIN_USE_ASM did not cause skein_block.{o,pico}
to be rebuilt.

Add a dependency on this Makefile for the skein_block objects. This
dependency is broader in scope than absolutely required (that is, the
skein_block objects will now be rebuilt on any change to this Makefile).
There are ways this could be addressed, but it is probably not worth the
additional effort or testing time to pursue them.

PR:		248221
Reported by:	kevans, Jeremy Faulkner
Discussed with:	kevans
Sponsored by:	The FreeBSD Foundation
2020-10-02 14:00:52 +00:00
Kristof Provost
75f022774f riscv: handle access faults in user mode
Access faults in user mode are treated like TLB misses, which leads to an
endless loop of faults. It's less serious than the same fault in kernel mode,
because we can just terminate the process, but that's not ideal.

Treat user mode access faults as a bus error.

Suggested by:	jrtc27
Reviewed by:	br, jhb
Sponsored by:	Axiado
Differential Revision:	https://reviews.freebsd.org/D26621
2020-10-02 07:30:11 +00:00
Navdeep Parhar
7676c62aa3 cxgbe(4): validate largest_rx_cluster and safest_rx_cluster.
These tunables can only be set to a valid cluster size (2K, 4K, 9K, or
16K) as documented in the man page.  Anything else could lead to a
panic on interface up.

Reported by:	mav@
MFC after:	1 week
Sponsored by:	Chelsio Communications
2020-10-02 05:59:55 +00:00
Matt Macy
11322826a4 OpenZFS: don't call fpu_kern_thread on i386 2020-10-02 01:25:08 +00:00
Mitchell Horne
6955543a88 tmpfs tests: check for built-in tmpfs module
As of r363471, tmpfs is included in all GENERIC kernel configs. This
results in a warning being emitted for each call to kldload(8):

module_register: cannot register tmpfs from tmpfs.ko; already loaded from kernel

Check for the presence of the module via kldstat first to quiet this
warning.

Reviewed by:	asomers, arichardson
Differential Revision:	https://reviews.freebsd.org/D26632
2020-10-02 00:52:31 +00:00
Matt Macy
c40487d49b OpenZFS: MFV 2.0-rc3-gfc5966
- Annotate FreeBSD sysctls with CTLFLAG_MPSAFE
- Reduce stack usage of Lua
- Don't save user FPU context in kernel threads
- Add support for procfs_list
- Code cleanup in zio_crypt
- Add DB_RF_NOPREFETCH to dbuf_read()s in dnode.c
- Drop references when skipping dmu_send due to EXDEV
- Eliminate gratuitous bzeroing in dbuf_stats_hash_table_data
- Fix legacy compat for platform IOCs
2020-10-01 23:28:21 +00:00
Matt Macy
e2228bd990 Update OpenZFS to 2.0.0-rc3-gfc5966 2020-10-01 23:09:24 +00:00
Mark Johnston
494955366a Remove svn:executable from a couple of vmm(4) source files.
MFC after:	3 days
2020-10-01 22:20:29 +00:00
Eric van Gyzen
01348ccda2 fix setitimer test for returned it_value
An old it_value of {4,3} is valid. Allow it.

Reviewed by:	bdrewery
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D26445
2020-10-01 21:52:57 +00:00
Eric van Gyzen
63c8336d4d zgrep: fix exit status with multiple files
zgrep should exit with success when given multiple files and the
pattern is found in at least one file.  Prior to this change,
it would exit with success only if the pattern was found in _every_ file.

Reviewed by:	dab ngie
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D26616
2020-10-01 21:48:22 +00:00
Ed Maste
36972ee3e0 libmd: fix assembly optimized skein implementation
The assembly implementation incorrectly used logical AND instead of
bitwise AND. Fix, and re-enable in libmd.

Submitted by:	Yang Zhong <yzhong@freebsdfoundation.org>
Reviewed by:	cem (earlier)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26614
2020-10-01 21:05:50 +00:00
Bryan Drewery
9ceba22462 Revert r366340.
CR wasn't finished and it breaks the build.
2020-10-01 20:08:27 +00:00
Kyle Evans
320ef1bef0 auxv: partially revert r366207, cast buflen to unsigned int as needed
The warning generated pre-r366207 is actually a sign comparison warning:

error: comparison of integers of different signs: 'unsigned long' and 'int'
                        if (strlcpy(buf, execpath, buflen) >= buflen)

Revert parts that affected other lines and just cast this to unsigned int.

The buflen < 0 -> EINVAL has been kept despite no longer serving any
purposes w.r.t. sign-extension because I do believe it's the right thing to
do: "The provided buffer was not the right size for the requested item."

The original warning is confirmed to still be gone with an:
env WARNS=6 make WITHOUT_TESTS=yes.

Reviewed by:	asomers, kib
X-MFC-With:	r366207
Differential Revision:	https://reviews.freebsd.org/D26631
2020-10-01 19:56:38 +00:00
Bryan Drewery
2398cd1103 Use unlocked page lookup for inmem() to avoid object lock contention
Reviewed By:	kib, markj
Sponsored by:	Dell EMC Isilon
Submitted by:	mlaier
Differential Revision:	https://reviews.freebsd.org/D26597
2020-10-01 19:17:03 +00:00
Dimitry Andric
8833aad7be Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
release/11.x llvmorg-11.0.0-rc5-0-g60a25202a7d.

MFC after:	4 weeks
X-MFC-With:	r364284
2020-10-01 19:06:07 +00:00
Edward Tomasz Napierala
ba2548b7bf Don't ignore the return value from gethostname(3). It probably
cannot happen, but it silences Coverity.

Reviewed by:	mav
MFC after:	2 weeks
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D26606
2020-10-01 18:56:44 +00:00
Edward Tomasz Napierala
4c6f466cb4 Only clear TDP_NERRNO when needed, ie when it's previously been set.
Reviewed by:	kib
Tested by:	pho
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D26612
2020-10-01 18:45:31 +00:00
Dimitry Andric
d189cf5a46 Vendor import of llvm-project branch release/11.x
llvmorg-11.0.0-rc5-0-g60a25202a7d.
2020-10-01 17:48:15 +00:00
John Baldwin
6f64e4f361 bhyve: Fix build with option BHYVE_SNAPSHOT
'ident' was replaced with 'ata_ident' in revision r363596.

Submitted by:	Vitaliy Gusev <gusev.vitaliy_gmail.com>
Reviewed by:	Darius Mihai
Differential Revision:	 https://reviews.freebsd.org/D26263
2020-10-01 17:16:05 +00:00
Emmanuel Vadot
48c13e5270 ichsmb_pci: convert to pci_device_table / add PCI_PNP_INFO
Submitted by:	Greg V <greg@unrelenting.technology>
Reviewed by:	mav
Differential Revision:	https://reviews.freebsd.org/D25260
2020-10-01 16:55:01 +00:00
John Baldwin
a3f2a9c57e Clear the upper 32-bits of registers in x86_emulate_cpuid().
Per the Intel manuals, CPUID is supposed to unconditionally zero the
upper 32 bits of the involved (rax/rbx/rcx/rdx) registers.
Previously, the emulation would cast pointers to the 64-bit register
values down to `uint32_t`, which while properly manipulating the lower
bits, would leave any garbage in the upper bits uncleared.  While no
existing guest OSes seem to stumble over this in practice, the bhyve
emulation should match x86 expectations.

This was discovered through alignment warnings emitted by gcc9, while
testing it against SmartOS/bhyve.

SmartOS bug:	https://smartos.org/bugview/OS-8168
Submitted by:	Patrick Mooney
Reviewed by:	rgrimes
Differential Revision:	https://reviews.freebsd.org/D24727
2020-10-01 16:45:11 +00:00
Enji Cooper
c9d175ea90 Eliminate duplicate afterinstallconfigs target
Define separate dependent targets which `afterinstallconfigs` relies on, in
order to modify `${DESTDIR}/etc/master.passwd` and
`${DESTDIR}/etc/nsswitch.conf`.

Mark these targets .PHONY, since they manipulate configurations on the fly and
the generation logic isn't 100% defined in terms of the source files/logic,
and is variable, based on MK_foo flags.

MFC after:	2 weeks
Reviewed by:	bapt, brd
Differential Revision:	https://reviews.freebsd.org/D20330
2020-10-01 16:37:49 +00:00
Stefan Eßer
d213476d1c Upgrade to version 3.1.6
This upgrade addresses one (benign) compiler warning when building with
LLVM-12.
2020-10-01 15:45:07 +00:00
Stefan Eßer
9fef4b8de3 Update to version 3.1.6 2020-10-01 15:40:24 +00:00
Kristof Provost
57712c0b76 riscv: Add memmmap so we can mmap /dev/mem
Reviewed by:	mhorne
Sponsored by:	Axiado
Differential Revision:	https://reviews.freebsd.org/D26622
2020-10-01 15:04:55 +00:00
Kyle Evans
94510c294d lualoader: clear up some luacheck warnings
- One (1) unused argument
- One (1) trailing whitespace
- Two (2) "non-standard global" (curenv, rewind)

tools/boot/lua-lint.sh is once again happy.
2020-10-01 14:20:36 +00:00
Ed Maste
92d47dce78 Add cd device to arm64 GENERIC
Big-iron arm64 machines might have a CD, possibly provided by some IPMI
emulation.

Reported by:	scottph
2020-10-01 13:29:29 +00:00