FreeBSD/src 8380449sys/x86/include ucode.h, sys/x86/x86 ucode_subr.c ucode.c

cpucontrol: return selected revision from ucode_amd_find()

This fixes two printing bugs in cpucontrol(1).  First, the utility will
now print "updating from rev X to rev Y", instead of incorrect "updating
to revision X", where X is actually the old revision.  This also matches
what Intel updater prints.  Second, the utility won't incorrectly warn
that the update failed after reading the new revision post update.

Reviewed by:            kib, markj
Differential Revision:  https://reviews.freebsd.org/D52506
DeltaFile
+6-5usr.sbin/cpucontrol/amd10h.c
+5-5sys/x86/x86/ucode_subr.c
+2-1sys/x86/x86/ucode.c
+1-1sys/x86/include/ucode.h
+14-124 files

FreeBSD/src 6683dcfsys/dev/cpuctl cpuctl.c

cpuctl: run amd_ucode_wrmsr only on one CPU and report if it failed

The CPUCTL_UPDATE is supposed to be applied only to the CPU the ioctl(2)
was performed on.  This is true for Intel CPUs, but for AMD the SMP
rendezvouz of amd_ucode_wrmsr() effectively executed it on all CPUs.
Also, the update failure was not reported.

Reviewed by:            markj
Differential Revision:  https://reviews.freebsd.org/D52466
DeltaFile
+11-11sys/dev/cpuctl/cpuctl.c
+11-111 files

FreeBSD/src 6b841d7sys/dev/ufshci ufshci_ctrlr.c ufshci_req_queue.c

ufshci: revisit controller reset path and add I/O timeout handling

This patch revisits the controller reset path and introduces timeout
handling for I/O commands.

To support controller reset during driver operation, the controller’s
construct, destruct, enable, and disable functions are clearly
separated in ufshci_ctrlr.c. ufshci_ctrlr_hw_reset() function is
added to leverage enable/disable.

After initialization, ufshci_ctrlr_reset_task() is also introduced to
ensure controller resets are performed via the task queue.

Timeout handling is designed in five steps. This patch implements
Step 1 and Step 5, while the remaining steps will be added later.
The timeout mechanism follows the same shared timeout model used in
the NVMe driver.

Test: Intentionally delayed UPIU I/O in QEMU to trigger a timeout and

    [5 lines not shown]
DeltaFile
+244-155sys/dev/ufshci/ufshci_ctrlr.c
+279-13sys/dev/ufshci/ufshci_req_queue.c
+70-7sys/dev/ufshci/ufshci_req_sdb.c
+37-4sys/dev/ufshci/ufshci_private.h
+2-1sys/dev/ufshci/ufshci_pci.c
+1-1sys/dev/ufshci/ufshci_ctrlr_cmd.c
+633-1812 files not shown
+633-1838 files

FreeBSD/src 380e4a8share/misc committers-src.dot

committers-src: add myself (jaeyoon@)

Add myself (jaeyoon@) as a new src committer with imp@ as my mentor.

Reviewed by: imp (mentor)
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D52570
DeltaFile
+2-0share/misc/committers-src.dot
+2-01 files

FreeBSD/src df997fatests/atf_python atf_pytest.py

atf_pytest: fix xfail detection from pytest report

The location of the 'wasxfail' attribute was moved from
the 'reason' attribute back to the parent 'report'. This
fixes an issue where xfails are wrongly reported to ATF
as skipped tests.

Signed-off-by: Siva Mahadevan <me at svmhdvn.name>
Pull-request: https://github.com/freebsd/freebsd-src/pull/1849
Sponsored by: The FreeBSD Foundation
DeltaFile
+2-2tests/atf_python/atf_pytest.py
+2-21 files

FreeBSD/src 46e6e91share/man/man4 udbc.4, sys/dev/usb/serial udbc.c

udbc: Add usb debug host mode driver

xhci offers a debugging interface which uses a special usb 3 cable with the D+,
D- and VBUS pairs disconnected. This interface allows a target device to
configure its xhci controller as a debugging channel which can then be used to
provide a serial link between the target and a debug host.

