Commit Graph

270590 Commits

Author SHA1 Message Date
Kristof Provost
93a3fa41dc pfsync: fix defer timeout
Don't use a fixed number of ticks, but take hz into account so we have a
consistent timeout, regardless of what hz is set up.
Use a 20ms timeout, becaues that's what OpenBSD uses.

Reviewed by:	glebius
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D33242
2021-12-06 13:25:14 +01:00
Kristof Provost
7b02a551f7 pfsync: check IFF_DRV_RUNNING in the correct field
This flag is stored in if_drv_flags, not if_flags.

Reviewed by:	glebius
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D33241
2021-12-06 13:25:14 +01:00
Kristof Provost
27bd812c5c pfsync: NULL check sc before using it
In pfsync_defer() we must wait to lock sc until we've ensured it's not
NULL.

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D33240
2021-12-06 13:25:13 +01:00
Baptiste Daroussin
f499134dd4 bsddialog: import snapshot 2021-12-05 2021-12-06 11:43:34 +01:00
Kristof Provost
c59900ee61 ObsoleteFiles: Don't remove if_stf.h
19dc644511 added if_stf.h, which had previously been removed.

We have to remove it from ObsoleteFiles.inc to ensure that it's not
unintentionally uninstalled again.

Reported by:	Herbert J. Skuhra <herbert@gojira.at>
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D33247
2021-12-06 11:37:49 +01:00
Baptiste Daroussin
1b308d0631 bsddialog: vendor import 2021-12-05 2021-12-06 11:35:28 +01:00
Emmanuel Vadot
ca23e9d2ac fb: Add new FBTYPE_EFIFB
Currently the type isn't set in the fbtype struct so any userland
program that call the FBIOGTYPE ioctl will think it's a FBTYPE_SUN1BW
which is far from the truth.
No app that I found find checks the type but at least now it's correct.

Reviewed by:	emaste, tsoome
MFC after:	2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33221
2021-12-06 11:28:03 +01:00
Emmanuel Vadot
706f32db8a fb: Remove some unused ioctls
6d1699583d added the FBIOGXINFO,FBIOMONINFO and FBIOPUTCMAPI/FBIOGETCMAPI
ioctls and said that implementation in driver will come later.
Since it was in 2001 I think we can remove this.

Reviewed by:	emaste, imp, tsoome
MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33218
Differential Revision:	https://reviews.freebsd.org/D33219
Differential Revision:	https://reviews.freebsd.org/D33220
2021-12-06 11:28:01 +01:00
Emmanuel Vadot
b9d3b253e2 fb: Remove unused cursors ioctls
The cursors related ioctls were added in 1994 with the 4.4 Lite import
but were never implemented in either sc(4), fb(4) or vt(4).
Remove it.

Reviewed by:	emaste, tsoome
MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33217
2021-12-06 11:27:59 +01:00
Emmanuel Vadot
87fae70dc5 fb: Remove unused FBIOVERTICAL ioctl
Commit 6d1699583d added the FBIOVERTICAL ioctl and said that implementation
in driver will come later.
Since it was in 2001 I think we can remove this.

MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
2021-12-06 11:27:55 +01:00
Emmanuel Vadot
26542b33a4 fb: Remove unused FBIOSVIDEO/FBIOGVIDEO ioctls
The FBIOSVIDEO/FBIOGVIDEO ioctls were added in 1994 with the 4.4 Lite import
but were never implemented in either sc(4), fb(4) or vt(4).
Remove it.

Reviewed by:	emaste, tsoome
MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33216
2021-12-06 11:27:53 +01:00
Emmanuel Vadot
f1105fb8f7 fb: Remove unused FBIOSATTR/FBIOGATTR ioctls
The FBIOSATTR/FBIOGATTR ioctls were added in 1994 with the 4.4 Lite import
but were never implemented in either sc(4), fb(4) or vt(4).
Remove it.

Reviewed by:	emaste, tsoome
MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33215
2021-12-06 11:27:51 +01:00
Emmanuel Vadot
95744d84b1 fb: Remove unused code
The FBIOGINFO ioctl was added in 1994 with the 4.4 Lite import but was commented.
Remove it.

Reviewed by:	emaste
MFC after:      2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33211
2021-12-06 11:27:49 +01:00
Andriy Gapon
9c612a5d0a vmxnet3: skip zero-length descriptor in the middle of a packet
Passing up such descriptors to iflib is obviously wasteful.
But the main conern is that we may overrun iri_frags array because of
them.  That's been observed in practice.

Also, assert that the number of fragments / descriptors / segments is
less than IFLIB_MAX_RX_SEGS.

