]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
22 months agounbound: Vendor import 1.17.0
Cy Schubert [Sun, 16 Oct 2022 21:04:22 +0000 (14:04 -0700)]
unbound: Vendor import 1.17.0

Reapply 643f9a0581e8aac7eb790ced116474893982982664d318ea98b7 was a
mismerge during fake rebase. Let's reapply it.

Changes include: Added ACL per interface, proxy protocol and bug fixes.

Announcement:   https://nlnetlabs.nl/news/2022/Oct/13/unbound-1.17.0-released/

Merge commit '643f9a0581e8aac7eb790ced1164748939829826' into main

(cherry picked from commit 865f46b255599c4a645e84a4cbb5ea7abdc0e207)

22 months agobhyve: Use the new vm_limit_rights() interface
Mark Johnston [Mon, 24 Oct 2022 21:32:04 +0000 (17:32 -0400)]
bhyve: Use the new vm_limit_rights() interface

This addresses a compiler warning arising from the fact that bhyve
needs to cast away a const qualifier in order to call free().

No functional change intended.

Reviewed by: jhb

(cherry picked from commit fb7ce0a95ef1e796c10def3ed660e487ffb77c75)

22 months agolibvmmapi: Provide an interface for limiting rights on the device fd
Mark Johnston [Mon, 24 Oct 2022 21:31:11 +0000 (17:31 -0400)]
libvmmapi: Provide an interface for limiting rights on the device fd

Currently libvmmapi provides a way to get a list of the allowed ioctls
on the vmm device file, so that bhyve can limit rights on the device
file fd.  The interface is rather strange: it allocates a copy of the
list but returns a const pointer, so the caller has to cast away the
const in order to free it without aggravating the compiler.

As far as I can see, there's no reason to make a copy of the array, but
changing vm_get_ioctls() to not do that would break compatibility.  So
this change just introduces a better interface: move all rights-limiting
logic into libvmmapi.

Any new operations on the fd should be wrapped by libvmmapi, so also
discourage use of vm_get_device_fd().  Currently bhyve uses it only when
limiting rights on the device fd.

No functional change intended.

Reviewed by: jhb

(cherry picked from commit 3e9b4532d174378624e4582637883736f7781851)

22 months agoAdd a description of soft updates journaling to newfs(8).
Kirk McKusick [Fri, 21 Oct 2022 17:56:20 +0000 (10:56 -0700)]
Add a description of soft updates journaling to newfs(8).

PR:           261944
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 0929a153fc5cfe35f7390ab5870a36daed19b0ce)

22 months agoUpdate date in tunefs(8) manual page.
Kirk McKusick [Tue, 16 Aug 2022 23:46:12 +0000 (16:46 -0700)]
Update date in tunefs(8) manual page.

(cherry picked from commit 128b0398a1d420e3cb6ab3a535558ae0a55df04b)

22 months agoAdd a description of soft updates journaling to tunefs(8).
Kirk McKusick [Mon, 15 Aug 2022 20:44:49 +0000 (13:44 -0700)]
Add a description of soft updates journaling to tunefs(8).

Requested by: Graham Perrin
PR:           261944
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 82493ff7007abb5a2d059c74748d2907dafc5395)

22 months agofusefs: After successful F_GETLK, l_whence should be SEEK_SET
Alan Somers [Tue, 11 Oct 2022 23:00:07 +0000 (17:00 -0600)]
fusefs: After successful F_GETLK, l_whence should be SEEK_SET

PR: 266886
Reported by: John Millikin <jmillikin@gmail.com>
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D37014

(cherry picked from commit 3c3b906b54236841d813fd9a01b1e090f39558ea)

22 months agofusefs: during F_GETLK, don't change l_pid if no lock is found
Alan Somers [Fri, 7 Oct 2022 14:46:22 +0000 (08:46 -0600)]
fusefs: during F_GETLK, don't change l_pid if no lock is found

PR: 266885
Submitted by: John Millikin <jmillikin@gmail.com>
Sponsored by: Axcient
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D36905

(cherry picked from commit 46fcf947c6c8db1e1ceb3cbd75b69d1d1e494929)

22 months agointr_event(9): update copyright
Mitchell Horne [Sat, 15 Oct 2022 18:41:45 +0000 (15:41 -0300)]
intr_event(9): update copyright

To reflect my work on the rewrite, which is in-part sponsored by
the FreeBSD Foundation.

I have also included a copyright entry for trhodes@, who wrote the patch
beginning this rewrite in PR 100803.

Reviewed by: imp, jhb, emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36935

(cherry picked from commit 2af741fc53894387b18c97726745d5e508da7b50)

22 months agointr_event(9): update existing function descriptions
Mitchell Horne [Sat, 15 Oct 2022 18:39:27 +0000 (15:39 -0300)]
intr_event(9): update existing function descriptions

Document new arguments and behaviours for these functions as compared to
the old ithread_* versions.

Reviewed by: pauamma
Input from: jhb
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33478

(cherry picked from commit cb9425e21c917732fb16bd14947cba01f26687f3)

22 months agointr_event(9): update top-level description
Mitchell Horne [Sat, 15 Oct 2022 18:38:02 +0000 (15:38 -0300)]
intr_event(9): update top-level description

The ithread has been subsumed by the 'interrupt event' object, so
update the description to reflect this by describing an interrupt event
and its contents. We've also moved on from having a single handler
function to the split filter-and-handler model. Explain the purpose and
constraints of these two types of handlers.

Reviewed by: jhb, pauamma
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33477

(cherry picked from commit dfc91493abc6046fc6cb237e48fd952deee358e0)

22 months agointr_event(9): update the example of swi_add()
Mitchell Horne [Sat, 15 Oct 2022 18:34:44 +0000 (15:34 -0300)]
intr_event(9): update the example of swi_add()

Reviewed by: jhb
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D33476

(cherry picked from commit 0cec1648b43e176b5b3f1be580bf11e41e79f835)

22 months agoithread(9): update functions to current day
Mitchell Horne [Sat, 15 Oct 2022 18:32:09 +0000 (15:32 -0300)]
ithread(9): update functions to current day

The public KPI is now intr_event_**,
 - Convert existing documented functions to their equivalents.
 - Fix up the function arguments
 - Fix up the possible error return values for each
 - Remove ithread_schedule() completely
 - Rename man page to intr_event(9)
 - Update cross-references