This change extracts the udbc host mode driver from hrs@'s xhci debug
implementation.

Reviewed by:    bcr (man page)
MFC after:      Before 15-ALPHA3 builds
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D51299

(cherry picked from commit d566b6a70bcbc329e8c690464043401fa8bdd49f)
DeltaFile
+404-0sys/dev/usb/serial/udbc.c
+132-0share/man/man4/udbc.4
+9-0sys/modules/usb/udbc/Makefile
+3-4sys/modules/usb/Makefile
+548-44 files

FreeBSD/src e8d181eshare/man/man4 Makefile

udbc(4): connect to build

Reviewed by:    thj
MFC with:       d566b6a70bcbc329e8c690464043401fa8bdd49f
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit a75c3c2c633dfa29b628f692fc7274cab1920640)
DeltaFile
+1-0share/man/man4/Makefile
+1-01 files

FreeBSD/src d1142d5lib/libc/gen getgrouplist.c

libc: fix the _FORTIFY_SOURCE build of getgrouplist(3)

We need <unistd.h> to get our prototype normally, but WARNS in libc is
way too low to surface that.

Additionally, _FORTIFY_SOURCE needs to include <ssp/unistd.h> by way of
<unistd.h> to actually export an implementation of getgrouplist(3).  The
version defined in the .c gets named __ssp_real_getgrouplist() and the
actual implementation comes from the redirect stub in <ssp/unistd.h>,
which basically gets optimized away in the built object because our
__builtin_object_size() check is trivially false when we cannot resolve
any object sizes in this translation unit.

This could be argued as a design flaw in _FORTIFY_SOURCE, but we should
grab <unistd.h> for our prototype anyways so let's kick the can down
the road instead of re-thinking it for 15.0.

Reported by:    Shawn Webb (HardenedBSD)
Fixes:          d3f8ed6066 ("getgrouplist(3): Remove superfluous [...]")

    [7 lines not shown]
DeltaFile
+2-0lib/libc/gen/getgrouplist.c
+2-01 files

FreeBSD/src 009268dsys/dev/hwpmc hwpmc_mod.c

hwpmc: On attach, fix allowing a PMC's owner to attach it to itself

The returned value in this case was wrong, and would basically prevent
some PMC's owner process to attach that PMC to itself although the
security checks underneath would have allowed it.

Now that this early return has been fixed, its block basically becomes
a performance short-circuit which has no effect from a functional
standpoint.

Fixes:          ebccf1e3a6b1 ("Bring a working snapshot of hwpmc(4), ...")
MFC after:      9 days
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 1c40b15971f09c0c0676ae476b88b32166eae8ac)
DeltaFile
+1-1sys/dev/hwpmc/hwpmc_mod.c
+1-11 files

FreeBSD/src 7220f36lib/libc/gen getgrouplist.c

getgrouplist(3): Remove superfluous headers, bogus comment and whitespace

No functional change (intended).

Fixes:          a59d6a872459 ("Implementing 'fallback' nsswitch source.")
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit d3f8ed6066fdea329ed695925fc726e84d50abc3)
DeltaFile
+0-8lib/libc/gen/getgrouplist.c
+0-81 files

FreeBSD/src 59a73e9sys/dev/hwpmc hwpmc_mod.c

hwpmc: On attach, ensure owner is a target effective GID's member

This restores a check that existed prior to commit be1f7435ef218b1d
("kern: start tracking cr_gid outside of cr_groups[]").

While here, improve pmc_can_attach()'s style by changing the type of
'decline_attach' to 'bool', fixing tests on it, adding missing
parentheses to 'return' statements, and by changing its return value
type to 'bool'.

Fixes:          be1f7435ef218b1d ("kern: start tracking cr_gid outside of cr_groups[]")
MFC after:      9 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52252

(cherry picked from commit 1c3c698ba4c40485ebbbd157cb49172cfa7de9b2)

MFC to 14 does not fix any bug, but just applies some style changes
needed by next MFC.

    [6 lines not shown]
