Commit Graph

251905 Commits

Author SHA1 Message Date
Eric van Gyzen
32592d86df devinfo: fix memory leak on error paths
Refactor to create devinfo_free_dev().  Call it to plug a memory leak
on two error paths in devinfo_init_devices().

Reported by:	Coverity
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2020-08-04 21:05:53 +00:00
Ruslan Bukin
b64dca2b6f Remove unneeded cast to struct iommu_domain *.
Sponsored by:	DARPA, AFRL
2020-08-04 20:54:12 +00:00
Ruslan Bukin
78b517543b Add a few macroses for conversion between DMAR unit, domain, ctx
and IOMMU unit, domain, ctx.

Reviewed by:	kib
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D25926
2020-08-04 20:51:05 +00:00
Mateusz Guzik
8541ae04b4 rms: fix typo: bitmamp -> bitmap
Reported by:	kib
2020-08-04 20:31:03 +00:00
Emmanuel Vadot
f2df51ecc5 mmccam: Hold the periph during init
We need to sleep during this routine so acquire the cam hold too.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D25946
2020-08-04 20:04:00 +00:00
Emmanuel Vadot
cd2f74af6f mmcam: Use a static length sbuf buffer
We cannot sleep during cam proto_announce and sbuf sleeps so use
a static length buffer like nvme(4)

Reviewed by:	kibab
Differential Revision:	https://reviews.freebsd.org/D25949
2020-08-04 20:02:23 +00:00
Emmanuel Vadot
25f965fdaa mmccam: mmc_xpt: We're only interested about losing the device
Remove all the uneeded printfs

Reviewed by:	imp, kibab
Differential Revision:	https://reviews.freebsd.org/D25948
2020-08-04 20:00:21 +00:00
Mateusz Guzik
1164f7a566 cache: factor away failed vexec handling 2020-08-04 19:55:26 +00:00
Mateusz Guzik
0439b00ea8 cache: assorted tidy ups 2020-08-04 19:55:00 +00:00
Mateusz Guzik
18bd02e2ce cache: factor away lockless dot lookup and add missing stat + sdt probe 2020-08-04 19:54:37 +00:00
Mateusz Guzik
17a66c7087 vfs: add vfs_op_thread_enter/exit _crit variants
and employ them in the namecache. Eliminates all spurious checks for preemption.
2020-08-04 19:54:10 +00:00
Mateusz Guzik
0311b05fec cache: add missing numcache detrement on insertion failure 2020-08-04 19:52:52 +00:00
Mateusz Guzik
3211e783e3 rms: add a comment explaining performance deficiencies of write locking 2020-08-04 19:52:16 +00:00
Emmanuel Vadot
d6502e7c67 Import DTS files for arm, arm64, riscv from Linux 5.8
MFC after:	2 months
2020-08-04 19:44:43 +00:00
Alexander Motin
f0f2014387 Remove extra memset() left after r342388.
This memset() wiped MPI2_FUNCTION_SCSI_TASK_MGMT set by mprsas_alloc_tm(),
that broke target reset on device removal, making later re-insertion into
the same slot impossible, since firmware was still waiting for the driver
to finish with the removed device.

MFC after:	1 week
Sponsored by:	iXsystems, Inc.
2020-08-04 19:27:03 +00:00
Emmanuel Vadot
2554fe8f89 Import DTS from Linux 5.8 2020-08-04 19:05:45 +00:00
John Baldwin
776b260ae2 Disable errors for -Wsystem-headers for GCC on aarch64.
GCC's own arm_neon.h triggers multiple warnings on both GCC 6 and
GCC 9.

Differential Revision:	https://reviews.freebsd.org/D25729
2020-08-04 18:24:46 +00:00
John Baldwin
ec71044958 ld.bfd requires an explicit emulation for MIPS for ld -r.
Unlike lld, ld.bfd doesn't infer the emulation from the first object
file, but assumes its compiled in default for ld -r.

Differential Revision:	https://reviews.freebsd.org/D25728
2020-08-04 18:23:32 +00:00
John Baldwin
0ea6e5109d Disable errors for -Wredundant-decls for GCC 6+.
GCC triggers warnings for this that clang does not for duplicate
declarations of yylex().

Differential Revision:	https://reviews.freebsd.org/D25727
2020-08-04 18:20:39 +00:00
John Baldwin
a02fb76280 Turn off errors for -Wmaybe-uninitialized in GCC 6+.
Recent changes to <sys/tree.h> trigger this warning and seem like a
false positive.

Differential Revision:	https://reviews.freebsd.org/D25726
2020-08-04 18:19:29 +00:00
Emmanuel Vadot
dfb4ecb38b linuxkpi: Add time_after32 and time_before32
This compare two 32 bits times

Sponsored by: The FreeBSD Foundation
Reviewed by:	kib, hselasky
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D25700
2020-08-04 15:27:32 +00:00
Emmanuel Vadot
334680ab07 linuxkpi: Add clear_bit_unlock
This calls clear_bit and adds a memory barrier.

