Commit Graph

249612 Commits

Author SHA1 Message Date
Alan Somers
35f139130a zfsd.8: fix orphan .Xr
Though ZFS is a kernel module, it has no man page in section 4.

Reported by:	phk
MFC after:	2 weeks
2020-04-18 19:47:38 +00:00
Ed Maste
cdf1703846 hda: remove hda*_lockowned macros
These are not used anywhere.
2020-04-18 18:25:30 +00:00
Hans Petter Selasky
cc224e5381 Set the maximum exit latency to 0 for XHCI USB 3.0 devices, because we
don't implement link power management, LPM.

This fixes error code XHCI_TRB_ERROR_BANDWIDTH for isochronous USB 3.0
transactions.

Submitted by:	Horse Ma <Shichun.Ma@dell.com>
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-04-18 15:05:10 +00:00
Mateusz Piotrowski
93e0e298b9 Use the Ic macro for find(1) primaries consistently
MFC after:	3 days
2020-04-18 13:29:54 +00:00
Alex Richardson
c9c283bd30 Fix various warnings in tests/sys/kqueue and bump WARNS
Reviewed By:	kevans
Differential Revision: https://reviews.freebsd.org/D24296
2020-04-18 12:54:47 +00:00
Alex Richardson
4db3ef4c77 More fixes to build the kernel with a compiler that defaults to -fno-common
Using the same approach as the last commit for the files used by genassym.sh.

Obtained from:	CheriBSD
2020-04-18 12:54:40 +00:00
Alex Richardson
a8976aec45 Allow kernel modules to build with a compiler that defaults to -fno-common
This uses the same approach as r359691.

Reviewed By:	brooks
Differential Revision: https://reviews.freebsd.org/D24405
2020-04-18 12:54:35 +00:00
Hans Petter Selasky
6f80a2c88e Add missing feature descriptions to hci_features2str().
The list of possible features in hccontrol/features2str() is incomplete.
Refer to "Bluetooth Core Specification 5.2 Vol. 2 Part C. 3.3 Feature Mask Definition".

Submitted by:	Marc Veldman <marc@bumblingdork.com>
PR:		245354
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-04-18 08:29:16 +00:00
Kristof Provost
fac24ad7f0 bridge: Simplify mac address generation
Unconditionally use ether_gen_addr() to generate bridge mac addresses.  This
function is now less likely to generate duplicate mac addresses across jails.
The old hand rolled hostid based code adds no value.

Reviewed by:	bz
Differential Revision:	https://reviews.freebsd.org/D24432
2020-04-18 08:00:58 +00:00
Kristof Provost
3f8bc99c4c ethersubr: Make the mac address generation more robust
If we create two (vnet) jails and create a bridge interface in each we end up
with the same mac address on both bridge interfaces.
These very often conflicts, resulting in same mac address in both jails.

Mitigate this problem by including the jail name in the mac address.

Reviewed by:	kevans, melifaro
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D24383
2020-04-18 07:50:30 +00:00
Konstantin Belousov
acf65eef23 sendfile: When all io finished, assert that sfio->pa[] is in expected state.
It must contain fully restored contigous run of the wired pages from
the object, except possible trimmed tail.

Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2020-04-18 03:09:25 +00:00
Konstantin Belousov
e795a04083 The pa argument for sendfile_iodone() is not necessary a slice of sfio->pa.
It is true for zfs, but it is not for e.g. vnode or buffer pagers.
When fixing bogus pages, fix them in both places.  Rely on the fact
that pa[0] must have been invalid so it cannot be bogus.

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2020-04-18 03:07:18 +00:00
Warner Losh
5c68be59c8 Add deprecation notice to amr(4) 2020-04-18 02:53:19 +00:00
Warner Losh
a32311eccd twa(4) deprecation notice 2020-04-18 02:53:14 +00:00
Warner Losh
6ccdbb521a Deprecation notice for iir 2020-04-18 02:53:09 +00:00
Warner Losh
5b18755735 Add deprecation notice to mly 2020-04-18 02:53:04 +00:00
Warner Losh
dd6382d1c4 Add deprecation notice for esp(4). 2020-04-18 02:52:59 +00:00
Simon J. Gerraty
0326eec5c3 Define enum for so_qstate outside of struct.
LLVM-9.0 clang++ throws an error for enum defined within
an anonymous struct.