DeltaFile
+10-11sys/dev/hwpmc/hwpmc_mod.c
+10-111 files

FreeBSD/src eabd561lib/libsdp sdp.3 sdp.h

sdp(3): Change bdaddr parameter type in sdp_register_service()

Fixes compiler error when the caller passes a const bdaddr_t *
paramemeter (e.g., NG_HCI_BDADDR_ANY).

Sponsored by:   The FreeBSD Foundation
MFC after:      1 day
Reviewed by:    markj, emaste
Differential Revision:  https://reviews.freebsd.org/D52582

(cherry picked from commit 3d14cc82d7a8c11cd164a6ba668d20b939c576fe)
DeltaFile
+2-2lib/libsdp/sdp.3
+1-1lib/libsdp/sdp.h
+1-1lib/libsdp/service.c
+4-43 files

FreeBSD/src e4fcd20sys/netgraph/bluetooth/socket ng_btsocket_rfcomm.c

ng_btsocket_rfcomm: Mark a couple buffers as const in a helper function

Fixes:  680f9acc3657 ("ng_hci: Cast NG_HCI_BDADDR_ANY to const bdaddr_t *")
(cherry picked from commit 18fd3f8ec5c50da21515757af24421a078a4a468)
DeltaFile
+2-2sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c
+2-21 files

FreeBSD/src 064006bsys/netgraph/bluetooth/include ng_hci.h

ng_hci: Cast NG_HCI_BDADDR_ANY to const bdaddr_t *

This is needed to address some compiler errors cleanly, where consumer
functions want this address to be a const pointer.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    markj
Differential Revision: https://reviews.freebsd.org/D52310

(cherry picked from commit 680f9acc3657efcea07d8ac0954645b6eaf8dac8)
DeltaFile
+1-1sys/netgraph/bluetooth/include/ng_hci.h
+1-11 files

FreeBSD/src 3501e25lib/libsdp sdp.3 sdp.h

sdp(3): Change bdaddr parameter type in sdp_register_service()

Fixes compiler error when the caller passes a const bdaddr_t *
paramemeter (e.g., NG_HCI_BDADDR_ANY).

Sponsored by:   The FreeBSD Foundation
MFC after:      1 day
Reviewed by:    markj, emaste
Differential Revision:  https://reviews.freebsd.org/D52582

(cherry picked from commit 3d14cc82d7a8c11cd164a6ba668d20b939c576fe)
DeltaFile
+2-2lib/libsdp/sdp.3
+1-1lib/libsdp/sdp.h
+1-1lib/libsdp/service.c
+4-43 files

FreeBSD/src 3ed8934sys/netgraph/bluetooth/socket ng_btsocket_rfcomm.c

ng_btsocket_rfcomm: Mark a couple buffers as const in a helper function

Fixes:  680f9acc3657 ("ng_hci: Cast NG_HCI_BDADDR_ANY to const bdaddr_t *")
(cherry picked from commit 18fd3f8ec5c50da21515757af24421a078a4a468)
DeltaFile
+2-2sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c
+2-21 files

FreeBSD/src 8813774sys/netgraph/bluetooth/include ng_hci.h

ng_hci: Cast NG_HCI_BDADDR_ANY to const bdaddr_t *

This is needed to address some compiler errors cleanly, where consumer
functions want this address to be a const pointer.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    markj
Differential Revision: https://reviews.freebsd.org/D52310

(cherry picked from commit 680f9acc3657efcea07d8ac0954645b6eaf8dac8)
DeltaFile
+1-1sys/netgraph/bluetooth/include/ng_hci.h
+1-11 files

FreeBSD/src 506b36csys/dev/acpica acpi.c acpivar.h, sys/x86/acpica acpi_apm.c

Revert "acpi: Use sleep types defined in sys/power.h"

This reverts commit ce5e22b28ef6caff3ffd228ac188114b08c0da02.