Reviewed by:	gallatin, pkelsey
MFC after:	3 weeks
Sponsored by:	Panzura LLC
Differential Revision:	https://reviews.freebsd.org/D33189
2021-12-06 10:00:30 +02:00
Andreas Wetzel
cd6f0b4769 rtwn/usb: add product ID for Asus USB N10 Nano Rev. B1
According to information found on the internet the following products
use exactly the same hardware but probably different USB IDs:
- Edimax EW-7811Un V2 (v2)
- Edimax EW-7811GLN 2.0A (v2)
I am not adding them as I cannot verify.

PR:		254280
MFC after:	1 week
2021-12-06 09:43:26 +02:00
Warner Losh
1d92e81fa4 cam/iosched: fix off by one error
Set the bucket size to be SBT_1US/50000 + 1 to be the first number >
20us. I had this uncommitted in my three when I pushed 2283206935
since kern.cam.iosched.bucket_base_us was reporting 19us.

Fixes:		2283206935
Sponsored by:	Netflix
2021-12-05 23:00:01 -07:00
Warner Losh
2283206935 cam-iosched: Publish parameters of the latency buckets
Add sysctls to publish the latency bucket size, number, and stride. Move
to putting all the iosched stuff under kern.cam.iosched as well and move
kern.cam.do_dynamic_iosched to kern.cam.iosched.dynamic. In addition, move
kern.cam.io_sched_alpha_bits to kern.cam.iosched.alpha_bits. Publish
kern.cam.iosched.bucket_base (the smallest bucket time), .bucket_ratio
(the geometric progression factor * 100), and .buckets (the total number
of buckets).

Move to publishing 20 buckets, starting at 20us. This allows us to get
better resolution on the short end and detect preformance degredation of
the NVMe drives I've tested on, even with the uncertainty of bucketing.

Sponsored by:		Netflix
2021-12-05 22:19:07 -07:00
Warner Losh
4de76195ce sysctl: Small style fix
Slightly reorder to make this look better. No functional change.

Sponsored by:		Netflix
2021-12-05 21:40:47 -07:00
Alan Cox
4c57d6d555 amd64/pmap: fix user page table page accounting
When a superpage mapping is destroyed and the original page table page
containing 4KB mappings that was being held in reserve is deallocated,
the recently introduced user page table page count was not being
decremented.  Consequentially, the count was wrong and would grow over
time.  For example, after multiple iterations of "buildworld", I was
seeing implausible counts, like the following:

vm.pmap.kernel_pt_page_count: 2184
vm.pmap.user_pt_page_count: 2280849
vm.pmap.pv_page_count: 106

With this change, I now see:

vm.pmap.kernel_pt_page_count: 2183
vm.pmap.user_pt_page_count: 344
vm.pmap.pv_page_count: 105

Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D33276
2021-12-05 19:13:43 -06:00
Doug Moore
9f32cb5b1c Set uninitialized popmap bits in vm_reserv_init
In vm_reserv_init, set all the marker popmap bits in vm_reserv_init,
and not just the bits of the first popmap entry.

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D33258
2021-12-05 17:17:25 -06:00
Scott Long
95d35d7a0e Fix "set but not used" in kern_cpu.c
Sponsored by: Rubicon Communications, LLC ("Netgate")
2021-12-05 15:33:04 -07:00
Scott Long
4d54d1b7fd Fix "set but not used" in opencrypto, with a correction for the previous
commit.

Sponsored by: Rubicon Communications, LLC ("Netgate")
2021-12-05 15:30:36 -07:00
Scott Long
5a052b6114 Fix "set but not used" in opencrypto
Sponsored by: Rubicon Communications, LLC ("Netgate")
2021-12-05 15:25:44 -07:00
Scott Long
14c912c60d FIx "set but not used" in the isp driver.
Sponsored by: Rubicon Communications, LLC ("Netgate")
2021-12-05 15:19:56 -07:00
Scott Long
cc557faf86 Fix "set but not used" in cardbus
Sponsored by: Rubicon Communications, LLC ("Netgate")
2021-12-05 15:14:35 -07:00
Scott Long
c0ea0b4989 Fix "set but not used" in the x86 pci driver.
Sponsored by: Rubicon Communications, LLC ("Netgate")
2021-12-05 15:10:16 -07:00
Stefan Eßer
5e04571cf3 sys/bitset.h: reduce visibility of BIT_* macros
Add two underscore characters "__" to names of BIT_* and BITSET_*
macros to move them to the implementation name space and to prevent
a name space pollution due to BIT_* macros in 3rd party programs with
conflicting parameter signatures.

These prefixed macro names are used in kernel header files to define
macros in e.g. sched.h, sys/cpuset.h and sys/domainset.h.

