dd527633 wulf Jan. 10, 2022, 7:49 p.m.
Required by drm-kmod

Obtained from:	OpenBSD
MFC after:	1 week
312ba38a bz Jan. 10, 2022, 6:08 p.m.
PR:		261078
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
d72e9448 mhorne Jan. 10, 2022, 5:40 p.m.
Add the MD portion required for the gdb stub.

Reviewed by:	jhb (earlier version)
Discussed with:	jrtc27
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D33734
479ef15d imp Jan. 10, 2022, 5:15 p.m.
Remove mips from the list of machines using TLS variant I and reformat
paragraph. No functional change intended.

Sponsored by:		Netflix
1866c766 trasz Jan. 10, 2022, 3:36 p.m.
Sponsored By:	EPSRC
c0ba4c2e kib Jan. 10, 2022, 3:34 p.m.
If child is slow reading from its input, or even completely stops doing
the read, script(1) hangs in write(2) to the pts master waiting until
there is a space in the terminal discipline buffer.  This also stops
handling any outer io, as well as child output.

Work around the problem by making pts master fd non-blocking, and be
prepared for short writes to it.  The data to be written to master is
buffered in the tailq which is processed when select(2) detects that
master is ready for write.

PR:	260938
Reported by:	наб <nabijaczleweli@nabijaczleweli.xyz>
See also:	https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1003095
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33789
ba94a954 eugen Jan. 10, 2022, 3:07 p.m.
MFC after:	1 week
618d49f5 mav Jan. 10, 2022, 2:40 p.m.
I've noticed relations between iflib_timer() vs ixl_admin_timer().
Both scheduled at the same 2Hz rate, but the second is rescheduling
the first each time, so if the first get any slower, it won't be
executed at all.  Revert this until deeper investigation.

This reverts commit 90bc1cf65778aafb1f226c8fe08218cfed5e40b2.
e74c7ffc jrtc27 Jan. 10, 2022, 2:30 p.m.
If a counter more than overflows just as we read it on switch out then,
if using sampling mode, we will negate this small value to give a huge
reload count, and if we later switch back in that context we will
validate that value against pm_reloadcount and panic an INVARIANTS
kernel with:

  panic: [pmc,1470] pmcval outside of expected range cpu=2 ri=16 pmcval=fffff292 pm_reloadcount=10000

or similar. Presumably in a non-INVARIANTS kernel we will instead just
use the provided value as the reload count, which would lead to the
overflow not happing for a very long time (e.g. 78 minutes for a 48-bit
counter incrementing at an averate rate of 1GHz).

Instead, clamp the reload count to 0 (which corresponds precisely to the
value we would compute if it had just overflowed and no more), which
will result in hwpmc using the full original reload count again. This is
the approach used by core for Intel (for both fixed and programmable

As part of this, armv7 and arm64 are made conceptually simpler; rather
than skipping modifying the overflow count for sampling mode counters so
it's always kept as ~0, those special cases are removed so it's always
applicable and the concatentation of it and the hardware counter can
always be viewed as a 64-bit counter, which also makes them look more
like other architectures.

Whilst here, fix an instance of UB (shifting a 1 into the sign bit) for
amd in its sign-extension code.

Reviewed by:	andrew, mhorne, kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D33654
78c347d9 andrew Jan. 10, 2022, 2:08 p.m.
This was pointed out by markj in the review, but I missed it and forgot
to fix before pushing.

Reported by:	markj
Sponsored by:	The FreeBSD Foundation
ed65c80a whu Jan. 10, 2022, 1:32 p.m.
The PF driver might use the OS info for statistical purposes.

MFC after:	2 weeks
Sponsored by:	Microsoft
77402d28 andrew Jan. 10, 2022, 10:51 a.m.
We have 32 instructions in each exception vector on arm64. Previously
only one was used to branch to the handler function. We can split the
start of these functions and move some of the instructions into the

Reviewed by:	kib, markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33751
ae13829d dougm Jan. 10, 2022, 7:17 a.m.
With INVARIANTS defined, have vm_addr_align_ok and vm_addr_bound_ok
panic when passed an alignment/boundary parameter that is not a power
of two.

Reviewed by:	alc
Suggested by:	kib, se
Differential Revision:	https://reviews.freebsd.org/D33725
90bc1cf6 mav Jan. 10, 2022, 1:32 a.m.
While there switch it from hardclock ticks to milliseconds.

MFC after:	2 weeks
cb1f5d11 mav Jan. 10, 2022, 12:25 a.m.
On idle 80-thread system it allows to improve package-level idle state
residency and so power consumption by several percent.

MFC after:	2 weeks