Commit Graph

258998 Commits

Author SHA1 Message Date
Mitchell Horne
0c915023db libpmc: remove pe->alias
It has never been a part of upstream's struct pmu_event. The jevents
utility will not fill this field, so remove it.

Reviewed by:	gnn
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30530
2021-05-31 17:39:05 -03:00
Mitchell Horne
ec66cc955b libpmc: eliminate pmc_pmu_stat_mode()
There is a single consumer, the pmc utility, that clearly has knowledge
of which counters it is expecting. Remove this function and have it
use common counter aliases instead.

Reviewed by:	gnn
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30528
2021-05-31 17:39:05 -03:00
Mitchell Horne
167cdaa7e3 pmccontrol: improve -L with pmu-events
Check if the pmu utils are supported rather than carrying a
machine-dependent #ifdef.

Reviewed by:	gnn, ray, emaste
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30526
2021-05-31 17:39:05 -03:00
Mitchell Horne
0092642f86 libpmc: remove unused 'isfixed' variable
Reviewed by:	gnn, emaste
MFC after:	5 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30529
2021-05-31 17:39:04 -03:00
Mitchell Horne
bc1a6a9d69 libpmc: fix "instructions" alias on Intel
The typo prevents the counter from being allocated.

This fixes e.g. pmcstat -s instructions sleep 5

Reviewed by:	mizhka, gnn, ray, emaste
MFC after:	5 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30527
2021-05-31 17:38:19 -03:00
Konstantin Belousov
d3f7975fcb thread_reap_barrier(): remove unused variable
Noted by:	alc
Sponsored by:	Mellanox Technologies/NVidia Networking
MFC after:	1 week
2021-05-31 23:03:42 +03:00
Dmitry Chagin
2a0fa277f6 linux(4): Microoptimize futimesat, utimes, utime.
While here wrap long line.

Differential Revision:	https://reviews.freebsd.org/D30488
MFC after:		2 weeks
2021-05-31 22:54:18 +03:00
Dmitry Chagin
b4f9b6eef2 linux(4): Handle AT_EMPTY_PATH in the utimensat syscall.
Differential Revision:	https://reviews.freebsd.org/D30518
MFC after:		2 weeks
2021-05-31 22:37:06 +03:00
J.R. Oldroyd
5236888db7 iichid(4): disable interrupt on suspend
Commit message of the identical change in Linux driver says:
"When an I2C HID device is powered off during system sleep, as a result
of removing its power resources (by the ACPI core) the interrupt line
might go low as well.  This results inadvertent interrupts."

This change fixes suspend/resume on Asus S510UQ laptops.

While here add a couple of typo fixes as well as a slight change to the
iichid_attach() code to have the power_on flag set properly.

Submitted by:	J.R. Oldroyd <jr_AT_opal_DOT_com>
Reviewed by:	wulf
MFC after:	1 week
2021-05-31 22:33:07 +03:00
Vladimir Kondratyev
da93a73f83 iwmbtfw(8): Improve Intel 7260/7265 adaptors handling
- Allow firmware downloading for hw_variant #8;
- Enter manufacturer mode for setting of event mask;
- Handle multi-event response on HCI commands for 7260;
  This allows to remove kludge with skipping of 0xfc2f opcode.
- Disable patch and exit manufacturer mode on downloading failure;
- Use default firmware if correct firmware file is not found;

Reviewed by:	Philippe Michaud-Boudreault <pitwuu_AT_gmail_DOT_com>
MFC after:	1 week
Tested by:	arrowd
Differential revision:	https://reviews.freebsd.org/D30543
2021-05-31 22:32:08 +03:00
Dmitry Chagin
8505eb5dd8 linux(4): Convert flags before use in utimensat.
Differential Revision:	https://reviews.freebsd.org/D30487
MFC after:		2 weeks
2021-05-31 22:30:37 +03:00
Dmitry Chagin
a06c12464b linux(4): Add F_GETPIPE_SZ fcntl operation which returns the capacity
of the pipe referred by fd.

Differential Revision:	https://reviews.freebsd.org/D30517
MFC after:		2 weeks
2021-05-31 22:15:02 +03:00
Dmitry Chagin
19593f775c linux(4); Retire unnecessary __packed attribute from some struct's
definition.