Reviewed by:	jtl, rpokala
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org//D24477
2020-04-18 01:22:41 +00:00
Ed Maste
f64485243f hdac: replace printf for unowned lock with a lock assertion
Reviewed by:	markj, mav
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D24479
2020-04-18 01:16:30 +00:00
Greg Lehey
96273f2488 Tidy up syntax and punctuation of some entries. 2020-04-17 23:14:51 +00:00
Rick Macklem
ae070589d3 Replace all instances of the typedef mbuf_t with "struct mbuf *".
The typedef mbuf_t was used for the Mac OS/X port of the code long ago.
Since this port is no longer used and the use of mbuf_t obscures what
the code does (and is not consistent with style(9)), it is no longer needed.
This patch replaces all instances of mbuf_t with "struct mbuf *", so that
it is no longer used.

This patch should not result in any semantic change.
2020-04-17 21:17:51 +00:00
Conrad Meyer
f953e7317a xen-locore: Silence DWARF2 section warning
Silence the "DWARF2 can only represent one section per compilation unit"
warning in amd64 GENERIC builds by disabling Clang's debuginfo generation for
this assembler file (-g0).  The message is replaced by a warning from
ctfconvert that there is no debuginfo to convert (future work).

The file contains some metadata (several ELF notes) and some code.  The code
does not appear to have anything that debuginfo would aid.

I looked at the generated debuginfo (readelf -w xen-locore.o) prior to this
change, and the metadata that would be disabled are things like associated
between binary offset and code line number (not especially useful with a
disassembler), and label metadata for the entry points (not especially useful
as this is already in the symbol table).

Reviewed by:	royger
Differential Revision:	https://reviews.freebsd.org/D24384
2020-04-17 20:20:03 +00:00
Ed Maste
a449a1eb9b hdac: update comment to match function name
snd_hda was rewritten in r230130; one function retained a comment
referencing the previous name.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2020-04-17 19:14:05 +00:00
Mark Johnston
546c117f86 Remove a vestigal reference to kmem_object.
kmem_object has been an alias of kernel_object for a while.

MFC after:	1 week
2020-04-17 19:12:52 +00:00
Kyle Evans
23d5326823 tty: convert tty_lock_assert to tty_assert_locked to hide lock type
A later change, currently being iterated on in D24459, will in-fact change
the lock type to an sx so that TTY drivers can sleep on it if they need to.
Committing this ahead of time to make the review in question a little more
palatable.

tty_lock_assert() is unfortunately still needed for now in two places to
make sure that the tty lock has not been recursed upon, for those scenarios
where it's supplied by the TTY driver and possibly a mutex that is allowed
to recurse.

Suggested by:	markj
2020-04-17 18:34:49 +00:00
John Baldwin
490befd40a Use the right type for 64-bit coprocessor registers.
The use of "int" here caused the compiler to believe that it needs to
insert a "sll $n, $n, 0" to sign extend as part of the implicit cast
to uint64_t.

Submitted by:	Nathaniel Filardo <nwf20@cl.cam.ac.uk>
Reviewed by:	brooks, arichardson
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D24457
2020-04-17 18:24:47 +00:00
Alexander V. Chernikov
ae4b62595e Unbreak build by reverting if_bridge part of r360047.
Pointy hat to: melifaro
2020-04-17 18:22:37 +00:00
John Baldwin
5326289d93 Don't try to copyout() to a kernel buffer.
The handle_string callback for the ENCIOC_GET_ENCNAME and
ENCIOC_GETENCID ioctls tries to copy the size of the generated string
out to userland.  However, the callback only has access to the kernel
copy of the structure populated by copyin().  The copyout() call
simply overwrites the value in the kernel's copy preventing the
subsequent overflow prevention logic from working.

