]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agob_vflags update requries bufobj lock
Konstantin Belousov [Tue, 13 Apr 2021 10:22:56 +0000 (13:22 +0300)]
b_vflags update requries bufobj lock

(cherry picked from commit e3d675958539eee899d42438f5b46a26f3c64902)

3 years agorealtimer_expire: avoid proc lock recursion when called from itimer_proc_continue()
Konstantin Belousov [Tue, 13 Apr 2021 13:47:24 +0000 (16:47 +0300)]
realtimer_expire: avoid proc lock recursion when called from itimer_proc_continue()

(cherry picked from commit 5cc1d199412ead0b4c234e21e881a31ef893a4f0)

3 years agofilt_timerexpire: avoid process lock recursion
Konstantin Belousov [Tue, 13 Apr 2021 14:25:11 +0000 (17:25 +0300)]
filt_timerexpire: avoid process lock recursion

(cherry picked from commit 75c5cf7a720f5a73f17aff60adbc4a7b2fa86f84)

3 years agoStop arming kqueue timers on knote owner suspend or terminate
Konstantin Belousov [Fri, 5 Mar 2021 23:29:08 +0000 (01:29 +0200)]
Stop arming kqueue timers on knote owner suspend or terminate

(cherry picked from commit 2fd1ffefaa4d2cd99a19f866a949cb2cd58ef998)

3 years agoAdd helper for kqueue timers callout scheduling
Konstantin Belousov [Fri, 5 Mar 2021 23:31:20 +0000 (01:31 +0200)]
Add helper for kqueue timers callout scheduling

(cherry picked from commit 533e5057ed2503013643bf8450588e4aa58c2b7e)

3 years agoStop arming realtime posix process timers on suspend or terminate
Konstantin Belousov [Thu, 11 Mar 2021 08:16:51 +0000 (10:16 +0200)]
Stop arming realtime posix process timers on suspend or terminate

(cherry picked from commit 4d27d8d2f3b8ae4ef3efc86b220c7ff2dbdbac5a)

3 years agoStop arming periodic process timers on suspend or terminate
Konstantin Belousov [Fri, 5 Mar 2021 21:19:35 +0000 (23:19 +0200)]
Stop arming periodic process timers on suspend or terminate

(cherry picked from commit dc47fdf1319f18be1aadbcdef17c721a83415d84)

3 years agopseudofs: limit writes to 1M
Konstantin Belousov [Tue, 13 Apr 2021 19:48:44 +0000 (22:48 +0300)]
pseudofs: limit writes to 1M

(cherry picked from commit 5edf7227ec339f651c7328e63df323f6ef10345f)

3 years agosbuf_uionew(): sbuf_new() takes int as length
Konstantin Belousov [Tue, 13 Apr 2021 19:12:19 +0000 (22:12 +0300)]
sbuf_uionew(): sbuf_new() takes int as length

(cherry picked from commit 116f26f947b8bbf868dcd85d79226406029a45ee)

3 years agonfs client: depend on xdr
Konstantin Belousov [Tue, 13 Apr 2021 11:47:20 +0000 (14:47 +0300)]
nfs client: depend on xdr

(cherry picked from commit 8cca7b7f28feaf0c5e2dfedb985ae334a4013ef6)

3 years agolink(2): correct descriptor name in AT_RESOLVE_BENEATH description
Konstantin Belousov [Tue, 30 Mar 2021 21:56:28 +0000 (00:56 +0300)]
link(2): correct descriptor name in AT_RESOLVE_BENEATH description

(cherry picked from commit c78e124535febc6c0bc7c0756b42d6b845428d2e)

3 years agoptrace: restructure comments around reparenting on PT_DETACH
Konstantin Belousov [Sun, 11 Apr 2021 09:06:21 +0000 (12:06 +0300)]
ptrace: restructure comments around reparenting on PT_DETACH

(cherry picked from commit a091c353235e0ee97d2531e80d9d64e1648350f4)

3 years agoptrace: remove dead call to FIX_SSTEP()
Konstantin Belousov [Sun, 11 Apr 2021 09:02:34 +0000 (12:02 +0300)]
ptrace: remove dead call to FIX_SSTEP()

(cherry picked from commit 9d7e450b64f1e605c718fba0f357d49541c8147b)

3 years agoamd64 linux64: use x86_clear_dbregs()
Konstantin Belousov [Fri, 9 Apr 2021 23:22:48 +0000 (02:22 +0300)]
amd64 linux64: use x86_clear_dbregs()

(cherry picked from commit 2f1588474768f61f3a983af207e753bd0340a9e7)

3 years agox86: use x86_clear_dbregs() on fork
Konstantin Belousov [Fri, 9 Apr 2021 23:20:55 +0000 (02:20 +0300)]
x86: use x86_clear_dbregs() on fork

(cherry picked from commit 290b0d123ae2136ad84b268cd1884b1624d1d37f)

3 years agoamd64: clear debug registers on execing 32bit native binary
Konstantin Belousov [Fri, 9 Apr 2021 23:23:54 +0000 (02:23 +0300)]
amd64: clear debug registers on execing 32bit native binary

(cherry picked from commit d50adfec9ee73e88e8d365525f1acef2c1db798a)

3 years agoamd64: clear debug registers on execing 32bit Linux binary
Konstantin Belousov [Fri, 9 Apr 2021 23:25:06 +0000 (02:25 +0300)]
amd64: clear debug registers on execing 32bit Linux binary

(cherry picked from commit 94172affa43af15fe3b50293a96c292eca30c386)

3 years agox86: add x86_clear_dbregs() helper
Konstantin Belousov [Fri, 9 Apr 2021 23:19:23 +0000 (02:19 +0300)]
x86: add x86_clear_dbregs() helper

(cherry picked from commit a8b75a57c9b2cb3388746f097a55086a0f8c5d38)

3 years agortld_lock.h: add some comments about versioning of struct RtldLockInfo
Konstantin Belousov [Sun, 11 Apr 2021 08:12:48 +0000 (11:12 +0300)]
rtld_lock.h: add some comments about versioning of struct RtldLockInfo

(cherry picked from commit 9b33518ada2ebda727ca3c7979cdcdb30716f737)

3 years agortld: make dlerror() thread-local
Konstantin Belousov [Wed, 7 Apr 2021 22:02:33 +0000 (01:02 +0300)]
rtld: make dlerror() thread-local