Differential Revision:	https://reviews.freebsd.org/D30482
MFC after:		2 weeks
2021-05-31 21:56:34 +03:00
Emmanuel Vadot
2d926ed71e arm: SOCFPGA: Add ext_resources driver
mmc_fdt_helpers needs clock and regulators.
Add all the ext_resources driver to SOCFPGA conf file to fix the build

Reported by:    mjg
2021-05-31 19:08:08 +02:00
Mateusz Guzik
68c2544264 nfs: even up value returned by nfsrv_parsename with copyinstr
Reported by:	dim
Reviewed by:	rmacklem
2021-05-31 16:32:04 +00:00
Konstantin Belousov
f62c7e54e9 Add thread_reap_barrier()
Reviewed by:	hselasky,markj
Sponsored by:	Mellanox Technologies/NVidia Networking
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D30468
2021-05-31 18:09:22 +03:00
Konstantin Belousov
3a68546d23 quisce_cpus(): add special handling for PDROP
Currently passing PDROP to the quisce_cpus() function does not make sense.
Add special meaning for it, by not waiting for the idle thread to schedule.

Also avoid allocating u_int[MAXCPU] on the stack.

Reviewed by:	hselasky, markj
Sponsored by:	Mellanox Technologies/NVidia Networking
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D30468
2021-05-31 18:09:22 +03:00
Konstantin Belousov
845d77974b kern_thread.c: wrap too long lines
Reviewed by:	hselasky, markj
Sponsored by:	Mellanox Technologies/NVidia Networking
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D30468
2021-05-31 18:09:22 +03:00
Konstantin Belousov
e266a0f7f0 kern linker: do not allow more than one kldload and kldunload syscalls simultaneously
kld_sx is dropped e.g. for executing sysinits, which allows user
to initiate kldunload while module is not yet fully initialized.

Reviewed by:	markj
Differential revision:	https://reviews.freebsd.org/D30456
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-05-31 18:09:22 +03:00
Kristof Provost
7c4342890b pf: Convenience function for optional (numeric) arguments
Add _opt() variants for the uint* functions. These functions set the
provided default value if the nvlist doesn't contain the relevant value.
This is helpful for optional values (e.g. when the API is extended to
add new fields).

While here simplify the header by also using macros to create the
prototypes for the macro-generated function implementations.

Reviewed by:	scottl
MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30510
2021-05-31 14:19:17 +02:00
Kristof Provost
27c77f42ae libpfctl: Improve error handling in pfctl_get_states()
Ensure that we always free nvlists and other allocated memory.

Reviewed by:	scottl
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30493
2021-05-31 14:18:47 +02:00
Kristof Provost
6dbb729d35 libpfctl: fix memory leak
When we create an nvlist and insert it into another nvlist we must
remember to destroy it. The nvlist_add_nvlist() function makes a copy,
just like nvlist_add_string() makes a copy of the string.

See also 4483fb4773

Reviewed by:	scottl
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30492
2021-05-31 14:18:32 +02:00
Emmanuel Vadot
ac1d7397bf arm64: allwinner: clk: Test with the current parent freq first
Even if the clock is flagged with AW_CLK_SET_PARENT the current parent
freq might be enough to get a correct divisor.
So test first if we can get the expected freq before changing the parent
freq.
2021-05-31 14:10:24 +02:00
Lutz Donnerhacke
bec0a5dca7 libalias: Remove LibAliasCheckNewLink
Finally drop the function in 14-CURRENT.

Discussed with: kp
Differential Revision: https://reviews.freebsd.org/D30275
2021-05-31 13:04:11 +02:00
Lutz Donnerhacke
bfd41ba1fe libalias: Remove unused function LibAliasCheckNewLink
The functionality to detect a newly created link after processing a
single packet is decoupled from the packet processing.  Every new
packet is processed asynchronously and will reset the indicator, hence
the function is unusable.  I made a Google search for third party code,
which uses the function, and failed to find one.

That's why the function should be removed: It unusable and unused.
A much simplified API/ABI will remain in anything below 14.