Sponsored by: The FreeBSD Foundation

Reviewed by:	hselasky
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D25943
2020-08-04 15:25:22 +00:00
Mark Johnston
cfae6a92ac Remove an incorrect assertion from in6p_lookup_mcast_ifp().
The socket may be bound to an IPv4-mapped IPv6 address.  However, the
inp address is not relevant to the JOIN_GROUP or LEAVE_GROUP operations.

While here remove an unnecessary check for inp == NULL.

Reported by:	syzbot+d01ab3d5e6c1516a393c@syzkaller.appspotmail.com
Reviewed by:	hselasky
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D25888
2020-08-04 15:00:02 +00:00
Mark Johnston
efec381dd1 Remove most lingering references to the page lock in comments.
Finish updating comments to reflect new locking protocols introduced
over the past year.  In particular, vm_page_lock is now effectively
unused.

Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D25868
2020-08-04 14:59:43 +00:00
Emmanuel Vadot
38ba9c8bac Re-apply r363564.
We now have linux/sizes.h in the tree.
2020-08-04 14:53:41 +00:00
Emmanuel Vadot
dd8c2fa31b pkgbase: Remove the last users of the FreeBSD-example package
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D24176
2020-08-04 14:48:45 +00:00
Emmanuel Vadot
2d946b2e12 linuxkpi: Add nested variant of mutex_lock_interruptible
We don't do anything with the _nesteds variant so just call mutex_lock_interruptible

Sponsoredby: The FreeBSD Foundation
Reviewed by:	hselasky
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D25944
2020-08-04 14:45:22 +00:00
Emmanuel Vadot
7237a74f3b linuxkpi: Add kref_put_lock
Same as kref_put but in addition to calling the rel function it will
acquire the lock first.

Sponsored by: The FreeBSD Foundation
Reviewed by:	hselasky, emaste
Differential Revision:	https://reviews.freebsd.org/D25942
2020-08-04 14:44:16 +00:00
Emmanuel Vadot
16fdd8b7ad linuxkpi: Add linux/sizes.h
This file contain some defines for common sizes.

Sponsored-by: The FreeBSD Foundation
Reviewed by:	hselasky, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D25941
2020-08-04 14:42:38 +00:00
Mark Johnston
96ad26eefb Remove free_domain() and uma_zfree_domain().
These functions were introduced before UMA started ensuring that freed
memory gets placed in domain-local caches.  They no longer serve any
purpose since UMA now provides their functionality by default.  Remove
them to simplyify the kernel memory allocator interfaces a bit.

Reviewed by:	cem, kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D25937
2020-08-04 13:58:36 +00:00
Gordon Bergling
3422ca83ba iovctl.conf(5): Use Lk macro for the URL of the UCL website
PR:		248334
Reported by:	chuck at tuffli dot net
Reviewed by:	bcr, 0mp
Approved by:	bcr, 0mp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D25891
2020-08-04 11:13:13 +00:00
Gordon Bergling
74f32f086b directory(3): Add an ERRORS section
- Add an ERRORS section for opendir(3) and closedir(3)
- Document also the errors of readdir(3), readdir_r(3) and telldir(3)
- Convert the code sample into an EXAMPLES section

PR:	75711

Submitted by:	abc <abc at ai1 dot anchorage dot mtaonline dot net>
Reviewed by:	0mp, bcr, jilles
Approved by:	0mp, bcr, jilles
Obtained from:	partial from OpenBSD
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D25892
2020-08-04 08:46:28 +00:00
Kyle Evans
eb578fec7f Ensure libregex is built in time for googletest
In lib/Makefile, we document the dependency with SUBDIR_DEPEND

For buildworld orchestration, just prebuild libregex if GOOGLETEST is
enabled. googletest will get built in a later pass.
2020-08-04 03:43:28 +00:00
Kyle Evans
cab7d341dc bsdgrep: switch to libregex for GNU_GREP_COMPAT
libregex is incomplete, but it's a bit less buggy than the in-base
libgnuregex and mostly OK.

While here, rename -DIWTH_GNU -> -DWITH_GNU_COMPAT; the option implies
that we're compatible with the GNU counterpart, not that we're including GNU
anything.
2020-08-04 02:47:24 +00:00
Kyle Evans
1546dc216f Re-enable disabled googletest-port-test tests after r363820
gtest now links against libregex here, and the tests pass locally.

PR:		248452
2020-08-04 02:20:15 +00:00
Kyle Evans
b4af4f93c6 gtest: link against libregex for GNU extensions
gtest tests want to use \w ([[:alnum:]]) at the very least, which was
causing them to fail after r363679.

Start linking against libregex so that this shorthand is implemented.