(cherry picked from commit 4d9128da54f8f8e2a29190ffb18880c4f116a205)

3 years agortld: workaround for broken ABI
Konstantin Belousov [Sat, 10 Apr 2021 12:32:24 +0000 (15:32 +0300)]
rtld: workaround for broken ABI

(cherry picked from commit 08bfbd43594b7642de0d2487550f36b0ee1eceba)

3 years agortld: unstaticise lockinfo and obj_from_addr()
Konstantin Belousov [Sat, 10 Apr 2021 12:30:59 +0000 (15:30 +0300)]
rtld: unstaticise lockinfo and obj_from_addr()

(cherry picked from commit 4d7f08c84bcfcd75ba23b06e07a8e5dba1d4a44f)

3 years agortld: use _get_tp() in __tls_get_addr()
Konstantin Belousov [Wed, 7 Apr 2021 03:49:28 +0000 (06:49 +0300)]
rtld: use _get_tp() in __tls_get_addr()

(cherry picked from commit e8b9c508b7ae5be618ada089103468c400e465cd)

3 years agortld: avoid recursing on rtld_bind_lock for write
Konstantin Belousov [Tue, 6 Apr 2021 19:02:23 +0000 (22:02 +0300)]
rtld: avoid recursing on rtld_bind_lock for write

(cherry picked from commit 7cb32a0d03437f881169b1c55cce89cf70ed43dd)

3 years agortld: allow to use tls_get_addr_slow() from context where rtld_bind_lock is locked
Konstantin Belousov [Tue, 6 Apr 2021 18:56:58 +0000 (21:56 +0300)]
rtld: allow to use tls_get_addr_slow() from context where rtld_bind_lock is locked

(cherry picked from commit 89508048424837ffdb32c8444dab02261711f77d)

3 years agortld: style tls_get_addr_slow
Konstantin Belousov [Tue, 6 Apr 2021 18:55:10 +0000 (21:55 +0300)]
rtld: style tls_get_addr_slow

(cherry picked from commit 85d846b369f4d8c0033993d3d1307779d3b9aa62)

3 years agolibc dl_iterate_phdr(): dlpi_tls_data is wrong
Konstantin Belousov [Mon, 5 Apr 2021 03:38:07 +0000 (06:38 +0300)]
libc dl_iterate_phdr(): dlpi_tls_data is wrong

(cherry picked from commit dbd2053026a6af28adb1aa32e27603ae0d4efea6)

3 years agolibc: implement __tls_get_addr() for static binaries
Konstantin Belousov [Mon, 5 Apr 2021 03:29:47 +0000 (06:29 +0300)]
libc: implement __tls_get_addr() for static binaries

(cherry picked from commit ca46b5698e8ac38ab45d781d592700be59e7de97)

3 years agolibc: add _get_tp() private function
Konstantin Belousov [Mon, 5 Apr 2021 03:30:35 +0000 (06:30 +0300)]
libc: add _get_tp() private function

(cherry picked from commit 06d8a116bd6b6f70b8aedc6a6a2c4085c53f63ac)

3 years agortld: define TLS_DTV_OFFSET on all architectures
Konstantin Belousov [Wed, 7 Apr 2021 06:25:34 +0000 (09:25 +0300)]
rtld: define TLS_DTV_OFFSET on all architectures

(cherry picked from commit 99c2ce7ef12f0852f25155d1d6718beccafbae0e)

3 years agolibc: include rtld.h into static implementations of rtld interface
Konstantin Belousov [Mon, 5 Apr 2021 03:41:46 +0000 (06:41 +0300)]
libc: include rtld.h into static implementations of rtld interface

(cherry picked from commit 7f7489eba391a858b3930a34e7749d642b374c5c)

3 years agolibc: constify dummy error message string for dlfcn
Konstantin Belousov [Mon, 5 Apr 2021 04:14:39 +0000 (07:14 +0300)]
libc: constify dummy error message string for dlfcn

(cherry picked from commit 93c14c55ec0da311dc09c1c8c1c7ecd5f2fae51a)

3 years agortld_lock.h: Expand scope for IN_RTLD to avoid some conflicts with libc
Konstantin Belousov [Mon, 5 Apr 2021 04:12:22 +0000 (07:12 +0300)]
rtld_lock.h: Expand scope for IN_RTLD to avoid some conflicts with libc

(cherry picked from commit 34ca6025ddfea9899024eb6e7617091c5bc5149a)

3 years agortld/x86/reloc.c: style
Konstantin Belousov [Wed, 7 Apr 2021 06:12:10 +0000 (09:12 +0300)]
rtld/x86/reloc.c: style

(cherry picked from commit f61ecf60cfce6172df803a9e5e099aab2d4aedcd)

3 years agortld_lock.h: remove tautological extern's
Konstantin Belousov [Mon, 5 Apr 2021 04:11:49 +0000 (07:11 +0300)]
rtld_lock.h: remove tautological extern's

(cherry picked from commit 38e0610df7d5cd5ddd43a477c139ec6ce342c5c2)

3 years agortld dl_iterate_phdr(): dlpi_tls_data is wrong
Konstantin Belousov [Mon, 5 Apr 2021 03:05:44 +0000 (06:05 +0300)]
rtld dl_iterate_phdr(): dlpi_tls_data is wrong

(cherry picked from commit d36d6816151705907393889d661cbfd25c630ca8)

3 years agolinuxkpi: remove erronously committed diff save file
Konstantin Belousov [Tue, 6 Apr 2021 00:42:13 +0000 (03:42 +0300)]
linuxkpi: remove erronously committed diff save file

(cherry picked from commit 5b3b19db7305f8255f021d6f8d94d17ab778660f)

3 years agolinuxkpi: drop single-use variable
Konstantin Belousov [Tue, 30 Mar 2021 08:46:42 +0000 (11:46 +0300)]
linuxkpi: drop single-use variable

(cherry picked from commit 8011fb795baa59ba14371d6db5ab661a5db77615)

3 years agolinuxkpi: avoid counting per-thread use for the embedded linux cdevs
Konstantin Belousov [Tue, 30 Mar 2021 08:45:24 +0000 (11:45 +0300)]
linuxkpi: avoid counting per-thread use for the embedded linux cdevs

(cherry picked from commit f6b108837e7df7d7bfb35ec447f7cb62afa79441)