Discussed with:	kp
Reviewed by:	manpages (bcr)
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30275
2021-05-31 12:53:57 +02:00
Wojciech Macek
d40cd26a86 ip_mroute: rework ip_mroute
Approved by:     mw
Obtained from:   Semihalf
Sponsored by:    Stormshield
Differential Revision: https://reviews.freebsd.org/D30354

Changes:
1. add spinlock to bw_meter

If two contexts read and modify bw_meter values
it might happen that these are corrupted.
Guard only code fragments which do read-and-modify.
Context which only do "reads" are not done inside
spinlock block. The only sideffect that can happen is
an 1-p;acket outdated value reported back to userspace.

2. replace all locks with a single RWLOCK

Multiple locks caused a performance issue in routing
hot path, when two of them had to be taken. All locks
were replaced with single RWLOCK which makes the hot
path able to take only shared access to lock most of
the times.
All configuration routines have to take exclusive lock
(as it was done before) but these operation are very rare
compared to packet routing.

3. redesign MFC expire and UPCALL expire

Use generic kthread and cv_wait/cv_signal for deferring
work. Previously, upcalls could be sent from two contexts
which complicated the design. All upcall sending is now
done in a kthread which allows hot path to work more
efficient in some rare cases.

4. replace mutex-guarded linked list with lock free buf_ring

All message and data is now passed over lockless buf_ring.
This allowed to remove some heavy locking when linked
lists were used.
2021-05-31 05:48:15 +02:00
Rick Macklem
947bd2479b nfsd: Add support for the NFSv4.1/4.2 Secinfo_no_name operation
The Linux client is now attempting to use the Secinfo_no_name
operation for NFSv4.1/4.2 mounts.  Although it does not seem to
mind the NFSERR_NOTSUPP reply, adding support for it seems
reasonable.

I also noticed that "savflag" needed to be 64bits in
nfsrvd_secinfo() since nd_flag in now 64bits, so I changed
the declaration of it there.  I also added code to set "vp" NULL
after performing Secinfo/Secinfo_no_name, since these
operations consume the current FH, which is represented
by "vp" in nfsrvd_compound().

Fixing when the server replies NFSERR_WRONGSEC so that
it conforms to RFC5661 Sec. 2.6 still needs to be done
in a future commit.

MFC after:	2 weeks
2021-05-30 17:52:43 -07:00
Alan Somers
f0d577fd2d [skip ci] volunteer to maintain POSIX AIO
MFC after:	2 weeks
2021-05-30 17:21:12 -06:00
Alan Somers
425bbe9e64 fusefs: reenable the WriteCluster.cluster_write_err test
The underlying panic was just fixed by
revision 27006229f7

PR:		238565
MFC after:	1 week
MFC with:	27006229f7
2021-05-30 16:51:56 -06:00
Alan Somers
5a20c351ea [skip ci] add a CODEOWNERS file
Summary:
Convert MAINTAINERS into a Github CODEOWNERS file.  This will
automatically assign reviewers to some GH pull requests.  The conversion
is not 1:1; some committers don't have Github accounts (e.g. adrian),
some functional areas don't neatly correspond to a set of files (e.g.
kqueue), and mailing lists can't be assigned as a reviewer (e.g.
secteam@).  But it's a start.

MFC after:	2 weeks
Reviewed by:	imp
Differential Revision: https://reviews.freebsd.org/D30559
2021-05-30 16:49:07 -06:00
Konstantin Belousov
27006229f7 vinvalbuf: do not panic if we were unable to flush dirty buffers
Return EBUSY instead and let caller to handle the issue.

For vgone()/vnode reclamation, caller first does vinvalbuf(V_SAVE),
which return EBUSY in case dirty buffers where not flushed. Then caller
calls vinvalbuf(0) due to non-zero return, which gets rid of all dirty
buffers without dependencies.

PR:	238565
Reviewed by:	asomers, mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D30555
2021-05-31 01:20:53 +03:00
Jason A. Harmening
a4b07a2701 VFS_QUOTACTL(9): allow implementation to indicate busy state changes
Instead of requiring all implementations of vfs_quotactl to unbusy
the mount for Q_QUOTAON and Q_QUOTAOFF, add an "mp_busy" in/out param
to VFS_QUOTACTL(9).  The implementation may then indicate to the caller
whether it needed to unbusy the mount.