PR:		248452
2020-08-04 02:18:24 +00:00
Kyle Evans
61898cde69 libregex: disable some of the unimplemented test cases for now
This should allow the tests to actually pass. Future work will uncomment the
unimplemented tests as they're implemented.
2020-08-04 02:16:43 +00:00
Kyle Evans
18a1e2e9b9 libregex: Implement a subset of the GNU extensions
The entire patch-set is not yet mature enough for commit, but this usable
subset is generally enough for googletest to be happy with and mostly map to
some existing concepts, so they're not as invasive.

The specific changes included here are:

- Branching in BREs with \|
- \w and \W for [[:alnum:]] and [^[:alnum:]] respectively
- \s and \S for [[:space:]] and [^[:space:]] respectively
- Additional quantifiers in BREs, \? and \+ (self-explanatory)

There's some #ifdef'd out work for allowing empty branches as a match-all.
This is a feature that's under assessment... future work will determine
how standard this behavior is and act accordingly.
2020-08-04 02:14:51 +00:00
Kyle Evans
ba8b64de05 regex(3): belatedly document REG_POSIX from r363734
My original patch included this documented, but it appears that I failed to
include the manpage update. Do so now.
2020-08-04 02:06:49 +00:00
Konstantin Belousov
6e0c8e1ae2 Add SOL_LOCAL symbolic constant for unix socket option level.
The constant seems to exists on MacOS X >= 10.8.

Requested by:	swills
Reviewed by:	allanjude, kevans
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D25933
2020-08-03 22:13:02 +00:00
Warner Losh
e67c55c998 Some function had the blank lines, others didn't. Most of the ones that didn't
were newer, so remove this now-optional blank line everywhere.
2020-08-03 22:12:18 +00:00
Stefan Eßer
f022d2cd17 Connect the tests provided with the new bc and dc
The tests compare the command output (including of error cases) with the
expected output and exit code.

Not all tests are executed, since some expect to have a known good bc and
dc binary installed and compare results of large amounts of generated data
being processed by both versions to test for regressions.
2020-08-03 20:26:04 +00:00
Stefan Eßer
5d934bc0c5 Upgrade to version 3.1.4
This version omits the printing	of a copyright header in interactive mode
and the dc command now exits after	execution of	the commands passed via	-e
or -f instead of switching to interactive mode.	To pass	further	commands
via STDIN when dc has been invoked with	-e or -f, add "-f -" to	the
parameter list.
2020-08-03 19:20:26 +00:00
Stefan Eßer
2ead2969a0 Upgrade to version 3.1.4
This version omits the printing of a copyright header in interactive mode
and the dc command now exits after execution of the commands passed via -e
or -f instead of switching to interactive mode. To pass further commands
via STDIN when dc has been invoked with -e or -f, add "-f -" to the
parameter list.
2020-08-03 19:18:38 +00:00
Stefan Eßer
a68dea2ff9 Import version 3.1.4
This version makes dc exit after processing all commands passed via -e or -f
instead of waiting for more input on STDIN (add "-f -" to the command line
to emulate the behavior of versionm 3.1.3 and earlier, if desired).

The version and copyright message are no longer printed for interactive
sessions as was the case with the prior implementation in the FreeBSD base
system.

Obtained from:	https://git.yzena.com/gavin/bc
2020-08-03 18:55:39 +00:00
Alex Richardson
c4bd82d701 Allow bootstrapping mtree on Linux systems
Linux glibc has a dummy lchmod that always fails and emitting a linker
warning when used. Don't fail the build due to that warning when
bootstrapping by setting LD_FATAL_WARNINGS=no.

Reviewed By:	brooks, emaste
Differential Revision: https://reviews.freebsd.org/D25930
2020-08-03 18:08:10 +00:00
Alex Richardson
9053c1a431 Allow building setmode.c on Linux/macOS
We bootstrap this file to allow compiling FreeBSD on Linux systems since
some boostrap tools use setmode(). Unfortunately, glibc's sys/stat.h
declares a non-static getumask() function (which is unimplemented!) and
that conflicts with the local getumask() function. To work around this
simply use a different name here.

Reviewed By:	brooks, emaste
Differential Revision: https://reviews.freebsd.org/D25929
2020-08-03 18:08:04 +00:00
John Baldwin
338b22234b Pass the full CFLAGS to cpp for MKlib_gen.sh.
GCC's cpp was exiting immediately when it failed to find requested
includes (<ncurses_cfg.h> and <ncurses_defs.h>).  clang-cpp emitted an
error for the missing header files but continued processing the file
(thus not honoring any macros defined in the missing headers).

Arguably, the awk script is buggy since it doesn't check the return
value of the command it executes.

Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D25731
2020-08-03 17:53:15 +00:00
Andrew Turner
9ca3eaf0bd Add a GPIO driver for the Raspberry Pi firmware GPIOs
These exist on the Raspberry Pi 3 and 4 and control and external IO
expander.

Reviewed by:	manu
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D25858
2020-08-03 17:18:12 +00:00
Konstantin Belousov
ca9a39acb3 Provide more correct description for sysctl kern.smp.cores.
Reported by:	dewayne@heuristicsystems.com.au
PR:	248454
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2020-08-03 17:17:17 +00:00