PR:             289634
DeltaFile
+135-231sys/dev/acpica/acpi.c
+12-13sys/x86/acpica/acpi_apm.c
+8-7sys/dev/acpica/acpivar.h
+2-2sys/dev/acpica/acpi_lid.c
+157-2534 files

FreeBSD/src 87e2b53sys/dev/acpica acpi.c, sys/kern subr_power.c

Revert "sys/power: Sleep type reporting by PM backends"

This reverts commit e779891327b1d9b9ab10ba482e59f498790505a7.

PR:             289634
DeltaFile
+5-41sys/kern/subr_power.c
+2-4sys/dev/acpica/acpi.c
+1-2sys/sys/power.h
+8-473 files

FreeBSD/src 25cddb1sys/dev/acpica acpi.c

Revert "acpi: Fix build when `ACPI_DEBUG_OUTPUT` defined"

This reverts commit 4894f5ba394306a75dbed9ed4377ab0eae75aede.

PR:             289634
DeltaFile
+2-2sys/dev/acpica/acpi.c
+2-21 files

FreeBSD/src ea5e50c. UPDATING, release/packages/ucl mandoc-all.ucl

packages: Add a mandoc package

Move mandoc to its own package so users can install it independently of
-utilities.  Put the package in the minimal set, since we also ship
manpages in minimal and "man" is a basic Unix utility.

Add a pkg-triggers(5) hook to run makewhatis when new manpages are
installed, so that apropos(1) works.  This depends on a new pkg(8)
feature expected to be in in the upcoming 2.3.2 release; in the mean
time, this is a no-op (i.e., having an older pkg doesn't break anything,
it just won't run the trigger).

MFC after:      3 seconds
Reviewed by:    bapt
Differential Revision:  https://reviews.freebsd.org/D52564
DeltaFile
+18-0usr.bin/mandoc/mandoc.ucl
+11-0release/packages/ucl/mandoc-all.ucl
+6-0usr.bin/mandoc/Makefile
+4-0UPDATING
+2-0usr.bin/man/Makefile
+41-05 files

FreeBSD/src 9065390. UPDATING, release/packages/ucl tests-all.ucl kyua-all.ucl

packages: Remove the tests-dev package

We don't want a tests-dev package, because this means set-devel depends
on tests-dev, which transitively depends on tests, which means you can't
install set-devel without also getting tests.

The only real "dev" files in tests-dev are from ATF (libprivateatf),
so move that to its own package and add a dependency from tests.

Also move Kyua to its own package, since this might be useful for
running tests even when the user doesn't want the whole set of base
tests installed.

Add a dependency from -tests to both -atf and -kyua, and a dependency
on -set-base, since the tests won't work without the full base system
installed.

The remaining "dev" files in tests are actually test artifacts, not real
development libraries.  Add a new NO_DEV_PACKAGE option to bsd.lib.mk,

    [10 lines not shown]
DeltaFile
+25-2release/packages/ucl/tests-all.ucl
+20-0release/packages/ucl/kyua-all.ucl
+11-0share/mk/bsd.lib.mk
+8-0release/packages/ucl/atf-all.ucl
+8-0UPDATING
+3-0share/mk/bsd.test.mk
+75-214 files not shown
+84-1220 files

FreeBSD/src b5bd974lib/libc/gen getgrouplist.c

getgrouplist(3): Remove superfluous headers, bogus comment and whitespace

No functional change (intended).

Fixes:          a59d6a872459 ("Implementing 'fallback' nsswitch source.")
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit d3f8ed6066fdea329ed695925fc726e84d50abc3)
DeltaFile
+0-7lib/libc/gen/getgrouplist.c
+0-71 files

FreeBSD/src 2e71d10lib/libc/gen getgrouplist.c

libc: fix the _FORTIFY_SOURCE build of getgrouplist(3)

We need <unistd.h> to get our prototype normally, but WARNS in libc is
way too low to surface that.