Also, add stbool.h to libprocstat modules which #define _KERNEL
before including sys/mount.h.  Otherwise they'll pull in sys/types.h
before defining _KERNEL and therefore won't have the bool definition
they need for mp_busy.

Reviewed By:	kib, markj
Differential Revision: https://reviews.freebsd.org/D30556
2021-05-30 14:53:47 -07:00
Sean Eric Fagan
505dc43562 The zone(9) man page had two entries for uma_reclaim(), one with
an argument (correct), and one without (incorrect).  Pointed out
by Allan Jude.
2021-05-30 13:02:11 -07:00
Mateusz Guzik
284cf3f18b ext2: add missing uio_td initialization to ext2_htree_append_block
Reported by:	pho
2021-05-30 17:19:31 +00:00
Lutz Donnerhacke
b03a41befe libalias: Fix nameing and initialization of a constant
The commit 189f8eea contains a refactorisation of a constant.  During
later review D30283 the naming of the constant was improved and the
initialization became explicit.  Put this into the tree, in order to
MFC the correct naming.
2021-05-30 15:47:29 +02:00
Gordon Bergling
66e2a5803b iwn(4): Remove duplicate device entry
'Intel Centrino Wireless-N 6250' is listed twice in the description
section of the manual page.

PR:	256257
Reported by:	Daniel Cervus <danielthedeer at outlook dot com>
MFC after:	3 days
2021-05-30 15:40:33 +02:00
Alexander V. Chernikov
8e55a80e0c [netflow] fix gateway reporting in ng_netflow
Reported by:	Guy Yur <guyyur at gmail.com>
MFC after:	3 days
2021-05-30 10:12:49 +00:00
Justin Hibbits
2b9a828c99 Set default SPE FP environment 2021-05-29 21:53:35 -05:00
Justin Hibbits
66b2b71df8 Wrap the default SPE config in its own #define
No functional change.  Cleans up the code a little.
2021-05-29 21:53:26 -05:00
Justin Hibbits
0137a09d6e Clean up spr.h
Remove SPRs for CPUs FreeBSD doesn't run on
Add debug register SPRs from the Freescale EREF
2021-05-29 21:53:16 -05:00
Jason A. Harmening
271fcf1c28 Revert commits 6d3e78ad6c and 54256e7954
Parts of libprocstat like to pretend they're kernel components for the
sake of including mount.h, and including sys/types.h in the _KERNEL
case doesn't fix the build for some reason.  Revert both the
VFS_QUOTACTL() change and the follow-up "fix" for now.
2021-05-29 17:48:02 -07:00
Mateusz Guzik
331a7601c9 tmpfs: save on common case relocking in tmpfs_reclaim 2021-05-29 22:04:10 +00:00
Mateusz Guzik
439d942b9e tmpfs: drop a redundant NULL check in tmpfs_alloc_vp 2021-05-29 22:04:10 +00:00
Mateusz Guzik
7fbeaf33b8 tmpfs: drop useless parent locking from tmpfs_dir_getdotdotdent
The id field is immutable until the node gets freed.
2021-05-29 22:04:10 +00:00
Mateusz Guzik
3cf75ca220 vfs: retire unused vn_seqc_write_begin_unheld* 2021-05-29 22:04:09 +00:00
Mateusz Guzik
d81aefa8b7 vfs: use the sentinel trick in locked lookup path parsing 2021-05-29 22:04:09 +00:00
Mateusz Guzik
478c52f1e3 vfs: slightly rework vn_rlimit_fsize 2021-05-29 22:04:09 +00:00
Mateusz Guzik
dde5c031ed Fix up macro use in lim_cur 2021-05-29 22:04:09 +00:00
Mateusz Guzik
9bfddb3ac4 fd: use PROC_WAIT_UNLOCKED when clearing p_fd/p_pd 2021-05-29 22:04:09 +00:00
Mateusz Guzik
528f8f3895 proc: add PROC_WAIT_UNLOCKED 2021-05-29 22:04:09 +00:00