Future changes will update the descriptive text for these functions.

PR: 100803
Based on work by: trhodes
Reviewed by: jhb
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33475

(cherry picked from commit 3cdbaee3548a6caa3ab7aca5788775057b1bd1fd)

22 months agoMFV: Restore the ability to process files from stdin immediately.
Xin LI [Thu, 27 Oct 2022 07:12:53 +0000 (00:12 -0700)]
MFV: Restore the ability to process files from stdin immediately.

PR: bin/267221
MFC after: 3 days

(cherry picked from commit 07dfb236c81483c2f08a3976f6d44ce307f4ceaf)

22 months agoocs_fc(4): Fix a typo in an error message
Gordon Bergling [Tue, 25 Oct 2022 10:52:24 +0000 (12:52 +0200)]
ocs_fc(4): Fix a typo in an error message

- s/faild/failed/

(cherry picked from commit dabebd0ba251db53ab38db20a5bcfac65cc05f31)

22 months agofirewire(4): Fix a typo in an error message
Gordon Bergling [Tue, 25 Oct 2022 10:54:15 +0000 (12:54 +0200)]
firewire(4): Fix a typo in an error message

- s/faild/failed/

(cherry picked from commit c03e35accc46a397d4a166545ae57bfc668c7e7f)

22 months agoqlnxe(4): Fix a typo in a source code comment
Gordon Bergling [Wed, 26 Oct 2022 15:27:07 +0000 (17:27 +0200)]
qlnxe(4): Fix a typo in a source code comment

- s/defult/default/

(cherry picked from commit 5daf88ea5efe6af916e71000fd6c2d81c22c8f43)

22 months agosendmail: fix auth with cyrus-sasl-2.1.28
Ed Maste [Tue, 25 Oct 2022 15:53:07 +0000 (11:53 -0400)]
sendmail: fix auth with cyrus-sasl-2.1.28

Apply patch extracted from sendmail-8-17.1.9 snapshot by dinoex@.

PR: 262935
Reviewed by: gshapiro
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37119

(cherry picked from commit c898b54affbaa9fc22c1d1b1de4a175dd250f37e)

22 months agokldxref: handle R_RISCV_64 relocation
Mitchell Horne [Thu, 20 Oct 2022 14:56:01 +0000 (11:56 -0300)]
kldxref: handle R_RISCV_64 relocation

These are emitted in at least two kmods, and kldxref prints a warning.
While here, remove the unneeded local variable 'val'.

Reviewed by: jrtc27, imp, emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37038

(cherry picked from commit fc4c39c54fc240af424ae249b75057d2977ef8f2)

22 months agoriscv: fix relocation handling for R_RISCV_64
Mitchell Horne [Thu, 20 Oct 2022 14:56:59 +0000 (11:56 -0300)]
riscv: fix relocation handling for R_RISCV_64

It requires the addend. In practice this doesn't seem to be a problem,
since relocations of this type are all with an addend of zero.
Obviously, we still want to handle this correctly if that ever changes.

Reviewed by: markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37039

(cherry picked from commit a9b24e4dc28abfe668038e4c053d77b6dd4dce19)

22 months agoriscv: reject CPUs with mmu-type "riscv,none"
Mitchell Horne [Thu, 20 Oct 2022 14:57:43 +0000 (11:57 -0300)]
riscv: reject CPUs with mmu-type "riscv,none"

According to riscv/cpus.yaml in the device-tree docs, this property may
exist but indicate that the CPU does not have an MMU. Detect this
possibility.

Reviewed by: jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36980

(cherry picked from commit 330acb1883242b5362bb6ccf067de253d3549832)

22 months agorun.4: Fix a typo in the DIAGNOSTICS section
Gordon Bergling [Tue, 25 Oct 2022 10:47:29 +0000 (12:47 +0200)]
run.4: Fix a typo in the DIAGNOSTICS section

- s/faild/failed/

(cherry picked from commit 1cc4c2f90f40abcec810adfa4673240c7bc71119)

22 months agonetpfil: Fix two typos in source code comments
Gordon Bergling [Tue, 25 Oct 2022 02:32:59 +0000 (04:32 +0200)]
netpfil: Fix two typos in source code comments

- s/missmatch/mismatch/

(cherry picked from commit 558ec54da33c6cbd321cceb8f035425c4c73a356)

22 months agoCMSG_DATA.3: Fix a typo in the EXAMPLES section
Gordon Bergling [Tue, 25 Oct 2022 10:49:21 +0000 (12:49 +0200)]
CMSG_DATA.3: Fix a typo in the EXAMPLES section

- s/faild/failed/

(cherry picked from commit 31c472b8a6e403e26110c9a379af45fccd6b4177)

22 months agonetmap(4): Fix a typo in a source code comment
Gordon Bergling [Tue, 25 Oct 2022 12:56:25 +0000 (14:56 +0200)]
netmap(4): Fix a typo in a source code comment

- s/microsconds/microseconds/

(cherry picked from commit 8ba2beacfd7c5d8d5a0f590aa9c628c2bbf23761)

22 months agoarcmsr(4): Fix a typo in a source code comment
Gordon Bergling [Tue, 25 Oct 2022 10:57:37 +0000 (12:57 +0200)]
arcmsr(4): Fix a typo in a source code comment

- s/faild/failed/

(cherry picked from commit 24a630de81007a2fcb6a78739b08b5e000501894)

22 months agobsd-family-tree: OpenBSD 7.2 and DragonFly BSD 6.0.1
Sergey A. Osokin [Mon, 24 Oct 2022 14:12:31 +0000 (10:12 -0400)]
bsd-family-tree: OpenBSD 7.2 and DragonFly BSD 6.0.1

Add two releases to the tree.

While I'm here correct DragonFly BSD 6.2.1 position, it's
been released after FreeBSD 12.3.

MFC after: 3 days

(cherry picked from commit 7322a6bcacffcfcbb857a6899525ee51f4525ef9)

22 months agozfs: Fix the build
Mark Johnston [Thu, 27 Oct 2022 12:42:08 +0000 (08:42 -0400)]
zfs: Fix the build