3 years agolinuxkpi: do not destroy/free embedded linux cdevs
Konstantin Belousov [Tue, 30 Mar 2021 08:44:19 +0000 (11:44 +0300)]
linuxkpi: do not destroy/free embedded linux cdevs

(cherry picked from commit 7f9867f8c65b1b3e590dba4dc432a4bc8cf01f68)

3 years agolinuxkpi: rename cdev to ldev
Konstantin Belousov [Tue, 30 Mar 2021 08:43:21 +0000 (11:43 +0300)]
linuxkpi: rename cdev to ldev

(cherry picked from commit 28b482e2baf43cdd30e8b9bd090e6d9f405cf4b3)

3 years agolinuxkpi: copy ldev into local to test and free the same pointer
Konstantin Belousov [Tue, 30 Mar 2021 08:41:00 +0000 (11:41 +0300)]
linuxkpi: copy ldev into local to test and free the same pointer

(cherry picked from commit 7b0125cbec1579a0a1bf38f7abe583b5f6fd79e7)

3 years agoFix leak in libc NFSv4 ACL flags parsing
Andrew Walker [Tue, 20 Apr 2021 19:34:44 +0000 (15:34 -0400)]
Fix leak in libc NFSv4 ACL flags parsing

Free memory allocated by strdup() in parse_flags_verbose().

Submitted by: Andrew Walker <walker.aj325_gmail.com>
Reported by: valgrind
Reviewed by: allanjude, freqlabs, rpokala
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D29871

(cherry picked from commit dd559118ab3f065ae230b324c3fe4bb1c9b7ca56)

3 years agotcp: Deal with DSACKs, and adjust rescue hole on success.
Richard Scheffenegger [Tue, 20 Apr 2021 12:53:56 +0000 (14:53 +0200)]
tcp: Deal with DSACKs, and adjust rescue hole on success.

When a rescue retransmission is successful, rather than
inserting new holes to the left of it, adjust the old
rescue entry to cover the missed sequence space.

Also, as snd_fack may be stale by that point, pull it forward
in order to never create a hole left of snd_una/th_ack.

Finally, with DSACKs, tcp_sack_doack() may be called
with new full ACKs but a DSACK block. Account for this
eventuality properly to keep sacked_bytes >= 0.

MFC after: 3 days
Reviewed By: kbowling, tuexen, #transport
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D29835

(cherry picked from commit a649f1f6fd7a098ab173a69fe87916c04a8c6f8d)

3 years agotcp: keep SACK scoreboard sorted when doing rescue retransmission
Richard Scheffenegger [Sun, 18 Apr 2021 20:14:14 +0000 (22:14 +0200)]
tcp: keep SACK scoreboard sorted when doing rescue retransmission

Reviewed By: tuexen, kbowling, #transport
MFC after: 3 days
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D29825

(cherry picked from commit b87cf2bc841b2a336b7f0c6cd89573610412a84f)

3 years agopms(4): Limit maximum I/O size to 256KB instead of 1MB.
Alexander Motin [Fri, 16 Apr 2021 19:39:01 +0000 (15:39 -0400)]
pms(4): Limit maximum I/O size to 256KB instead of 1MB.

There is a weird limit of AGTIAPI_MAX_DMA_SEGS (128) S/G segments per
I/O since the initial driver import.  I don't know why it was added,
can only guess some hardware limitation, but in worst case it means
maximum I/O size of 508KB.  Respect it to be safe, rounding to 256KB.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

(cherry picked from commit 3e347834200b5d91a33384e696793e4ac20a44d4)

3 years agopms(4): Do not return CAM_REQ_CMP on errors.
Alexander Motin [Fri, 16 Apr 2021 19:16:09 +0000 (15:16 -0400)]
pms(4): Do not return CAM_REQ_CMP on errors.

It is a direct request for data corruptions, one report of which we
have received.  I am very surprised that only one.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

(cherry picked from commit 8434a65ce49bd6bc6779f0e57b0ce0f4bc46f48e)

3 years agorack: Fix ECN on finalizing session.
Richard Scheffenegger [Sat, 17 Apr 2021 18:16:06 +0000 (20:16 +0200)]
rack: Fix ECN on finalizing session.

Maintain code similarity between RACK and base stack
for ECN. This may not strictly be necessary, depending
when a state transition to FIN_WAIT_1 is done in RACK
after a shutdown() or close() syscall.

MFC after: 3 days
Reviewed By: tuexen, #transport
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D29658

(cherry picked from commit 2e97826052d169f6e2e1d2f87b086f56d1cf2b0b)

3 years agotcp: Prepare PRR to work with NewReno LossRecovery
Richard Scheffenegger [Thu, 8 Apr 2021 16:52:20 +0000 (18:52 +0200)]
tcp: Prepare PRR to work with NewReno LossRecovery

Add proper PRR vnet declarations for consistency.
Also add pointer to tcpopt struct to tcp_do_prr_ack, in preparation
for it to deal with non-SACK window reduction (after loss).

No functional change.

MFC after: 2 weeks
Reviewed By: tuexen, #transport
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D29440

(cherry picked from commit 90cca08e91f54214747af0419c988aba868398ed)

3 years agotcp: Use PRR for ECN congestion recovery
Richard Scheffenegger [Fri, 26 Mar 2021 01:05:22 +0000 (02:05 +0100)]
tcp: Use PRR for ECN congestion recovery

MFC after: 2 weeks
Reviewed By: #transport, rrs
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D28972

(cherry picked from commit b9f803b7d4b7ee3799ab94f66c02c3b6e58c153a)

3 years agotcp: Refactor PRR code
Richard Scheffenegger [Thu, 25 Mar 2021 22:58:46 +0000 (23:58 +0100)]
tcp: Refactor PRR code

No functional change intended.

MFC after: 2 weeks
Reviewed By: #transport, rrs
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D29411

(cherry picked from commit eb3a59a83112f5fcd60aab44ac0ac68331b6aedf)

3 years agostats.7: Add dwatch(1) to the list
Fernando Apesteguía [Thu, 22 Apr 2021 13:54:45 +0000 (15:54 +0200)]
stats.7: Add dwatch(1) to the list

PR: 255303
Approved by: 0mp (mentor)
Differential Revision: https://reviews.freebsd.org/D29924

(cherry picked from commit 2e5929a75634504d388cc04d24e6a558840e18cb)

3 years agozfs: merge openzfs/zfs@3522f57b6 (master)
Martin Matuska [Wed, 14 Apr 2021 10:49:10 +0000 (12:49 +0200)]
zfs: merge openzfs/zfs@3522f57b6 (master)

