kern_descrip.c: Clarify allocation and freeing of fd map in fdgrowtable()
When expanding a file table, the condition for allocating a new map
is NDSLOTS(nnfiles) > NDSLOTS(onfiles) whereas for freeing the old map
is NDSLOTS(onfiles) > NDSLOTS(NDFILE).
If a previously expanded file table were to be expanded slightly again
such that the map did not need to be increased, then fdgrowtable could
still free the current map.
This does not happen currently as nnfiles is rounded up to a multiple of
NDENTRIES at the beginning of fdgrowtable() so that every enlargement
after the first enlargement will always require a larger map.
Though the logic is currently correct, it is unclear and should the
earlier rounding up of nnfiles be relaxed or remove, the logic would
be incorrect. This patch therefore adds comments and invariants checking
the size of the table and map, and updates the map free condition so
that it is absolutely clear that the old map will only be deallocated
[5 lines not shown]
lib/libifconfig: Fix pointer-sign warnings
Fix all pointer-sign warnings generated when compiling libifconfig.
One of these warnings comes from the misuse of snl_add_msg_attr_string
for a byte array. Though userland treats carpr_key as a string, it is
actually an array of bytes. Handle it as such in libifconfig.
While here, fix a small consistency nit in ifconfig_sfp_get_sfp_dump.
Signed-off-by: Ryan Moeller <rmoeller.dev at gmail.com>
Reviewed by: imp, zlei
Pull Request: https://github.com/freebsd/freebsd-src/pull/1850
periodic/daily: show verbose zpool status when errors are detected
When zpool status -x reports errors, the output only shows basic error
counts without identifying which files are affected. Replace the
unconditional echo of the brief status with verbose output (zpool
status -v) in the error path so administrators can see exactly which
files have been damaged.
The healthy/no-pools path still shows the brief status.
PR: 223243
Signed-off-by: Po Han Chen <hypery11 at gmail.com>
Reviewed by: imp, jlduran, asomers
Pull Request: https://github.com/freebsd/freebsd-src/pull/2089
mkimg: Fix parsing of filenames containing colons
When using PART_KIND_FILE (-p type:=filename), mkimg uses a colon
to separate an optional offset (e.g., filename:offset).
strsep() was being used to split the string at the first colon.
This caused failures when the filename itself contained a colon
(e.g., "th:is").
This patch uses stat() to check if the entire string exists as a
file. If so, use it directly without splitting.
If the full string is not a valid file, fall back to splitting
at the right-most colon using strrchr().
Uses errc() to fail and exit immediately when an existing directory
is input instead of a file in PART_KIND_FILE mode.
PR: 257960
[3 lines not shown]
libpmc: surface raw TSC in pmclog events
The pmclog record header carries the raw TSC for each event. Export it
in struct pmclog_ev, fix JSON output to emit it unsigned, and preserve
the installed header ABI by overlaying pl_tsc with the legacy pl_ts
storage.
Update pmclog(3) to document the TSC semantics and the legacy alias.
Sponsored by: AMD
Signed-off-by: Andre Silva <andasilv at amd.com>
Reviewed by: imp, mhorne, Ali Mashtizadeh
Pull Request: https://github.com/freebsd/freebsd-src/pull/2085
pmcstat: print raw TSC in decoded log output
Extend pmcstat -R output to include the raw TSC for each decoded record
and print tsc_freq from the initialize record so TSC deltas can be
converted to elapsed time.
Update the pmcstat documentation to describe the decoded output and the
architecture-specific TSC behavior.
Sponsored by: AMD
Signed-off-by: Andre Silva <andasilv at amd.com>
Reviewed by: imp, mhorne, Ali Mashtizadeh
Pull Request: https://github.com/freebsd/freebsd-src/pull/2085
newsyslog.conf(5): use "rotated" instead of "trimmed"
The man page used "trimmed" to describe log rotation, which is
misleading as it suggests the file is truncated to a specific
size rather than being rotated (renamed and a new file created).
Replace all instances of "trimmed" with "rotated" to match the
actual behavior and the terminology used elsewhere in the page.
PR: 278671
Signed-off-by: Kit Dallege <xaum.io at gmail.com>
Reviewed by: imp,ziaee
Pull Request: https://github.com/freebsd/freebsd-src/pull/2099
uvscom: Fix baud rate validation in uvscom_pre_param()
The switch fell through from the supported B150–B115200 cases into default
and returned EINVAL for every speed. Break out before default so valid
rates return success, matching uvscom_cfg_param().
Signed-off-by: Weixie Cui <cuiweixie at gmail.com>
Reviewed by: imp,aokblast
Pull Request: https://github.com/freebsd/freebsd-src/pull/2110
Fix xhci detection on Raspberry Pi 400
If you use the FreeBSD pre-build Raspberry Pi image, it does not include
the specific .dtb file for the Raspberry Pi 400. On this hardware, it
will fall back to attempting to load the Raspberry Pi 4 .dtb file
instead.
The Pi 4 .dtb file reports the board compatible name as
"raspberrypi,4-model-b" The Pi 400 .dtb file reports the board
compatible name as "raspberrypi,400" However, it's even better to
use the generic name.
When using the official Pi 400 .dtb file from the Raspberry Pi Firmware
collection, the FreeBSD xhci driver currently fails to recognize this,
and thus fails to initialize the xhci device. This means no external
USB, or internal USB (which feeds the build-in keyboard)
The official Raspberry Pi FreeBSD image has been working on the Pi 400
"on accident" simply because it didn't include the Pi 400 .dtb file
[9 lines not shown]
sysctl.3: Correct kern and kern.proc type descriptions
Fix several incorrect sysctl.3 type and mutability descriptions so the
manpage matches the actual kern and kern.proc interfaces.
Signed-off-by: Tyler Waddell <tyler.waddell112 at gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2128
asmc: add support for MacBookPro13,1
This commit adds support for the MacBookPro13,1 (late 2016, 13-inch). The SMC
keys were collected from https://logi.wiki/index.php/SMC_Sensor_Codes. Two
temperature keys are omitted because they fail to be read: TI0P (IO Proximity)
and Ta0P (Ambient Air).
Note that the with this model the `dev.asmc.0.fan.0.minspeed` setting only
applies when the fans have been activated by the system. In my testing, the fans
did not spin up until CPU temperatures hit about 80C. At lower temperatures, the
fans will happily ignore the minimum speed and remain at 0 rpm.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2137
14.5: Add autogenerated files to website
These files are as produced by 'make generate-release'; subsequent
commits will fill in details specific to 14.5.
Approved by: re (implicit)
Sponsored by: OpenSats Initiative