ZFS_ENTER changed between main and stable/13.

This is a direct commit to stable/13.

Fixes: 562c9ac58c76 ("zfs: Fix a pair of bugs in zfs_fhtovp()")
Reported by: Jenkins

22 months agozfs: Fix a pair of bugs in zfs_fhtovp()
Mark Johnston [Mon, 24 Oct 2022 15:55:48 +0000 (11:55 -0400)]
zfs: Fix a pair of bugs in zfs_fhtovp()

This cherry-picks upstream ed566bf1cd0bdbf85e8c63c1c119e3d2ef5db1f6

    - Add a zfs_exit() call in an error path, otherwise a lock is
      leaked.
    - Remove the fid_gen > 1 check.  That appears to be Linux-specific:
      zfsctl_snapdir_fid() sets fid_gen to 0 or 1 depending on whether
      the snapshot directory is mounted.  On FreeBSD it fails, making
      snapshot dirs inaccessible via NFS.

PR: 266236

(cherry picked from commit 6fe0a6c80a1aff14236924eb33e4013aa8c14f91)

22 months agoAdd random VMware device IDs.
Alexander Motin [Thu, 20 Oct 2022 14:19:24 +0000 (10:19 -0400)]
Add random VMware device IDs.

Just to make dmesg look nicer there.

MFC after: 1 week

(cherry picked from commit 2a31a06bf1bb2d328d6672ed91c3e54734684cc0)

22 months agoOpenBSM: fix free() in au_read_rec error case
Ed Maste [Mon, 24 Oct 2022 13:45:59 +0000 (09:45 -0400)]
OpenBSM: fix free() in au_read_rec error case

buf is a char ** and *buf is the allocated buffer.

PR: 267050
Reported by: Robert Morris <rtm@lcs.mit.edu>
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

(cherry picked from commit c61b3f7de9a0a39d2bc78e3e78d148c369e706a5)

22 months agossh: update to OpenSSH 9.1p1
Ed Maste [Wed, 19 Oct 2022 14:27:11 +0000 (10:27 -0400)]
ssh: update to OpenSSH 9.1p1

Release notes are available at https://www.openssh.com/txt/release-9.1

9.1 contains fixes for three minor memory safety problems; these have
lready been merged to the copy of OpenSSH 9.0 that is in the FreeBSD base
system.

Some highlights copied from the release notes:

Potentially-incompatible changes
--------------------------------

 * ssh(1), sshd(8): SetEnv directives in ssh_config and sshd_config
   are now first-match-wins to match other directives. Previously
   if an environment variable was multiply specified the last set
   value would have been used. bz3438

 * ssh-keygen(8): ssh-keygen -A (generate all default host key types)
   will no longer generate DSA keys, as these are insecure and have
   not been used by default for some years.

New features
------------

 * ssh(1), sshd(8): add a RequiredRSASize directive to set a minimum
   RSA key length. Keys below this length will be ignored for user
   authentication and for host authentication in sshd(8).

 * sftp-server(8): add a "users-groups-by-id@openssh.com" extension
   request that allows the client to obtain user/group names that
   correspond to a set of uids/gids.

 * sftp(1): use "users-groups-by-id@openssh.com" sftp-server
   extension (when available) to fill in user/group names for
   directory listings.

 * sftp-server(8): support the "home-directory" extension request
   defined in draft-ietf-secsh-filexfer-extensions-00. This overlaps
   a bit with the existing "expand-path@openssh.com", but some other
   clients support it.

 * ssh-keygen(1), sshd(8): allow certificate validity intervals,
   sshsig verification times and authorized_keys expiry-time options
   to accept dates in the UTC time zone in addition to the default
   of interpreting them in the system time zone. YYYYMMDD and
   YYMMDDHHMM[SS] dates/times will be interpreted as UTC if suffixed
   with a 'Z' character.

   Also allow certificate validity intervals to be specified in raw
   seconds-since-epoch as hex value, e.g. -V 0x1234:0x4567890. This
   is intended for use by regress tests and other tools that call
   ssh-keygen as part of a CA workflow. bz3468

 * sftp(1): allow arguments to the sftp -D option, e.g. sftp -D
   "/usr/libexec/sftp-server -el debug3"

 * ssh-keygen(1): allow the existing -U (use agent) flag to work
   with "-Y sign" operations, where it will be interpreted to require
   that the private keys is hosted in an agent; bz3429

MFC after: 2 weeks
Relnotes: Yes
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 38a52bd3b5cac3da6f7f6eef3dd050e6aa08ebb3)

22 months agokvm_close(3): Check kd->sparse_map != NULL before munmap
Ashish SHUKLA [Tue, 30 Aug 2022 08:18:51 +0000 (08:18 +0000)]
kvm_close(3): Check kd->sparse_map != NULL before munmap

PR: 266113
Reviewed by: markj

(cherry picked from commit e6901a29bc4345f12e9c85426cc2be81045020a6)

22 months agotmpfs: report minimal hole size
Konstantin Belousov [Mon, 17 Oct 2022 17:46:22 +0000 (20:46 +0300)]
tmpfs: report minimal hole size

(cherry picked from commit e9adbcdf2e8000efaca404abcc904eec4eb4ae29)

22 months agotmpfs: implement FIOSEEKDATA and FIOSEEKHOLE
Konstantin Belousov [Mon, 17 Oct 2022 15:26:43 +0000 (18:26 +0300)]
tmpfs: implement FIOSEEKDATA and FIOSEEKHOLE

(cherry picked from commit 85cff1455a8c3422c6ba8a9f895b5d65118f3499)

22 months agoAdd vm_page_any_valid()
Konstantin Belousov [Tue, 18 Oct 2022 09:16:36 +0000 (12:16 +0300)]
Add vm_page_any_valid()

(cherry picked from commit 934bfc128efae7dec678dd52f75a28ac3538384a)

22 months agovn_bmap_seekhole: check that passed offset is non-negative
Konstantin Belousov [Mon, 17 Oct 2022 15:29:38 +0000 (18:29 +0300)]
vn_bmap_seekhole: check that passed offset is non-negative

(cherry picked from commit 33ce1788350612f4143be6837b74f77e29329fd9)