If C programs are built with either -D_KERNEL (automatically passed
when building a kernel or kernel modules) or -D_WANT_FREENBSD_BITSET
(or this macros is defined in the source code before including the
bitset macros), then all macros are made visible with their previous
names, too. E.g., both __BIT_SET() and BIT_SET() are visible with
either of _KERNEL or _WANT_FREEBSD_BITSET defined.

The main reason for this change is that some 3rd party sources
including sched.h have been found to contain conflicting BIT_*
macros.

As a work-around, parts of shed.h have been made conditional and
depend on _WITH_CPU_SET_T being set when sched.h is included.
Ports that expect the full functionality provided by sched.h need
to be built with -D_WITH_CPU_SET_T. But this leads to conflicts if
BIT_* macros are defined in that program, too.

This patch set makes all of sched.h visible again without this
parameter being passed and without any name space pollution due
to BIT_* macros becoming visible when sched.h is included.

This patch set will be backported to the STABLE branches, but ports
will need to use -D_WITH_CPU_SET_T as long as there are supported
releases that do not contain these patches.

Reviewed by:	kib, markj
MFC after:	1 month
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D33235
2021-12-05 23:00:25 +01:00
Adrian Chadd
288a92252b ahci: Add Intel Comet Lake RAID/RST controller PCI ID
This is needed on my ASUS motherboard / Intel Comet Lake i5-10500
desktop machine.

This with some work arounds for nvme behind the RST controller
boots and works.

Reviewed by: cognet
2021-12-05 21:28:39 +00:00
Gleb Smirnoff
eb93b99d69 in_pcb: delay crfree() down into UMA dtor
inpcb lookups, which check inp_cred, work with pcbs that potentially went
through in_pcbfree().  So inp_cred should stay valid until SMR guarantees
its invisibility to lookups.

While here, put the whole inpcb destruction sequence of in_pcbfree(),
inpcb_dtor() and inpcb_fini() sequentially.

Submitted by:		markj
Differential revision:	https://reviews.freebsd.org/D33273
2021-12-05 10:46:37 -08:00
Gleb Smirnoff
2cb67bd798 uma: remove unused *item argument from cache_free()
Reviewed by:		markj
Differential revision:	https://reviews.freebsd.org/D33272
2021-12-05 10:44:47 -08:00
Dimitry Andric
a9cd5c30d6 Apply fix for clang crashing on invalid -Wa,-march= values
Merge commit df08b2fe8b35 from llvm git (by Dimitry Andric):

  [AArch64] Avoid crashing on invalid -Wa,-march= values

  As reported in https://bugs.freebsd.org/260078, the gnutls Makefiles
  pass -Wa,-march=all to compile a number of assembly files. Clang does
  not support this -march value, but because of a mistake in handling
  the arguments, an unitialized Arg pointer is dereferenced, which can
  cause a segfault.

  Work around this by adding a check if the local WaMArch variable is
  initialized, and if so, using its value in the diagnostic message.

  Reviewed By: tschuett

  Differential Revision: https://reviews.llvm.org/D114677

PR:		260078
Reported by:	bz
MFC after:	3 days
2021-12-05 18:54:13 +01:00
Mark Johnston
b25ba58adc ng_ubt: Avoid attaching to several newer Intel controllers
Like other Intel controllers, these require firmware to be loaded, and
generic ng_ubt attach causes them to lock up until a power cycle.
However, their firmware interface for querying version info and loading
operational firmware is different from that implemented by ng_ubt_intel
and iwmbtfw, so they are not usable yet.  Just disable attach for now to
avoid stalls during USB device enumeration.

PR:		260161
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-12-05 10:51:46 -05:00
Mark Johnston
39a7396f5d vm_page: Tighten the object lock assertion in vm_page_invalid()
A page must not become invalid while vm_fault_soft_fast() is attempting
to map unbusied pages for reading.

Note that all callers hold the object write lock already, and
vm_page_set_invalid() asserts the object write lock.

Reviewed by:	kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33250
2021-12-05 10:51:11 -05:00
Mitchell Horne
03b3d7bbec x86: remove unused T_USER flag
It stopped being used in 3c256f5395, when trap() was reorganized to
have separate switch statements for user and kernel traps. Remove the
two leftover references and the flag itself.

Reviewed by:	kib
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D33253
2021-12-05 11:12:40 -04:00
Mitchell Horne
d99a40e5ba Remove riscv workaround in sys.netgraph.hub.loop test
The test case now passes on this architecture. This reverts commits
d5fd5cdc06 and 168b579a48.