Notable upstream pull request merges:
  #11742 When specifying raidz vdev name, parity count should match
  #11744 Use a helper function to clarify gang block size
  #11771 Support running FreeBSD buildworld on Arm-based macOS hosts

This is the last update that will be MFCed into stable/13.

From now on, the tracking of OpenZFS branches will be different:
- main continues tracking openzfs/zfs/master
- stable/13 is going to track openzfs/zfs/zfs-2.1-release

Obtained from: OpenZFS

(cherry picked from commit 6db169e920810bf1d7e9bd2fad5da92bfb696677)

3 years agopowerpc64: add missing TLB invalidations to radix
Leandro Lupori [Tue, 6 Apr 2021 11:31:44 +0000 (08:31 -0300)]
powerpc64: add missing TLB invalidations to radix

Radix MMU code was missing TLB invalidations when some Level 3 PDEs were
modified. This caused TLB multi-hit machine check interrupts when
superpages were enabled.

Reviewed by: jhibbits
Sponsored by: Eldorado Research Institute (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D29511

(cherry picked from commit 28d14569c8735060d0a1646a3422562c0741ac44)

3 years agopowerpc64: clear low-order bits of ARPN
Leandro Lupori [Thu, 25 Mar 2021 16:30:56 +0000 (13:30 -0300)]
powerpc64: clear low-order bits of ARPN

PowerISA 2.07B says that the low-order p-12 bits of the real page number
contained in ARPN and LP fields of a PTE must be 0s and are ignored
by the hardware (Book III-S, 5.7.7.1), where 2^p is the actual page size
in bytes, but we were clearing only the LP field.

This worked on bare metal and QEMU with KVM, that ignore these bits,
but caused a kernel panic on QEMU with TCG, that expects them to be
cleared.

This fixes running FreeBSD with HPT superpages enabled on QEMU
with TCG.

Sponsored by: Eldorado Research Institute (eldorado.org.br)

(cherry picked from commit 3d0399c718b260da087d28825069f26d4f670065)

3 years agonfsd: fix replies from session cache for retried RPCs
Rick Macklem [Thu, 8 Apr 2021 21:04:22 +0000 (14:04 -0700)]
nfsd: fix replies from session cache for retried RPCs

Recent testing of network partitioning a FreeBSD NFSv4.1
server from a Linux NFSv4.1 client identified problems
with both the FreeBSD server and Linux client.

The FreeBSD server failec to reply using the cached
reply in the session slot when an RPC was retried on
the session slot, as indicated by same slot sequence#.

This patch fixes this.  It should also fix a similar
failure for NFSv4.0 mounts, when the sequence# in
the open/lock_owner requires a reply be done from
an entry locked into the DRC.

This fix affects the fairly rare case where a NFSv4
client retries a non-idempotent RPC, such as a lock
operation.  Note that retries only occur after the
client has needed to create a new TCP connection.

(cherry picked from commit 05a39c2c1c18cd0c4382a4f58e0952d3f77e7dfa)

3 years agoAllow lib/msun/logarithm_test to pass on ld128 platforms
Alex Richardson [Mon, 19 Apr 2021 23:22:45 +0000 (00:22 +0100)]
Allow lib/msun/logarithm_test to pass on ld128 platforms

For some reason the ld128 log1pl() implementation is less accurate than
logl(), but does at least guarantee precision >= the ld80 implementation.
Mark log1p_accuracy_tests as XFAIL for ld128 and increase the log1p tolerance
to the ld80 equivalent in accuracy_tests to avoid losing test coverage for
the other functions.

PR: 253984
Reviewed By: ngie, dim
Differential Revision: https://reviews.freebsd.org/D29039

(cherry picked from commit 1ad83445fc0f1d2aecd32635f4ae713a057aa091)

3 years agoRemove XFAIL from tests/lib/msun/lround_test:main
Alex Richardson [Thu, 15 Apr 2021 15:07:58 +0000 (16:07 +0100)]
Remove XFAIL from tests/lib/msun/lround_test:main

This test no longer fails after 3b00222f156dca5700c839d73e36daf479fa640c.

PR: 205451
MFC after: 1 week

(cherry picked from commit 062293c2c471c6affb46f0ba44e7b7ee5b77b591)

3 years agoRemove amd64 XFAIL from tests/lib/msun/fma_test:infinities
Alex Richardson [Thu, 15 Apr 2021 15:04:19 +0000 (16:04 +0100)]
Remove amd64 XFAIL from tests/lib/msun/fma_test:infinities

This test no longer fails after 3b00222f156dca5700c839d73e36daf479fa640c.

PR: 205448
MFC after: 1 week

(cherry picked from commit 3f01d8c2fe5d31866258c9872f35030d98828e48)

3 years agolib/msun: Exclude ignored-pragmas from -Werror
Alex Richardson [Thu, 15 Apr 2021 15:27:52 +0000 (16:27 +0100)]
lib/msun: Exclude ignored-pragmas from -Werror

This avoids build failures due to the clang 12 warning:
    '#pragma FENV_ACCESS' is not supported on this target - ignored

Clang 12 currently emits this warning for all non-x86 architectures.
While this can result in incorrect code generation (e.g. on AArch64 some
exceptions are not raised as expected), this is a pre-existing issue and
we should not fail the build due to this warning.

Reviewed By: dim, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29743

(cherry picked from commit 168234fa67c38f898b784b3265dd77ace0b0a2f9)

3 years agolib/msun/tests: Drop WARNS=6
Alex Richardson [Mon, 22 Mar 2021 16:56:10 +0000 (16:56 +0000)]
lib/msun/tests: Drop WARNS=6

This is the default already, so there is no need to override it.

Reported by: kevans

(cherry picked from commit f33b4fa2f0d4acf3978c7490b25c999b319c543b)

3 years agolib/msun/tests: Re-enable csqrt_test on AArch64
Alex Richardson [Mon, 22 Mar 2021 16:54:38 +0000 (16:54 +0000)]
lib/msun/tests: Re-enable csqrt_test on AArch64

The LLVM bug was fixed a long time ago and with D29076 this test actually
passes now.

Reviewed By: andrew
Differential Revision: https://reviews.freebsd.org/D29092

(cherry picked from commit dbb2d6f5e1231a9f6b49efdc720ce97b520da2ba)

3 years agoFix lib/msun/tests/csqrt_test on platforms with 128-bit long double
Alex Richardson [Mon, 22 Mar 2021 16:54:02 +0000 (16:54 +0000)]
Fix lib/msun/tests/csqrt_test on platforms with 128-bit long double

If long double has more than 64 mantissa bits, using uint64_t to hold the
mantissa bits will truncate the value and result in test failures. To fix
this problem use __uint128_t since all platforms that have
__LDBL_MANT_DIG__ > 64 also have compiler support for 128-bit integers.

Reviewed By: rlibby
Differential Revision: https://reviews.freebsd.org/D29076

(cherry picked from commit ce88eb476b86cac63cef7466bd71f14b611ab03a)

3 years agoFix unused functions in invtrig_test.c
Alex Richardson [Mon, 22 Mar 2021 13:05:28 +0000 (13:05 +0000)]
Fix unused functions in invtrig_test.c

I only tested the WARNS=6 change on AArch64 and AMD64, but this file has
unused functions for architectures with LDBL_PREC == 53.

While touching this file change the LDBL_PREC == 53 checks to i386 checks.
The long double tests should only be disabled for i386 (due to the rather
odd rounding mode that it uses) not all architectures where long double
is the same as double.

PR: 205449
Fixes: 87d65c747a43 ("lib/msun: Allow building tests with WARNS=6")
Reported by: Jenkins

(cherry picked from commit 7f5693d05329ab976287b8d449e694e7a0f99e88)

3 years agoDon't add -Winline for WARNS=6
Alex Richardson [Mon, 22 Mar 2021 11:55:45 +0000 (11:55 +0000)]
Don't add -Winline for WARNS=6

This warning is very rarely useful (inline is a hint and not mandatory).
This flag results in many warnings being printed when compiling C++
code that uses the standard library with GCC.

This flag was originally added in back in r94332 but the flag is a no-op
in Clang ("This diagnostic flag exists for GCC compatibility, and has no
effect in Clang"). Removing it should make the GCC build output slightly
more readable.

Reviewed By: jrtc27, imp
Differential Revision: https://reviews.freebsd.org/D29235

(cherry picked from commit c8c62548bffb83f3d25e062929c45d66fea755f1)

3 years agolib/msun/tests: Add more debug output to fenv_test.c
Alex Richardson [Thu, 4 Mar 2021 18:41:06 +0000 (18:41 +0000)]
lib/msun/tests: Add more debug output to fenv_test.c

Output a hex dump of the current fenv and the expected value to allow
comparing them without having to resort to interactive use of GDB.

(cherry picked from commit 6ccdee8ab576577224fb9e4baed05bd0efe933fd)

3 years agolib/msun/tests: Skip fenv_test:masking if exceptions can't be trapped
Alex Richardson [Mon, 22 Mar 2021 11:53:40 +0000 (11:53 +0000)]
lib/msun/tests: Skip fenv_test:masking if exceptions can't be trapped

Some CPUs (e.g. AArch64 QEMU) cannot trap on floating point exceptions and
therefore ignore the writes to the floating point control register inside
feenableexcept(). If no exceptions are enabled after
feenableexcept(FE_ALL_EXCEPT), we can assume that the CPU does not
support exceptions and we can then skip the test.

Reviewed By: dim
Differential Revision: https://reviews.freebsd.org/D29095

(cherry picked from commit 2b9dbcd390dfbd573d3403360a36c5ade9815266)

3 years agolib/msun: Allow building tests with WARNS=6
Alex Richardson [Thu, 25 Feb 2021 14:28:17 +0000 (14:28 +0000)]
lib/msun: Allow building tests with WARNS=6

The only change needed is to mark a few variables as static.

(cherry picked from commit 87d65c747a4389901c2bbbcb1ec4878b2df7b32c)

3 years agoImprove test messages for msun tests
Alex Richardson [Mon, 22 Mar 2021 11:42:07 +0000 (11:42 +0000)]
Improve test messages for msun tests

Also print the mismatched values when numbers compare not equal.

Reviewed By: dim
Differential Revision: https://reviews.freebsd.org/D29091

(cherry picked from commit b424e0038a00dffbec800a6f0778db0ffdabe9d6)

3 years agoRemove XFAILs from fmaxmin test
Alex Richardson [Mon, 22 Mar 2021 11:40:17 +0000 (11:40 +0000)]
Remove XFAILs from fmaxmin test

These appears to have been resolved by compiling the test with -fno-builtin
and/or using a newer compiler.

PR: 208703
Reviewed By: ngie
Differential Revision: https://reviews.freebsd.org/D28884

(cherry picked from commit b358534ab1a953fac5830012751232e2f0807cc0)

3 years agoConvert the msun tests to ATF
Alex Richardson [Mon, 22 Mar 2021 11:15:13 +0000 (11:15 +0000)]
Convert the msun tests to ATF

This provides better error messages that just an assertion failure and
also makes it easier to mark individual tests as XFAIL.
It was also helpful when coming up with D28786 and D28787.

Differential Revision: https://reviews.freebsd.org/D28798

(cherry picked from commit 133bc645077d77ddb3c7d49130b4ec6fd93e7d34)

3 years agolib/msun: Fix x86 GCC6 build after 221622ec0c8e184
Alex Richardson [Fri, 12 Mar 2021 18:44:42 +0000 (18:44 +0000)]
lib/msun: Fix x86 GCC6 build after 221622ec0c8e184

Apparently GCC only supports arithmetic expressions that use static
const variables in initializers starting with GCC8. To keep older
versions happy use a macro instead.

Fixes: 221622ec0c ("lib/msun: Avoid FE_INEXACT for x86 log2l/log10l")
Reported by: Jenkins
Reviewed By: imp
Differential Revision: https://reviews.freebsd.org/D29233

(cherry picked from commit 05eac56a0432d07acd7f159125855437a4dd6259)

3 years agolib/msun: Avoid FE_INEXACT for x86 log2l/log10l
Alex Richardson [Mon, 8 Mar 2021 09:39:29 +0000 (09:39 +0000)]
lib/msun: Avoid FE_INEXACT for x86 log2l/log10l

This fixes tests/lib/msun/logarithm_test after compiling the test with
-fno-builtin (D28577). Adding invln10_lo + invln10_10 results in
FE_INEXACT (for all inputs) and the same for the log2l invln2_lo + invln2_hi.
This patch avoids FE_INEXACT (for exact results such as 0) by defining a
constant and using that.

Reviewed By: dim
Differential Revision: https://reviews.freebsd.org/D28786

(cherry picked from commit 221622ec0c8e184dd1ea7e1f77fb45d2d32cb6e2)

3 years agoAllow ssp_test:read to pass more reliably
Alex Richardson [Mon, 1 Mar 2021 19:50:38 +0000 (19:50 +0000)]
Allow ssp_test:read to pass more reliably

It appears that the stackframe layout can be slightly different depending on
compiler and target architecture. For example, when using CHERI LLVM for RISC-V
we can actually overflow the buffer by up to 8 bytes without SSP detecting it.
Fix this by increasing the overflow to 15 bytes.

Reviewed By: ngie, emaste
Differential Revision: https://reviews.freebsd.org/D28997

(cherry picked from commit c88c1f23a8989b881a5ca51223289ddb4ce74277)

3 years agos_scalbn.c: Add missing float.h include
Alex Richardson [Mon, 1 Mar 2021 14:10:24 +0000 (14:10 +0000)]
s_scalbn.c: Add missing float.h include

This caused LDBL_MANT_DIG to not be defined and therefore the scalbnl
alias was not being emitted for double==long double platforms.

Fixes: 760b2ffc ("Update scalbn* functions to the musl versions")
Reported by: Jenkins

(cherry picked from commit f5542795b99206a2b4e5a57429d18b9478264e24)

3 years agoAlso use the musl scalbn code for ldexp()
Alex Richardson [Thu, 25 Feb 2021 14:29:44 +0000 (14:29 +0000)]
Also use the musl scalbn code for ldexp()

Instead of copying the code as 00646ca2047305fce32d99edc7a8e6dfd801f3b4
did, include the implementation with the function name re-defined.

(cherry picked from commit aac21e66f94e0a8ad52c1f8cd8dce50fcdd35cca)

3 years agoUpdate scalbn* functions to the musl versions
Alex Richardson [Wed, 24 Feb 2021 16:56:53 +0000 (16:56 +0000)]
Update scalbn* functions to the musl versions

The only diff compared to musl is a minor change to scalbnl() to replace
musl's union ldshape with union IEEEl2bits.
This fixes the scalbn tests on non-x86 (since x86 has an assembly version
that is used instead).

Musl commit messages:
commit 8c44a060243f04283ca68dad199aab90336141db
Author: Szabolcs Nagy <nsz@port70.net>
Date:   Mon Apr 3 02:38:13 2017 +0200

    fix scalbn when result is in the subnormal range

    in nearest rounding mode scalbn could introduce double rounding error
    when an intermediate value and the final result were both in the
    subnormal range e.g.

      scalbn(0x1.7ffffffffffffp-1, -1073)

    returned 0x1p-1073 instead of 0x1p-1074, because the intermediate
    computation got rounded to 0x1.8p-1023.

    with the fix an intermediate value can only be in the subnormal range
    if the final result is 0 which is correct even after double rounding.
    (there still can be two roundings so signals may be raised twice, but
    that's only observable with trapping exceptions which is not supported.)

commit 2eaed464e2080d8321d3903b71086a1ecfc4ee4a
Author: Szabolcs Nagy <nsz@port70.net>
Date:   Wed Sep 4 15:52:54 2013 +0000

    math: use float_t and double_t in scalbnf and scalbn

    remove STRICT_ASSIGN (c99 semantics is assumed) and use the conventional
    union to prepare the scaling factor (so libm.h is no longer needed)

commit 1b77b9072f374bd26eb0574b83a0d5f18d75ec60
Author: Szabolcs Nagy <nsz@port70.net>
Date:   Thu Aug 15 10:07:46 2013 +0000

    math: minor scalbn*.c simplification

commit c4359e01303da2755fe7e8033826b132eb3659b1
Author: Szabolcs Nagy <nsz@port70.net>
Date:   Tue Nov 13 10:55:35 2012 +0100

    math: excess precision fix modf, modff, scalbn, scalbnf

    old code was correct only if the result was stored (without the
    excess precision) or musl was compiled with -ffloat-store.
    now we use STRICT_ASSIGN to work around the issue.
    (see note 160 in c11 section 6.8.6.4)

commit 666271c105e4137bdfa195e217799d74143370d4
Author: Szabolcs Nagy <nsz@port70.net>
Date:   Tue Nov 13 10:30:40 2012 +0100

    math: fix scalbn and scalbnf on overflow/underflow

    old code was correct only if the result was stored (without the
    excess precision) or musl was compiled with -ffloat-store.
    (see note 160 in n1570.pdf section 6.8.6.4)

commit 8051e08e10d2b739fcfcbc6bc7466e8d77fa49f1
Author: nsz <nsz@port70.net>
Date:   Mon Mar 19 10:54:07 2012 +0100

    simplify scalbn*.c implementations

    The old scalbn.c was wrong and slow, the new one is just slow.
    (scalbn(0x1p+1023,-2097) should give 0x1p-1074, but the old code gave 0)

Reviewed By: dim
Differential Revision: https://reviews.freebsd.org/D28872

(cherry picked from commit 760b2ffc552985017c5bc74fb9966d4dc1b5b691)

3 years agolib/msun/ctrig_test: Print the mismatched values on failure
Alex Richardson [Tue, 23 Feb 2021 09:38:57 +0000 (09:38 +0000)]
lib/msun/ctrig_test: Print the mismatched values on failure

This test fails on aarch64 but debugging it is difficult without the
results being printed.

Now the failing AArch64 test prints:
root@freebsd-aarch64:/nfsroot/usr/tests/lib/msun # kyua debug ctrig_test:test_nan_inputs
*** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: (ctan)(_d) (0 + -1 I) != expected (-0 + -1 I)
*** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: ctan fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0
*** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: (ctan)(_d) (0 + 1 I) != expected (-0 + 1 I)
*** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: ctan fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0
*** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: (ctanf)(_d) (0 + -1 I) != expected (-0 + -1 I)
*** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: ctanf fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0
*** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: (ctanf)(_d) (0 + 1 I) != expected (-0 + 1 I)
*** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: ctanf fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0
*** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: (ctanh)(_d) (1 + 0 I) != expected (1 + -0 I)
*** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: ctanh fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0
*** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: (ctanhf)(_d) (1 + 0 I) != expected (1 + -0 I)
*** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: ctanhf fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0
*** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: (ctanh)(_d) (-1 + 0 I) != expected (-1 + -0 I)
*** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: ctanh fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0
*** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: (ctanhf)(_d) (-1 + 0 I) != expected (-1 + -0 I)
*** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: ctanhf fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0
ctrig_test:test_nan_inputs  ->  failed: 16 checks failed; see output for more details

Reviewed By: ngie
Differential Revision: https://reviews.freebsd.org/D28788

(cherry picked from commit f3f7b0dc065ce30f29b221788c58079d78931a77)

3 years agoUpdate libm tests from NetBSD
Alex Richardson [Mon, 22 Feb 2021 17:19:06 +0000 (17:19 +0000)]
Update libm tests from NetBSD

I did this without a full vendor update since that would cause too many
conflicts. Since these files now almost match the NetBSD sources the
next git subtree merge should work just fine.

Reviewed By: lwhsu
Differential Revision: https://reviews.freebsd.org/D28797

(cherry picked from commit 1ec3feb64826d2a43d41e74684690985bf20e71c)

3 years agodu_test: Skip three tests if sparse files are not supported
Alex Richardson [Wed, 3 Feb 2021 16:07:05 +0000 (16:07 +0000)]
du_test: Skip three tests if sparse files are not supported

This fixes running the du tests with /tmp as tmpfs (which is what we do in the
CheriBSD CI).

Obtained from: CheriBSD
Reviewed By: ngie
Differential Revision: https://reviews.freebsd.org/D28398

(cherry picked from commit 39a1f858ad735ef816a9b1fb7eeade2c6802eb98)

3 years agosbin/bectl: Skip tests if sparse files are not supported
Alex Richardson [Wed, 3 Feb 2021 09:31:32 +0000 (09:31 +0000)]
sbin/bectl: Skip tests if sparse files are not supported

The tests create a 1GB test file and this causes the tests to fail in the
CheriBSD CI setup where we run tests with a tmpfs mount on /tmp. Tmpfs
does not support sparse files and it appears that tmpfs default to creating
a 1GB mount, so there is not enough space to run these tests.

Instead of checking for at least 1GB of free space, this commit skips the
tests on file systems that do not support sparse files.

Reviewed By: kevans
Differential Revision: https://reviews.freebsd.org/D28463

(cherry picked from commit d6f4e1a8973daff2ffe4480b66c973562982ffc7)

3 years agoFix build with read-only source dir after 83c20b8a2da0
Alex Richardson [Wed, 3 Feb 2021 09:29:08 +0000 (09:29 +0000)]
Fix build with read-only source dir after 83c20b8a2da0

I changed the Makefile to use SRCS instead of LDADD, but since there is
still and absolute path to the source the .o file was created inside the
source directory instead of the build directory.
It would be nice if this was an error/warning by default, but for now just
fix this issue by using .PATH and the base name of the file.

Reported by: cy, peterj

(cherry picked from commit 8b820df156e065f48857dca89a89462074659e14)

3 years agotests/sys/kern/crc32: Check for SSE4.2 before using it
Alex Richardson [Tue, 2 Feb 2021 09:52:52 +0000 (09:52 +0000)]
tests/sys/kern/crc32: Check for SSE4.2 before using it

This avoids a SIGILL when running these tests on QEMU (which
defaults to a basic amd64 CPU without SSE4.2).

This commit also tests the table-based implementations in addition to
testing the hw-accelerated crc32 versions.

Reviewed By: cem, kib, markj
Differential Revision: https://reviews.freebsd.org/D28395

(cherry picked from commit 83c20b8a2da04937cf4af127366b3dc92c855784)

3 years agoAvoid double output in fenv_test
Alex Richardson [Fri, 29 Jan 2021 09:29:26 +0000 (09:29 +0000)]
Avoid double output in fenv_test

This tests fork()s, so if there is still data in the stdout buffer on fork
it will print it again in the child process. This was happening in the
CheriBSD CI and caused the test to complain about malformed TAP output.

Reviewed By: ngie
Differential Revision: https://reviews.freebsd.org/D28397

(cherry picked from commit 892a05ee3a6abd8d84f46a1b895b1d2bf805d08a)

3 years agoImprove size readability.
Michael Reifenberger [Mon, 15 Feb 2021 19:23:32 +0000 (20:23 +0100)]
Improve size readability.
Preserve more space for swap devise names.
Prevent line overflow with long devise name.
Don't draw a bar when swap is not used at all.
Simplify and optimize code.
Change the label to end at end of 100%.
PR: 251655
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D27496

(cherry picked from commit 8d06c3e7a40831ac139d83b85b282206229b426f)

3 years agogdb: report specific stop reason for watchpoints
Mitchell Horne [Mon, 8 Mar 2021 19:04:51 +0000 (15:04 -0400)]
gdb: report specific stop reason for watchpoints

The remote protocol allows for implementations to report more specific
reasons for the break in execution back to the client [1]. This is
entirely optional, so it is only implemented for amd64, arm64, and i386
at the moment.

[1] https://sourceware.org/gdb/current/onlinedocs/gdb/Stop-Reply-Packets.html

Reviewed by: jhb
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
NetApp PR: 51

(cherry picked from commit 7446b0888d920124516284eaa32714d63353e2c9)

3 years agogdb: allow setting/removing hardware watchpoints
Mitchell Horne [Mon, 8 Mar 2021 19:03:45 +0000 (15:03 -0400)]
gdb: allow setting/removing hardware watchpoints

Handle the 'z' and 'Z' remote packets for manipulating hardware
watchpoints.

This could be expanded quite easily to support hardware or software
breakpoints as well.

https://sourceware.org/gdb/onlinedocs/gdb/Packets.html

Reviewed by: cem, markj
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
NetApp PR: 51

(cherry picked from commit 4beb385813c8b1014f8250a31b07fdc09a059713)

3 years agoddb: replace watchpoint set/clear functions
Mitchell Horne [Mon, 8 Mar 2021 15:27:19 +0000 (11:27 -0400)]
ddb: replace watchpoint set/clear functions

Use the new kdb variants. Print more specific error messages.

Reviewed by: jhb, markj
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.

(cherry picked from commit 9d81dd5404b3ad7108059d7065814d56a722a96c)

3 years agoarm: implement kdb watchpoint functions
Mitchell Horne [Thu, 4 Mar 2021 00:14:42 +0000 (20:14 -0400)]
arm: implement kdb watchpoint functions

Implement wrappers around the existing debug_monitor interface, to be
consumed by MI kernel debugger code.

For now, the various db_printf() calls in this code remain. In the
future, they could be converted to printf() or removed altogether, to
properly decouple the DDB and GDB options.

Reviewed by: jhb, kib, markj
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.

(cherry picked from commit 5a2933d0bf9fb0018349b67a39fa85cbb3740779)

3 years agoarm64: implement kdb watchpoint functions
Mitchell Horne [Thu, 4 Mar 2021 21:53:21 +0000 (17:53 -0400)]
arm64: implement kdb watchpoint functions

Add wrappers around the debug_monitor interface, to be consumed by MI
kernel debugger code.  Update dbg_setup_watchpoint() and
dbg_remove_watchpoint() to return specific error codes, not just -1.

Reviewed by: jhb, kib, markj
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.

(cherry picked from commit 3ef68bc62c1e3ca9c452177f5cb9fd4de0df590d)

3 years agox86: implement kdb watchpoint functions
Mitchell Horne [Fri, 19 Feb 2021 22:36:08 +0000 (18:36 -0400)]
x86: implement kdb watchpoint functions

Add wrappers around the dbreg interface that can be consumed by MI
kernel debugger code. The dbreg functions themselves are updated to
return error codes, not just -1. dbreg_set_watchpoint() is extended to
accept access bits as an argument.

Reviewed by: jhb, kib, markj
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.

(cherry picked from commit 15dc1d44528a1e2693df41d5452d6ebb42ecafeb)

3 years agoIntroduce kdb-level watchpoint functions
Mitchell Horne [Mon, 8 Mar 2021 15:23:40 +0000 (11:23 -0400)]
Introduce kdb-level watchpoint functions

This basically mirrors what already exists in ddb, but provides a
slightly improved interface. It allows the caller to specify the
watchpoint access type, and returns more specific error codes to
differentiate failure cases.

This will be used to support hardware watchpoints in gdb(4).

Stubs are provided for architectures lacking hardware watchpoint logic
(mips, powerpc, riscv), while other architectures are added individually
in follow-up commits.

Reviewed by: jhb, kib, markj
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.

(cherry picked from commit 763107f26c3c3f4c8bb314a7cabc0a5548abff03)

3 years agox86: consolidate hw watchpoint logic into new file
Mitchell Horne [Fri, 19 Mar 2021 19:39:12 +0000 (16:39 -0300)]
x86: consolidate hw watchpoint logic into new file

This is a prerequisite to using these functions outside of ddb, but also
provides some cleanup and minor refactoring. This code is almost
entirely duplicated between the two implementations, the only
significant difference being the lack of dbreg synchronization on i386.

Cleanups are:
 - demote some internal functions to static
 - use the constant NDBREGS instead of a '4' literal
 - remove K&R definitions
 - some added comments

Reviewed by: kib, jhb
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.

(cherry picked from commit c02c04f113fe65001bc21363ae3ad08cf6c763eb)

3 years agospigen.4: Fix typos
Mateusz Piotrowski [Sun, 18 Apr 2021 07:45:18 +0000 (09:45 +0200)]
spigen.4: Fix typos

MFC after: 3 days

(cherry picked from commit 40277af7f23405c276edf02c3ddc8e770a06e3f6)

3 years agoRemove reference to the pfctlinput2() from domain(9) after 237c1f932b.
Dmitry Chagin [Tue, 13 Apr 2021 21:40:20 +0000 (00:40 +0300)]
Remove reference to the pfctlinput2() from domain(9) after 237c1f932b.

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D29751

(cherry picked from commit 86887853c39b0803009579e2b927bd67d524af63)

3 years agoEnable GitHub actions CI for stable/13 as well
Alex Richardson [Tue, 20 Apr 2021 08:50:36 +0000 (09:50 +0100)]
Enable GitHub actions CI for stable/13 as well

All cross-building patches have been merged to stable/13 so it should
also build fine on macOS+Linux.

Reviewed By: uqs
MFC after: immediately
Differential Revision: https://reviews.freebsd.org/D29831

(cherry picked from commit 6bc0bb2936a41674bc992887ba17fddfa928ac90)

3 years agoExplain the newfs naming convention
Mateusz Piotrowski [Wed, 20 Jan 2021 10:40:20 +0000 (11:40 +0100)]
Explain the newfs naming convention

It might be unclear why newfs and newfs_msdos should cross-reference
each other. Add a note explaining it.

This is a follow-up to 74bd20769706041108a573601cf0b61c755bdc56.

Reported by: kib
Reviewed by:    imp, kib, rpokala
MFC after: 3 days

(cherry picked from commit 5b9b65e92fb40703038cbcf61feb4616c42e0b6e)

3 years agodevelopment(7): mention the Git mirror list in the manual page
Evgeniy Khramtsov [Fri, 19 Mar 2021 12:52:21 +0000 (20:52 +0800)]
development(7): mention the Git mirror list in the manual page

MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D29234

(cherry picked from commit 8ef03ce6db330fcc20e800c4d15a9f4915c56c43)

3 years agopowerpc/aim: Update timebase directly on resume instead of through platform
Justin Hibbits [Wed, 31 Mar 2021 16:54:27 +0000 (11:54 -0500)]
powerpc/aim: Update timebase directly on resume instead of through platform

This only works on single-CPU G4 systems, and more work is needed for
dual-CPU systems.  That said, platform sleep does not work, and this is
currently only used for PMU-based CPU speed change.

The elimination of the platform_smp_timebase_sync() call is so that the
timebase sync rendezvous can be enhanced to perform better
synchronization, which requires a full rendezvous.  This would be
impossible to do on this single-threaded run.

(cherry picked from commit 921716186f121a2f6a27178cb302415f37412a79)

3 years agopowerpc/powermac: Constrain 'cpu_sleep()' for AIM to mpc745x
Justin Hibbits [Wed, 31 Mar 2021 16:54:11 +0000 (11:54 -0500)]
powerpc/powermac: Constrain 'cpu_sleep()' for AIM to mpc745x

Rename cpu_sleep() to mpc745x_sleep() to denote what it's actually
intended for.  This function is very G4-specific, and will not work on
any other CPU.  This will afterward eliminate a
platform_smp_timebase_sync() call by directly updating the timebase
instead.

(cherry picked from commit b6d8f3b517dec010f3dfad1b33e9945eaa606be5)