22 months agotmpfs: order include files alphabetically
Konstantin Belousov [Mon, 17 Oct 2022 14:54:57 +0000 (17:54 +0300)]
tmpfs: order include files alphabetically

(cherry picked from commit 8b32cdec9cd55c234e892b48042d61d951196dca)

22 months agotmpfs: change return type of tmpfs_pages_check_avail() to bool
Konstantin Belousov [Mon, 17 Oct 2022 14:25:10 +0000 (17:25 +0300)]
tmpfs: change return type of tmpfs_pages_check_avail() to bool

(cherry picked from commit 7f055843ac50a8c800f7a1b87641bec5919a46a8)

22 months agouma: Never pass cache zones to memguard
Mark Johnston [Wed, 19 Oct 2022 18:27:49 +0000 (14:27 -0400)]
uma: Never pass cache zones to memguard

Items allocated from cache zones cannot usefully be protected by
memguard.

PR: 267151
Reported and tested by: pho

(cherry picked from commit 2dba2288aa364c36c756770ac77590816b15d954)

22 months agolibc: Make elf_aux_info() return an error if AT_USRSTACK* is undefined
Mark Johnston [Tue, 18 Oct 2022 22:11:26 +0000 (18:11 -0400)]
libc: Make elf_aux_info() return an error if AT_USRSTACK* is undefined

Otherwise we do not fall back to sysctls if the auxv entries are not
defined by the kernel.  Arguably this is not a bug since we do not
support newer libc running on an older kernel, but we can be a bit more
gentle for the benefit of Valgrind or any other software which
synthesizes the auxv for virtualization purposes.

Reported by: Paul Floyd <paulf2718@gmail.com>
Reviewed by: brooks, kib

(cherry picked from commit a4ee0edc4a0b3f880463021c7ae1bdcf7112f3d6)

22 months agortld: remove unused macro FPTR_TARGET
Konstantin Belousov [Sat, 22 Oct 2022 02:15:06 +0000 (05:15 +0300)]
rtld: remove unused macro FPTR_TARGET

(cherry picked from commit f585d13dd60bfa0f1dc1f41ba261b9058b105489)

22 months agobsdinstall: use the correct DISTDIR for fetching local distfiles
Kyle Evans [Fri, 14 Oct 2022 05:22:09 +0000 (00:22 -0500)]
bsdinstall: use the correct DISTDIR for fetching local distfiles

fetchmissingdists naturally sets BSDINSTALL_DISTDIR to a directory in
the new filesystem that it can write fetched distfiles to.  As a result,
BSDINSTALL_DISTSITE was incorrectly set to the scratch space on /mnt for
the call to distfetch when grabbing local distfiles, and it would
subsequently fail.

Switch to using the copy of BSDINSTALL_DISTDIR that we stashed off
coming into fetchmissingdists; this one is in-fact set to the path where
the local distfiles are stored.

Patch suggested by jrtc27.

Reported and tested by: Daniel O'Connor <darius dons net au>

(cherry picked from commit 12b92f3ed82aa71c0eba246ce3053ef225724570)

22 months agoriscv: drop a dead declaration
Mitchell Horne [Wed, 12 Oct 2022 20:03:29 +0000 (17:03 -0300)]
riscv: drop a dead declaration

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 6f4c938b2b8e06ffa96432c2735b90fce27fa583)

22 months agogetpagesize(3): cross-reference getpagesizes(3)
Mitchell Horne [Mon, 17 Oct 2022 16:55:10 +0000 (13:55 -0300)]
getpagesize(3): cross-reference getpagesizes(3)

MFC after: 3 days

(cherry picked from commit 4a9b1a146385912510ed1b203cd853a327643625)

22 months agoksched: correct return code for invalid priority
Ali Abdallah [Mon, 17 Oct 2022 18:11:48 +0000 (15:11 -0300)]
ksched: correct return code for invalid priority

By convention, EINVAL is returned when validating arguments, not EPERM.
This matches the documented behaviour of sched_setscheduler(3), and that
of SCHED_OTHER.

PR: 227735
MFC after: 1 week
Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D37021

(cherry picked from commit ba4782022ac840bd20f4e10cb95ca27d2742333a)

22 months agopthread_setschedparam(3): document EPERM return
Mitchell Horne [Mon, 17 Oct 2022 18:11:13 +0000 (15:11 -0300)]
pthread_setschedparam(3): document EPERM return

In kern_sched_setparam(), before setting any parameters, p_cansched() is
called to check that the thread has appropriate privileges.

PR: 175687
Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D37020

(cherry picked from commit 04620006b9116049e9e2f27d74417d2d84dc8d10)

22 months agokern_intr: Check for NULL event in intr_destroy()
Mitchell Horne [Sat, 15 Oct 2022 18:43:53 +0000 (15:43 -0300)]
kern_intr: Check for NULL event in intr_destroy()

It likely won't happen, but is consistent with the other functions of
this KPI.

Reviewed by: imp, jhb
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D33479

(cherry picked from commit 39888ed7a3dca81c5d5c886e699dbcf58953137f)

22 months agossh: remove pre- and post-merge update steps
Ed Maste [Thu, 6 Oct 2022 14:57:41 +0000 (10:57 -0400)]
ssh: remove pre- and post-merge update steps

We no longer use the pre- and post-merge scripts to strip/add RCS tags.
The tags have been removed from main, but persist on older branches.

While here renumber the steps in the update documentation using a more
conventional scheme.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36904

(cherry picked from commit fca7ac55f8db80b5250bd80a83e1368fe0c39ae5)

22 months agoFix LINT build after 368ee2f86a0f4f6
Doug Moore [Mon, 3 Oct 2022 05:15:21 +0000 (00:15 -0500)]
Fix LINT build after 368ee2f86a0f4f6
Reported by: jenkins
Fixes: 368ee2f86a0f4f6

(cherry picked from commit ffbc2a58b13a9239269e661fe23f86c587cc7638)

22 months agorb_tree: let insert search start from next node
Doug Moore [Mon, 3 Oct 2022 03:27:21 +0000 (22:27 -0500)]
rb_tree: let insert search start from next node

When the node to insert in the rb_tree is known to precede or follow a
particular node, new methods RB_INSERT_PREV and RB_INSERT_NEXT,
defined here, allow the search for where to insert the new node begin
with that particular node, rather than at the root, to save a bit of
time.