Additionally, _FORTIFY_SOURCE needs to include <ssp/unistd.h> by way of
<unistd.h> to actually export an implementation of getgrouplist(3).  The
version defined in the .c gets named __ssp_real_getgrouplist() and the
actual implementation comes from the redirect stub in <ssp/unistd.h>,
which basically gets optimized away in the built object because our
__builtin_object_size() check is trivially false when we cannot resolve
any object sizes in this translation unit.

This could be argued as a design flaw in _FORTIFY_SOURCE, but we should
grab <unistd.h> for our prototype anyways so let's kick the can down
the road instead of re-thinking it for 15.0.

Reported by:    Shawn Webb (HardenedBSD)
Fixes:          d3f8ed6066 ("getgrouplist(3): Remove superfluous [...]")

    [3 lines not shown]
DeltaFile
+1-0lib/libc/gen/getgrouplist.c
+1-01 files

FreeBSD/src 32606ebsys/kern kern_proc.c

'kern.proc.groups' sysctl knob: Restore outputting the effective GID

In particular, fixes 'procstat -s' on a live system (for processes with
more than 16 groups).

Reviewed by:    kib, emaste
Fixes:          be1f7435ef218b1d ("kern: start tracking cr_gid outside of cr_groups[]")
MFC after:      9 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52261

(cherry picked from commit faf7e99375910fadb1b409a756be5477b561a517)
DeltaFile
+5-2sys/kern/kern_proc.c
+5-21 files

FreeBSD/src 7140f62lib/libsys jail.2

jail.2: Mention EPERM is returned on open directories

The manual page does not directly mention this reason for getting EPERM,
instead referring the reader to chroot(2).  We have had some questions
about it recently, in part due to a bug (fixed), and this case is not an
obvious permission/problem, so let's be more explicit.

PR:             280809
Reviewed by:    jamie
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52319

(cherry picked from commit ef2f36be8fce8cf7a62ce7d33ab1c4a181fac3e2)
DeltaFile
+4-1lib/libsys/jail.2
+4-11 files

FreeBSD/src 53a9f16lib/libkvm kvm_proc.c

kvm_proclist(): Restore outputting the effective GID

In particular, fixes 'procstat -s -M' (only if there are less than 16
groups).

Reviewed by:    kib, emaste
Fixes:          be1f7435ef218b1d ("kern: start tracking cr_gid outside of cr_groups[]")
MFC after:      9 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52260

(cherry picked from commit 7676df2faeb6dcbf20456574dcd2a7f4ab8fff8a)
DeltaFile
+5-4lib/libkvm/kvm_proc.c
+5-41 files

FreeBSD/src 74d3fdfsys/kern kern_proc.c

kinfo_proc: Restore outputting the effective GID

In particular, fixes 'procstat -s' on a live system or a core file (only
if there are less than 16 groups).

Reviewed by:    kib
Fixes:          be1f7435ef218b1d ("kern: start tracking cr_gid outside of cr_groups[]")
MFC after:      9 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52259

(cherry picked from commit 63a40ca813a9995e8e2dee0142297d9c38106c05)
DeltaFile
+5-4sys/kern/kern_proc.c
+5-41 files

FreeBSD/src 96a2fc5sys/kern imgact_elf.c

imgact_elf: procstat groups: Restore sending the effective GID

Fixes 'procstat -s' run on a core file when the number of groups in
effect at the moment of core dump exceeds KI_NGROUPS (16).

Reviewed by:    kib
Fixes:          be1f7435ef218b1d ("kern: start tracking cr_gid outside of cr_groups[]")
MFC after:      9 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52258

(cherry picked from commit 5568b4441dff078733a76835312a6ce1ccb50a17)
DeltaFile
+3-1sys/kern/imgact_elf.c
+3-11 files

FreeBSD/src 79c1160sys/fs/procfs procfs_status.c

procfs: Restore printing the effective GID in 'status'

Reviewed by:    kib
Fixes:          be1f7435ef218b1d ("kern: start tracking cr_gid outside of cr_groups[]")
MFC after:      9 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52257

(cherry picked from commit d859d4c57eda8ad277611466b840637234712e42)
DeltaFile
+2-6sys/fs/procfs/procfs_status.c
+2-61 files