Fix this by instead doing a copyout() of the updated length in the
caller after the callback returns.

Reviewed by:	kib
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D24456
2020-04-17 18:19:13 +00:00
Alexander V. Chernikov
6745294280 Finish r191148: replace rtentry with route in if_bridge if_output() callback.
Generic if_output() callback signature was modified to use struct route
 instead of struct rtentry in r191148, back in 2009.

Quoting commit message:

 Change if_output to take a struct route as its fourth argument in order
 to allow passing a cached struct llentry * down to L2

Fix bridge_output() to match this signature and update the remaining
 comment in if_var.h.

Reviewed by:	kp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D24394
2020-04-17 17:05:58 +00:00
Mark Johnston
6e17fbacea Always compile minidump_machdep.c on arm.
It is not logically dependent on "device mem", and an arm kernel
compiled without that device fails to link since the minidumpsys()
symbol is referenced by kern_dump.c.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-04-17 16:55:14 +00:00
Olivier Cochard
86686423d5 Skip routing regression tests depending on if_epair if this module isn't installed.
Approved by:	melifaro
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D24468
2020-04-17 16:31:07 +00:00
Conrad Meyer
497cb9259b vmm.h: Add ABI assertions and mark implicit holes
The static assertions were added (with size and offsets from gdb) and verified
with a build prior to marking the holes explicitly.

This is in preparation for a subsequent revision, pending in phabricator, that
makes use of some of these unused bits without impacting the ABI.

Reviewed by:	grehan
Differential Revision:	https://reviews.freebsd.org/D24461
2020-04-17 15:19:42 +00:00
Kristof Provost
3f359bfd47 bridge tests: Test deleting a bridge with members
Reviewed by:	philip, emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D24337
2020-04-17 14:57:15 +00:00
Kristof Provost
95324dc3f4 pf: Do not allow negative ps_len in DIOCGETSTATES
Userspace may pass a negative ps_len value to us, which causes an
assertion failure in malloc().
Treat negative values as zero, i.e. return the required size.

Reported-by:	syzbot+53370d9d0358ee2a059a@syzkaller.appspotmail.com
Reviewed by:	lutz at donnerhacke.de
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D24447
2020-04-17 14:35:11 +00:00
Eugene Grosbein
4e49fbcd37 jail(8): improve manual and usage information with more clear
description for "jail -e" mode to show that it does not take
additional jail name argument.

Reported by:		David Marec <david.marec@davenulle.org>
MFC after:		3 days
2020-04-17 10:12:11 +00:00
Gleb Smirnoff
9edef911e8 Make ZFS depend on xdr.ko only. It doesn't need kernel RPC.
Differential Revision:	https://reviews.freebsd.org/D24408
2020-04-17 06:05:08 +00:00
Gleb Smirnoff
732a02b4e7 Split XDR into separate kernel module. Make krpc depend on xdr.
Reviewed by:	rmacklem
Differential Revision:	https://reviews.freebsd.org/D24408
2020-04-17 06:04:20 +00:00
Gleb Smirnoff
e5c3941009 Move M_RPC malloc type into XDR. Both RPC and XDR libraries use
this type, but since RPC depends on XDR (not vice versa) we need
it defined in XDR to make the module loadable without RPC.

Reviewed by:	rmacklem
Differential Revision:	https://reviews.freebsd.org/D24408
2020-04-17 06:02:13 +00:00
Gleb Smirnoff
2ffded5e53 Don't initialize m->m_data to m->m_pktdat, this is already done by the
mbuf allocator.  That was the last remnant of such code in the kernel.
2020-04-17 05:59:38 +00:00
Kyle Evans
c17dd0e88b tests: kqueue: use a more precise timer for the NOTE_ABSTIME test
Originally noticed while attempting to run the kqueue tests under
qemu-user-static, this apparently just happens sometimes when running in a
jail in general -- the timer will fire off "too early," but it's really just
the result of imprecise measurements (noted by cem).