Using those methods, instead of RB_INSERT, in managing a tree in
iommu_gas.c, saves a little time.

Reviewed by: kib
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D35516

(cherry picked from commit 368ee2f86a0f4f60338472be4bfd3c09ab401f87)

22 months agoinet: Simplify if_multiaddrs iteration.
Alexander Motin [Sat, 8 Oct 2022 17:10:07 +0000 (13:10 -0400)]
inet: Simplify if_multiaddrs iteration.

Similar to 2cd6ad766eb23 for inet6 drop ifma_restart use, creating more
problems than solving.  It is no longer needed after epoch introduction.

While there, add NULL check for ifma_ifp in igmp_change_state(), that
sometimes caused panics on interface destruction.

MFC after: 2 weeks

(cherry picked from commit 1e9482f4331bdce775061bea66ff54a6a79d5245)

22 months agompr(4): Add Aero/Sea devices to supported hardware list
Sreekanth Reddy [Tue, 18 Oct 2022 12:34:13 +0000 (05:34 -0700)]
mpr(4): Add Aero/Sea devices to supported hardware list

Add Aero/Sea devices to supported hardware list in mpr man page.

PR: 267172
MFC after: 3 days

(cherry picked from commit 751ec8af5ea1df5a4eadd1f3e7d76271fcfed0b1)

22 months agorefcount.9: Update refcount_acquire(9) description after a67d540832b8
Ka Ho Ng [Wed, 12 Oct 2022 17:47:59 +0000 (13:47 -0400)]
refcount.9: Update refcount_acquire(9) description after a67d540832b8

MFC after: 3 days
Sponsored by: Juniper Networks, Inc.
Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D36943

(cherry picked from commit 87fa64c569c54c2ec444ada699acde2ada696d97)

22 months agossh: add command to push tag to FREEBSD-upgrade instructions
Ed Maste [Wed, 23 Feb 2022 18:47:28 +0000 (13:47 -0500)]
ssh: add command to push tag to FREEBSD-upgrade instructions

Because it appears `git push --follow-tags` may push extra, undesired
tags document both techniques (pushing the specific vendor/openssh/X.YpZ
tag and pushing all with --follow-tags, using --dry-run first).

Discussed with: imp, lwhsu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33605

(cherry picked from commit ab7d09596958791d20596b16b81a957495e4b370)

22 months agoFix mpr(4) panic during a firmware update.
Kenneth D. Merry [Mon, 17 Oct 2022 16:48:34 +0000 (12:48 -0400)]
Fix mpr(4) panic during a firmware update.

Issue Description:
The RequestCredits field of IOCFacts got changed between the Phase23
firmware to Phase24 firmware. So as part of firmware update operation,
driver has to free the resources & pools which are created with the Phase23
Firmware's IOCFacts data (i.e. during driver load time) and has to
reallocate the resources and pools using Phase24's IOCFacts data. Here
driver has freed the interrupts but missed to reallocate the interrupts and
hence config page read operation is getting timed out and controller is
going for recursive reinit (controller reset) operations and leading to
kernel panic.

Fix:
Reallocate the interrupts if the interrupts are disabled as part of
firmware update/downgrade operation.

Submitted by: Sreekanth Ready <sreekanth.reddy@broadcom.com>
Tested by: ken
MFC after: 3 days

(cherry picked from commit 11778fca4a83f5e3b597c75785aa5c0ee0dc518e)

22 months agoioat: Add Ice Lake ID.
Alexander Motin [Thu, 6 Oct 2022 18:44:10 +0000 (14:44 -0400)]
ioat: Add Ice Lake ID.

MFC after: 2 weeks

(cherry picked from commit e4e91353c62e2af425061a4e56e1f24dcca2dd0f)

22 months agovmd: Add DID 8086:7D0B and 8086:AD0B for Intel MTL SKUs
Alexander Motin [Thu, 6 Oct 2022 16:44:59 +0000 (12:44 -0400)]
vmd: Add DID 8086:7D0B and 8086:AD0B for Intel MTL SKUs

MFC after: 2 weeks

(cherry picked from commit 9bce11410645f4e84521c2ee44d3082aad8ae1e9)

22 months agovmd: Bypass MSI/MSI-X remapping when possible.
Alexander Motin [Thu, 6 Oct 2022 16:15:25 +0000 (12:15 -0400)]
vmd: Bypass MSI/MSI-X remapping when possible.

By default all VMD devices remap children MSI/MSI-X interrupts into their
own.  It creates additional isolation, but also complicates things due to
sharing, etc.  Fortunately some VMD devices can bypass the remapping.
Add tunable to control it for remap testing or if something go wrong.

MFC after: 2 weeks

(cherry picked from commit c28220d8661ee1928bff7d2c6bcd3e64c25f927b)

22 months agosysent: regen after ee9bc5818356, posix_fadvise in capmode
Ed Maste [Thu, 14 Apr 2022 19:17:07 +0000 (15:17 -0400)]
sysent: regen after ee9bc5818356, posix_fadvise in capmode

(cherry picked from commit f99cc5a38947e80c41bfa28855291ac5a2e41fea)

22 months agoAllow posix_fadvise in capability mode
Ed Maste [Wed, 13 Apr 2022 22:36:03 +0000 (18:36 -0400)]
Allow posix_fadvise in capability mode

posix_fadvise operates only on a provided fd.  Noted by
Mathieu <sigsys@gmail.com> in review D34761.

No new CAP_ rights are added for posix_fadvise(), as 'advice' in
general only influences when I/O happens; the fd must have existing
CAP_ rights for actual data access.

Reviewed by: markj
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34903

(cherry picked from commit 52a1d90c8bfe80a15e71a1a2bd7b9407949741d6)

22 months agoiflib: Introduce v2 of TX Queue Select Functionality
Eric Joyner [Mon, 17 Oct 2022 21:52:20 +0000 (14:52 -0700)]
iflib: Introduce v2 of TX Queue Select Functionality

For v2, iflib will parse packet headers before queueing a packet.

This commit also adds a new field in the structure that holds parsed
header information from packets; it stores the IP ToS/traffic class
field found in the IPv4/IPv6 header.