Reviewed by:	lwhsu, imp
Differential Revision:	https://reviews.freebsd.org/D33252
2021-12-05 11:12:40 -04:00
Gordon Bergling
f9af3151fa Revert "ffs(3): Fix a typo in a sysctl description"
It should be

- s/contigous/contiguous/ not continuous

Reported by:	tuexen@

This reverts commit 42efe994ec.
2021-12-05 13:45:47 +01:00
Peter Holm
e86b5a6234 stress2: This test runs for hours with ASLR enabled 2021-12-05 05:43:29 +00:00
Alexander Motin
a07d426509 x86: Make AMD elvtX dump more compact.
MFC after:	2 weeks
2021-12-04 21:47:19 -05:00
Rick Macklem
2d90ef4714 nfsd: Fix Verify for attributes like FilesAvail
When the Verify operation calls nfsv4_loadattr(), it provides
the "struct statfs" information that can be used for doing a
compare for FilesAvail, FilesFree, FilesTotal, SpaceAvail,
SpaceFree and SpaceTotal.  However, the code erroneously
used the "struct nfsstatfs *" argument that is NULL.
This patch fixes these cases to use the correct argument
structure.  For the case of FilesAvail, the code in
nfsv4_fillattr() was factored out into a separate function
called nfsv4_filesavail(), so that it can be called from
nfsv4_loadattr() as well as nfsv4_fillattr().

In fact, most of the code in nfsv4_filesavail() is old
OpenBSD code that does not build/run on FreeBSD, but I
left it in place, in case it is of some use someday.

I am not aware of any extant NFSv4 client that does Verify
on these attributes.

Reported by:	rtm@lcs.mit.edu
Tested by:	rtm@lcs.mit.edu
PR:	260176
MFC after:	2 weeks
2021-12-04 14:38:55 -08:00
Rick Macklem
480be96e1e nfsd: Sanity check the Layouttype count
Reported by:	rtm@lcs.mit.edu
Tested by:	rtm@lcs.mit.edu
PR:	260155
MFC after:	2 weeks
2021-12-04 14:22:19 -08:00
Konstantin Belousov
1aa249c935 swapoff(8): add -f flag
to force swapout by ignoring the heuristic that calculates amount of
allocated memory against total of RAM plus remaining swap.

Reviewed by:	markj
Discussed with:	alc
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33165
2021-12-05 00:20:58 +02:00
Konstantin Belousov
79d650f262 swapoff(2): document extended syscall arguments
Reviewed by:	markj
Discussed with:	alc
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33165
2021-12-05 00:20:58 +02:00
Konstantin Belousov
e8dc2ba29c swapoff(2): add a SWAPOFF_FORCE flag
The flag requests skipping the heuristic which tries to avoid leaving
system with more allocated memory than available from RAM and remanining
swap.

Reviewed by:	markj
Discussed with:	alc
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33165
2021-12-05 00:20:58 +02:00
Konstantin Belousov
a4e4132fa3 swapoff(2): replace special device name argument with a structure
For compatibility, add a placeholder pointer to the start of the
added struct swapoff_new_args, and use it to distinguish old vs. new
style of syscall invocation.

Reviewed by:	markj
Discussed with:	alc
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33165
2021-12-05 00:20:58 +02:00
Konstantin Belousov
6df359449f swap_pager.c: Remove MPSAFE and ARGSUSED annotations
Reviewed by:	markj
Discussed with:	alc
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33165
2021-12-05 00:20:58 +02:00
Ed Maste
fc073e6743 Move _p.a profiling archives under MK_INSTALLLIB
_p.a are just a special case of .a archives, and should not be installed
if WITHOUT_INSTALLLIB is set.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2021-12-04 16:32:26 -05:00
Florian Walpen
bf2fa8d9d1 MAC/priority module for realtime privilege group
This is a MAC policy module that grants scheduling privileges based on
group membership.  Users or processes in the group realtime (gid 47) are
allowed to run threads and processes with realtime scheduling priority.
For timing-sensitive, low-latency software like audio/jack, running with
realtime priority helps to avoid stutter and gaps.

PR:	239125
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D33191
2021-12-04 20:19:25 +02:00
Michael Tuexen
54912d47b6 sctp: unbreak NOINET6 builds.
PR:		260119
Reported by:	kostikbel
MFC after:	1 week
2021-12-04 19:16:18 +01:00
Scott Long
f25d575762 Fix "set but not used" for hptmv
Sponsored by: Rubicon Communications, LLC ("Netgate")
2021-12-04 11:07:04 -07:00
Scott Long
dcf4745271 Fix "set but not used" for hptiop
Sponsored by: Rubicon Communications, LLC ("Netgate")
2021-12-04 11:07:04 -07:00