Kicking this over to NOTE_USECONDS still tests the correct thing while
allowing it to work more consistently; a basic sanity test reveals that we
often end up coming in just less than 200 microseconds after the timer
fired off.

MFC after:	3 days
2020-04-17 02:22:15 +00:00
Rick Macklem
82164bdd76 Add a sanity check for nes_numsecflavor to the NFS server.
Ryan Moeller reported crashes in the NFS server that appear to be
caused by stack corruption in nfsrv_compound(). It appears that
the stack got corrupted just after a NFSv4.1 Lookup that crosses
a server mount point.
Although it is just a "theory" at this point, the most obvious way
the stack could get corrupted would be if nfsvno_checkexp() somehow
acquires an export with a bogus nes_numsecflavor value. This would
cause the copying of the secflavors to run off the end of the array,
which is allocated on the stack below where the corruption occurs.

This sanity check is simple to do and would stop the stack corruption
if the theory is correct. Otherwise, doing the sanity check seems to
be a reasonable safety belt to add to the code.

Reported by:	freqlabs
MFC after:	2 weeks
2020-04-17 02:21:46 +00:00
Kyle Evans
cc62118e65 audit_canon_path_vp: don't panic if cdir == NULL
cdir may have simply failed to resolve (e.g. fget_cap failure in namei
leading to NULL dp passed to AUDIT_ARG_UPATH*_VP); restore the pre-rS358191
behavior of setting cpath[0] = '\0' and bailing out instead of panicking.

This was found by inadvertently running the libc/c063 tests with auditing
enabled, resulting in a panic.

Reviewed by:	mjg (committed version actually his)
Differential Revision:	https://reviews.freebsd.org/D24445
2020-04-17 02:09:31 +00:00
Adrian Chadd
4d0b267a1f [sh] Fix a "may be unused" warning on mips-gcc
mips-gcc for mips32 was complaining that c was potentially used before
being set.  Setting it to 0 before calling fdgetsc() looks like the right
thing to do in this instance; there's an explicit check for c == 0 later
on.

Tested: mips-gcc mips32 build, running /bin/sh on mips32
2020-04-16 23:31:39 +00:00
Adrian Chadd
6c88ef1c81 [libsa] Fix typecast of pointer for st_dev
This code was trying to use a pointer value for st_dev, which is definitely
not a pointer.  Instead, cast to uintptr_t so it becomes a non-pointer value
before casting it.

Tested: mips-gcc cross compile, mips32 build
2020-04-16 23:29:49 +00:00
Adrian Chadd
2538a4b1b4 Remove an duplicate definition of nhops_dump_sysctl()
One of the source files included both nhop.h and shared.h, leading to this
clashing.

Tested with: mips-gcc cross toolchain
2020-04-16 23:28:47 +00:00
Colin Percival
a620e53d52 Alert devd when acpi_video brightness changes
On my Dell Latitude 7390 laptop, the brightness hotkeys
(Fn+<up/down arrow>) send ACPI notifications which acpi_video
handles by adjusting its brightness setting; but ACPI does not
actually do anything with the backlight.

Announcing brightness changes via devd makes it possible to close
the loop by triggering the intel_backlight utility to perform the
required backlight adjustment.

Reviewed by:	imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D24424
2020-04-16 21:56:52 +00:00
Brooks Davis
b24e6ac8b7 Convert canary, execpathp, and pagesizes to pointers.
Use AUXARGS_ENTRY_PTR to export these pointers.  This is a followup to
r359987 and r359988.

Reviewed by:	jhb
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D24446
2020-04-16 21:53:17 +00:00
John Baldwin
d3920c5b12 Use %zu to print a size_t value instead of %ju.
This fixes the build for 32-bit kernels.
2020-04-16 20:46:35 +00:00
John Baldwin
fdbb2410cb Add 'gpio' since mmc now requires gpio_if.h. 2020-04-16 20:45:54 +00:00
Emmanuel Vadot
8738027377 arm: nvidia: pcie: Rename class name to pcib
Reported by:	jhb
2020-04-16 20:44:23 +00:00