To help, it will only partially parse header packets before queueing
them by using a new header parsing function that does less than the
current parsing header function; for our purposes we only need up to the
minimal IP header in order to get the IP ToS infromation and don't need
to pull up more data.

For now, v1 and v2 co-exist in this patch; v1 still offers a
less-invasive method where none of the packet is parsed in iflib before
queueing.

This also bumps the sys/param.h version.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Tested by: IntelNetworking
Sponsored by: Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D34742

(cherry picked from commit 9c950139051298831ce19d01ea5fb33ec6ea7f89)

22 months agopvscsi: Advertise maxio of 256k.
Warner Losh [Wed, 21 Apr 2021 18:10:42 +0000 (12:10 -0600)]
pvscsi: Advertise maxio of 256k.

While the PV SCSI SG list can handle 512k of SG entries, it can only do
so for I/O that's aligned to 4k or better. newfs_msdos does unaligned
I/O, so triggers too long for host errors in cam when a 512k I/O is
attempted. Prefer power of 2 256k to the absolute maximum 508k, though
that can be revisited should the latter show to give significant
performance improvement.

MFC After: 3 days
Tested by: darius on discord (508k version of patch)
Sponsored by: Netflix

(cherry picked from commit 9a5a5c1576b4ce308a97e0bce887261701ae3edc)

22 months agortld: fix typo in comment
Konstantin Belousov [Mon, 17 Oct 2022 14:08:36 +0000 (17:08 +0300)]
rtld: fix typo in comment

(cherry picked from commit ca2560bd85ab8d5cb18855cf61f49a7219cb3d8f)

22 months agolibdtrace: Fix some CPU register number definitions to match the kernel
Mark Johnston [Wed, 12 Oct 2022 19:59:09 +0000 (15:59 -0400)]
libdtrace: Fix some CPU register number definitions to match the kernel

(cherry picked from commit 53a31c87df9f0f77d26a5d35cb8322c8e78033ce)

22 months agodtrace: Drop illumos ifdefs for CPU register definitions
Mark Johnston [Wed, 12 Oct 2022 19:59:00 +0000 (15:59 -0400)]
dtrace: Drop illumos ifdefs for CPU register definitions

These are fixed, so having upstream's version is not especially useful,
and the duplicated definitions make for confusing reading.  No
functional change intended.

(cherry picked from commit b34a6e0fed4af33671c79347deb77e3e93930df3)

22 months agomalloc(9): update names and hardlinks
Mitchell Horne [Wed, 12 Oct 2022 16:43:57 +0000 (13:43 -0300)]
malloc(9): update names and hardlinks

Give all documented functions a .Nm entry in the man page, following the
order they are listed in the synopsis. Create MLINKs for each of the
functions as well.

While here, add a missing include directive to the synopsis, and appease
mandoc by wrapping a long line.

Reviewed by: markj, imp (previous version), jhb (previous version)
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36940

(cherry picked from commit 30c6a66864821d3b47e25612c0d2e727ec36154e)

22 months agoswi(9): remove BUGS section
Mitchell Horne [Wed, 12 Oct 2022 16:38:08 +0000 (13:38 -0300)]
swi(9): remove BUGS section

Most of these globals have been removed, save for clk_intr_event. This
one is appropriate to keep in sys/interrupt.h, despite the fact that it
has only one consumer.

Bump .Dd for this and previous changes.

Reviewed by: markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36939

(cherry picked from commit ed02be352dc973827446436eece4cad5b8c91bf3)

22 months agoDowngrade tty_intr_event from a global
Mitchell Horne [Wed, 12 Oct 2022 16:36:08 +0000 (13:36 -0300)]
Downgrade tty_intr_event from a global

It can be static within uart_tty.c. It is an open question whether there
remains any real benefit to having uart instances share a swi thread.

Reviewed by: imp, markj, jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36938

(cherry picked from commit 05b727fee550598bfae5754783f9decfdeeb3c3d)

22 months agoswi(9): clean up description of clk_intr_event
Mitchell Horne [Wed, 12 Oct 2022 16:35:23 +0000 (13:35 -0300)]
swi(9): clean up description of clk_intr_event

From what I can tell, setdelayed() was removed so long ago that its
mention is more likely to be confusing than helpful. We now have a
manpage for hardclock(9), so reference that.

Reviewed by: markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36937

(cherry picked from commit 96b76a6a1edd6d0e0d4fa07c37d11d5805e8b8b3)

22 months agoRemove last references of vm_ih
Mitchell Horne [Wed, 12 Oct 2022 16:32:27 +0000 (13:32 -0300)]
Remove last references of vm_ih

The only remaining user was busdma, and so it was simplified.

Reviewed by: markj, jhb
MFC after: 1 week
Fixes: 254e4e5b77d7 ("Simplify swi for bus_dma")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36936

(cherry picked from commit e23c3445f69c945a8d5316b26bd996dbc900b2aa)

22 months agonanobsd: remove unmodified copies of ssh config files
Ed Maste [Wed, 13 Apr 2022 21:04:33 +0000 (17:04 -0400)]
nanobsd: remove unmodified copies of ssh config files

Nanobsd included copies of ssh_config and sshd_config.  The former is
identical to the one provided by the base system, and the latter is
identical except for PermitRootLogin, which is updated by nanobsd's
cust_allow_ssh_root anyhow.  Remove nanobsd's copies and use the
existing base system ones.

Reported by: Jose Luis Duran <jlduran@gmail.com> in D34937
Reviewed by: Jose Luis Duran <jlduran@gmail.com>, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36933

(cherry picked from commit 42942998437d9304110e39b04552853729aa498e)
(cherry picked from commit 6e6c45e66f68e68b451a27430f51a687e00bad15)
(cherry picked from commit a1e39f96d244fe30a3277c9cefbfd23e046cf845)

22 months agoqoriq_dw_pci: Fix typo in link status checking code
Bartlomiej Grzesik [Tue, 31 Aug 2021 04:22:33 +0000 (06:22 +0200)]
qoriq_dw_pci: Fix typo in link status checking code

On some DesignWare PCIe controllers accessing config registers of slots
whose link is down triggers a SError. Because of that we need to check the
link status before any acceses config space.
Due to a typo link was always reported up.
This fixes a SError that occured during boot on LS1028A-RDB.

Obtained from: Semihalf
Reviewed by: wma
Differential revision: https://reviews.freebsd.org/D31509

(cherry picked from commit df9c0e88e1e30cb5d1c81c4c2f295f7d153ed02b)

22 months agosort: deindent file_reader_free and cleanup its usage
Baptiste Daroussin [Thu, 13 Oct 2022 08:51:17 +0000 (10:51 +0200)]
sort: deindent file_reader_free and cleanup its usage

(cherry picked from commit 226e41467ee15c7aba33d59ee7b512b984b182e7)

22 months agosort: simplify file_reader_clean
Baptiste Daroussin [Thu, 13 Oct 2022 08:40:21 +0000 (10:40 +0200)]
sort: simplify file_reader_clean

Deindent the function, remove useless tests:
 - free already test if argument is NULL
 - closefile already test if the input is stdin or null

(cherry picked from commit ffd41d39c660ca1c80b77707238e8e5ef26d7d7a)

22 months agosort: deindent closefile
Baptiste Daroussin [Thu, 13 Oct 2022 08:38:12 +0000 (10:38 +0200)]
sort: deindent closefile

(cherry picked from commit f9d9a7cc4f2ff38795e5056721297e2b8442bf7a)

22 months agosort: use asprintf(3) instead of malloc + snprintf(3)
Baptiste Daroussin [Thu, 13 Oct 2022 08:34:57 +0000 (10:34 +0200)]
sort: use asprintf(3) instead of malloc + snprintf(3)

(cherry picked from commit 48a53cc4849555f1a0b805adddb9f517a305a2ae)

22 months agosort: deindent openfile
Baptiste Daroussin [Thu, 13 Oct 2022 08:31:08 +0000 (10:31 +0200)]
sort: deindent openfile

(cherry picked from commit 958b0d46425395f8f4606ac5d12681d623282e9d)

22 months agosort: use memset to initialize structure when possible
Baptiste Daroussin [Thu, 13 Oct 2022 07:07:46 +0000 (09:07 +0200)]
sort: use memset to initialize structure when possible

(cherry picked from commit f02c783757365340763739e58ef0e68ec13a0f8f)

22 months agosort: unify the code to read from FILE *
Baptiste Daroussin [Thu, 13 Oct 2022 07:36:48 +0000 (09:36 +0200)]
sort: unify the code to read from FILE *

Previously the code to read from a local file or stdin was sperarated
After the change to remove the home made line reader used for stdin
(replaced by getdelim) it apprears that the rest of the code which is
used to read from any FILE * but stdin can benefit from the exact same
change.

(cherry picked from commit 8b9071360a312f2bb2104864af0b9905acac87bc)

22 months agosort: remove unused function
Baptiste Daroussin [Thu, 13 Oct 2022 07:33:12 +0000 (09:33 +0200)]
sort: remove unused function

(cherry picked from commit e8815fb30b340108bc4b36ab46afa31f673948d0)

22 months agosort: simplify the code to handle -z flag
Baptiste Daroussin [Thu, 13 Oct 2022 08:21:48 +0000 (10:21 +0200)]
sort: simplify the code to handle -z flag

(cherry picked from commit f079ef8aa428ebffad28f5c62cce52c2bf70fb49)

22 months agosort: cleanup now unused structutre and prototypes
Baptiste Daroussin [Thu, 13 Oct 2022 08:19:18 +0000 (10:19 +0200)]
sort: cleanup now unused structutre and prototypes

(cherry picked from commit 4d4fcf619efcc02a962d0723a7ccd94fb621c6e6)

22 months agosort: use mkstemp(3) instead of reinventing it
Baptiste Daroussin [Wed, 12 Oct 2022 15:57:37 +0000 (17:57 +0200)]
sort: use mkstemp(3) instead of reinventing it

MFC After: 1 week

(cherry picked from commit 3f9e5e59bda05acea409fa3121c835a74672de1c)

22 months agosort: replace home made line reader by getdelim(3)
Baptiste Daroussin [Wed, 12 Oct 2022 13:31:50 +0000 (15:31 +0200)]
sort: replace home made line reader by getdelim(3)

The previous code had bug when reading lines with an unexpected
encoding, returning without the full line being captured.
This result in sort complaining with "sort: Illegal byte sequence"

Using getdelim(3) instead of the home made code, fixes the situation.

PR: 241679
Reported by: Ronald F. Guilmette <rfg-freebsd@tristatelogic.com>
MFC After: 1 week
Reviewed by: markj, imp
Differential Revision: https://reviews.freebsd.org/D36948

(cherry picked from commit b58094c0d98e5d0ab8abdcdb655ac902ae8ad66e)

22 months agoOptionalObsoleteFiles: grep nls files have been removed 4 years ago
Baptiste Daroussin [Wed, 12 Oct 2022 14:28:36 +0000 (16:28 +0200)]
OptionalObsoleteFiles: grep nls files have been removed 4 years ago

(cherry picked from commit 00ffd6b5e88e9f2cf176379dc185c7f0c0920ba7)

22 months agosort: add wrapper around calloc
Baptiste Daroussin [Wed, 12 Oct 2022 13:52:38 +0000 (15:52 +0200)]
sort: add wrapper around calloc

(cherry picked from commit a312f3e74286c9bccd498198bfd236c49916d891)

22 months agosort: replace malloc+memset with calloc
Baptiste Daroussin [Wed, 12 Oct 2022 13:57:11 +0000 (15:57 +0200)]
sort: replace malloc+memset with calloc

(cherry picked from commit ecc3c2916751a0aef5619ed8f0ba1cc37c0a22ba)

22 months agopw: remove the inaccurate anymore information from the README
Baptiste Daroussin [Wed, 12 Oct 2022 10:11:32 +0000 (12:11 +0200)]
pw: remove the inaccurate anymore information from the README

(cherry picked from commit 88e6c9a674be41bb817573f61c86dec255ca1646)

22 months agopw: exit with an error in case of using an illegal option
Baptiste Daroussin [Wed, 12 Oct 2022 10:06:32 +0000 (12:06 +0200)]
pw: exit with an error in case of using an illegal option

PR: 263188
Reported by: Dennis Clarke <dclarke@blastwave.org>
MFC After: 1 week

(cherry picked from commit c0358afd5bbc2c675941fed2905479ad109770bb)

22 months agopci_vendors: update to 2022.09.09
Baptiste Daroussin [Wed, 12 Oct 2022 09:31:15 +0000 (11:31 +0200)]
pci_vendors: update to 2022.09.09

(cherry picked from commit 0b4886f4543ea8e55313321c92263adf8e0e6ff7)

22 months agoinet6(4): add a missing IPPROTO_ETHERIP entry
Hiroki Sato [Fri, 27 Aug 2021 08:14:35 +0000 (17:14 +0900)]
inet6(4): add a missing IPPROTO_ETHERIP entry

bridge(4) + gif(4) did not work when the outer protocol was IPv6.

Submitted by: Masahiro Kozuka
PR: 256820

Approved by: hps (to cherry-pick)

(cherry picked from commit 9823a0c0acf4fc277a71336ea737e1de7c65742f)

22 months agodma: restore addition of newline when missing from input
Ed Maste [Tue, 27 Sep 2022 19:19:19 +0000 (15:19 -0400)]
dma: restore addition of newline when missing from input

If input mail does not have a newline on the last line dma must add
one.  This was broken by the addition of long-line splitting, with the
switch from strlen(line) to linelen returned by getline().

PR: 266629
Reviewed by: bapt, Mikko Lehto
Tested by: Mikko Lehto
MFC after: 1 week
Fixes: b0b2d05fd060 ("Split body of mails not respecting...")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36763

(cherry picked from commit 169487223143b1232ec4686b720b028af8d6d42b)

22 months agoReapply: "bus.h: rewrite comment describing intr_type"
Mitchell Horne [Fri, 7 Oct 2022 22:21:49 +0000 (19:21 -0300)]
Reapply: "bus.h: rewrite comment describing intr_type"

Describe more clearly the purpose of these flags and where they are
used.

Remove grog's comment about revisiting the flags. At this point it does
not make sense to change this long-standing API, especially in light of
2cf7870864ea ("Collapse interrupt thread priorities").

Give a better example of a bus modifying these flags; I did not find any
existing instance where a bus changes the interrupt's type.

Reviewed by: imp, markj, jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36896

Note: 2cf7870864ea is not present in stable/13 and likely will never be.
While reapplying this change, I have modified the comment further to
eliminate any inaccuracy Re: priorities. It should be applicable even if
the change is merged some day.

(cherry picked from commit af390486010e8fc78c4d715e751cd1175d0752c7)

22 months agoRevert "bus.h: rewrite comment describing intr_type"
Mitchell Horne [Tue, 18 Oct 2022 14:13:24 +0000 (11:13 -0300)]
Revert "bus.h: rewrite comment describing intr_type"

This reverts commit fff5fec16b2ec42b0cb357fdbb675353e3126f21.

It needs slight modification for stable/13 which does not have collapsed
interrupt thread priorities.

22 months agosbuf(9): reference the correct function
Mitchell Horne [Thu, 13 Oct 2022 13:01:11 +0000 (10:01 -0300)]
sbuf(9): reference the correct function

This was most likely a copy-paste error.

PR: 262433
MFC after: 3 days
Reported by: Boris Ivanovsky <bivanovsky@gmail.com>
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 204a5f5800a0d025c223a7b0b66537e30777d0c7)

22 months agoofw_graph(9): hook it up to the Makefile
Mitchell Horne [Tue, 11 Oct 2022 19:28:16 +0000 (16:28 -0300)]
ofw_graph(9): hook it up to the Makefile

Otherwise, the man page is not installed. Add appropriate MLINKS.

Reviewed by: manu
MFC after: 3 days
Fixes: 9a4eed0be20c ("ofw_graph: Add functions for graph bindings")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36932

(cherry picked from commit d88131e1e50c9cce5bd089b156661ca3090c10c6)

22 months agoriscv: handle misaligned address exceptions
Mitchell Horne [Tue, 11 Oct 2022 13:39:50 +0000 (10:39 -0300)]
riscv: handle misaligned address exceptions

If this exception is coming from userspace, send the appropriate SIGBUS
to the process. If it's coming from the kernel this is still fatal, but
we can give a better panic message.

Typical misaligned loads/stores are emulated by the SBI firmware, and
require no intervention from our kernel. The notable exception here is
misaligned access with atomic instructions. These can generate the
exception and panic seen in the PR.

With this, we now handle all defined exception types.

PR: 266109
MFC after: 1 week
Found by: syzkaller
Reported by: P1umer <p1umer1337@gmail.com>
Differential Revision: https://reviews.freebsd.org/D36876

(cherry picked from commit 9b4cbaa9c3da233cf06381c3d22e3472ee586585)

22 months agobus.h: rewrite comment describing intr_type
Mitchell Horne [Fri, 7 Oct 2022 22:21:49 +0000 (19:21 -0300)]
bus.h: rewrite comment describing intr_type

Describe more clearly the purpose of these flags and where they are
used.

Remove grog's comment about revisiting the flags. At this point it does
not make sense to change this long-standing API, especially in light of
2cf7870864ea ("Collapse interrupt thread priorities").

Give a better example of a bus modifying these flags; I did not find any
existing instance where a bus changes the interrupt's type.

Reviewed by: imp, markj, jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36896

(cherry picked from commit af390486010e8fc78c4d715e751cd1175d0752c7)

22 months agoEVENTHANDLER(9): drop the list of event handlers
Mitchell Horne [Fri, 7 Oct 2022 22:25:12 +0000 (19:25 -0300)]
EVENTHANDLER(9): drop the list of event handlers

Maintaining a comprehensive list of event handlers in this man page is a
futile endeavor. It is entirely detached from the source code, and
therefore requires that anyone adding/removing an event handler have
prior knowledge of the list. Many do not, so it will naturally become
stale (and is).

This is demonstrated by the fact that there are currently 88 instances
of EVENTHANDLER_DECLARE() in the source tree, but the list contains 66
items.

Many of the descriptions do not offer much detail that could not be
gleaned from the handler name alone. It is a more effective strategy to
document the purpose/details of the event handler in a comment alongside
its declaration.

Reviewed by: markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36895

(cherry picked from commit 34aac98e3511d90df9209204df6772935a2b7617)