msun: add asinpi, acospi, and atanpi
This commit implements the inverse half-cycle
trigonometric functions:
asinpi(x) = asin(x) / pi Eq. (1)
acospi(x) = acos(x) / pi
atanpi(x) = atan(x) / pi
Implemention details are contained in src/s_asinpi.c and
src/a_atanpi.c, where the details for acospi(x) appear in
the former.
*************
CAVEAT EMPTOR: The ld128 code has been only compiled. It has
not been tested for correctness due to lack of hardware.
*************
[127 lines not shown]
libc: Add strfromd, strfromf, and strfroml per C23
strfromd(), strfromf(), and strfroml() are implemented directly
in terms of gdtoa. If a non-conforming format string is passed,
the string "EDOOFUS" is returned and errno set to EDOOFUS as an
extension.
Reviewed by: fuz
MFC after: 1 month
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2301
Signed-off-by: Faraz Vahedi <kfv at kfv.io>
(cherry picked from commit f68d7bfc1479042184e09431bd55771c50c47f68)
ice(4): Add two more 4-part IDs for E835 adapters
Two additional subdevice IDs were introduced
to distinguish between adapters with and without
manageability over USB support.
Signed-off-by: Krzysztof Galazka <krzysztof.galazka at intel.com>
Reviewed by: erj
Tested by: Mateusz Moga <mateusz.moga at intel.com>
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D57337
(cherry picked from commit f370d9e4d5844daa06d77e57236e03bd7c5f4ba1)
ix(4): Sanitize negative error codes
Due to development history FreeBSD driver error codes are reported
the same way as in Linux (as negatives) which is inconsistent
with FreeBSD standard. It may cause unexpected behavior when driver
errors are interpreted by a kernel as syscall handler return values.
This patch converts error codes from negative to positive values for
NVM access functions.
Signed-off-by: Pawel Sobczyk <pawel.sobczyk at intel.com>
Reviewed by: kbowling, erj, milosz.linkiewicz_intel.com
Tested by: Mateusz Moga <mateusz.moga at intel.com>
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D57642
(cherry picked from commit 33e2eac3e3e738daa95a06f42d6c661b87ad9aac)
ix(4): Remove workaround for 2.5/5G speeds on E610
The problem observed on X550 adapters with 2.5 and 5 Gbps speeds
negotiation on some switches is not affecting E610 adapters.
Remove workaround, which omitted those speeds in the list
of initially advertised speeds and advertise all speeds
supported by adapter.
Signed-off-by: Krzysztof Galazka <krzysztof.galazka at intel.com>
Reviewed by: kbowling
Tested by: Mateusz Moga <mateusz.moga at intel.com>
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D57339
(cherry picked from commit 62d5d119ee7d935ac05966f1c7c4333c33c4f3a9)
ix(4): Sanitize negative error codes
Due to development history FreeBSD driver error codes are reported
the same way as in Linux (as negatives) which is inconsistent
with FreeBSD standard. It may cause unexpected behavior when driver
errors are interpreted by a kernel as syscall handler return values.
This patch converts error codes from negative to positive values for
NVM access functions.
Signed-off-by: Pawel Sobczyk <pawel.sobczyk at intel.com>
Reviewed by: kbowling, erj, milosz.linkiewicz_intel.com
Tested by: Mateusz Moga <mateusz.moga at intel.com>
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D57642
(cherry picked from commit 33e2eac3e3e738daa95a06f42d6c661b87ad9aac)
ix(4): Remove workaround for 2.5/5G speeds on E610
The problem observed on X550 adapters with 2.5 and 5 Gbps speeds
negotiation on some switches is not affecting E610 adapters.
Remove workaround, which omitted those speeds in the list
of initially advertised speeds and advertise all speeds
supported by adapter.
Signed-off-by: Krzysztof Galazka <krzysztof.galazka at intel.com>
Reviewed by: kbowling
Tested by: Mateusz Moga <mateusz.moga at intel.com>
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D57339
(cherry picked from commit 62d5d119ee7d935ac05966f1c7c4333c33c4f3a9)
rc_subr_test: ignore stderr in no_cycles test
nuageinit_user_data_script references 'firstboot_freebsd_update'
and 'firstboot_pkg_upgrade', which are from Ports. In a default
base system test without sysutils/firstboot-freebsd-update and
sysutils/firstboot-pkg-upgrade, rcorder will warn on "unknown
provisions" to stderr, but is otherwise harmless.
Reviewed by: arrowd
Fixes: 16e47f317c4ce2be5fed530bf8a9af9f9bf55364
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 3c33729ce2f421e2a583f19f85a181968aa310de)
tarfs: remove PRIV_VFS_MOUNT_PERM check
The backing file is already opened successfully, so there is
no need to override the permissions.
Reviewed by: des
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58832
(cherry picked from commit 4d524915233092d71b309b49d9743012cb05c11e)
ice(4): Add two more 4-part IDs for E835 adapters
Two additional subdevice IDs were introduced
to distinguish between adapters with and without
manageability over USB support.
Signed-off-by: Krzysztof Galazka <krzysztof.galazka at intel.com>
Reviewed by: erj
Tested by: Mateusz Moga <mateusz.moga at intel.com>
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D57337
(cherry picked from commit f370d9e4d5844daa06d77e57236e03bd7c5f4ba1)
crypto/openssl: update to 3.5.8
This is a security bugfix release. Please see the related merge commit
for more details.
Maintainer note: `quic_ackm.h`'s conflict was resolved by taking
the upstream version of the file verbatim.
Conflicts:
crypto/openssl/include/internal/quic_ackm.h
MFC after: 3 days
Merge commit '248da023ae5ea7292930ac5d715d88b87e2e6f46'
(cherry picked from commit 78e936b2d0b5e6554425009199be31e76bc67c10)
crypto/openssl: update generated content to match 3.5.8 release
This contains 2 new manpages as well as some minor manpage content
changes.
MFC with: 78e936b2d
(cherry picked from commit 0d4d0f3a9f229f9e822b43234b0ff72e7223f19f)
ice: Add led(4) identification support
Expose the firmware-controlled physical port identification LED
through /dev/led/ice*. Use the AdminQ port-identification command to
select blinking mode and restore the netlist-selected original mode
before the interface is stopped.
Sponsored by: BBOX.io
(cherry picked from commit a781965b91ea390f9576ae42c35c842db74aab86)
umtx: use a distribution-fair multiplier for the chain hash
umtxq_hash() multiplies the key by 0x9E370001 and keeps the high bits. That
constant is 0x9E37 * 2^16 + 1, so it degenerates for keys whose spacing carries
trailing zero bits: at a 64 KiB stride it puts 128 of 512 parked waiters onto a
single chain mutex, and at 16 KiB and up it uses only a handful of the 512
chains. Base-system consumers never hit this because libthr places its own wait
words 128 bytes apart, but a Linux-ABI runtime waiting on addresses it allocates
itself lands squarely on the floor. Switch to 0x61C88647, which leaves at most 3
waiters per chain at the same stride; Linux made this exact change in 2016, after
judging the sparse constants "actively bad for hashing".
Approved by: adrian (mentor)
Reviewed by: kib, adrian, emaste
Differential Revision: https://reviews.freebsd.org/D58337
Signed-off-by: Nick Price <nprice at FreeBSD.org>
bxe(4): don't feed a zero page size to ilog2 during ILT init
FreeBSD's bxe hardwires CNIC_SUPPORT() to 0, so bxe_ilt_set_info()
never enters the block that initializes the SRC and TM ILT clients.
Those two clients are left zeroed (page_size 0, flags 0), yet
ecore_ilt_init_page_size() calls ecore_ilt_init_client_psz() for all
four clients unconditionally. For SRC and TM that evaluates
ILOG2(page_size >> 12), i.e. ilog2(0). On an INVARIANTS kernel ilog2()
asserts "ilog argument must be nonzero" and panics the machine the
first time the interface is brought up (bxe_init -> bxe_nic_load ->
bxe_init_hw -> ecore_ilt_init_page_size). On a non-INVARIANTS kernel
it silently programs a bogus page-size register instead.
Restore the else branch that upstream Linux bnx2x carries: when CNIC
is not supported, mark the SRC and TM clients with ILT_CLIENT_SKIP_INIT
and ILT_CLIENT_SKIP_MEM so ecore_ilt_init_client_psz() skips them.
Root-caused from a crash dump on a BCM57810 (device 0x168e): the ILT
clients showed CDU and QM populated and SRC and TM zeroed with no skip
[6 lines not shown]
nanobsd: Remove pandaboard.cfg
Pandaboard (sys/arm/ti/omap4) is removed due to lack of HW.
Remove the pandaboard config file for nanobsd aswell.
Approved by: imp, jlduran, manu(mentor)
Diffrential revision: https://reviews.freebsd.org/D54319
LinuxKPI: 802.11: implement cfg80211_calculate_bitrate()
lkpi_cfg80211_calculate_bitrate_vht() was constantly showing up
in my debug traces as a TODO with rtw89 so I went ahead and implemented
the HT and VHT versions. Realtek seems to limit amsdu sizes based
on the value and ask for it whether needed or not.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
iflib: don't update the admin status in if_media_status()
When _task_fn_admin() is active, it will regularly call
IFDI_UPDATE_ADMIN_STATUS(). So there is no need to do it in
iflib_media_status. This can be fairly expensive on some drivers (long
DELAY busywait loops waiting for a NIC command), and there is no need
to pause a userspace app in this DELAY() if it is happening
asynchronously anyway.
Note the logic to detect if _task_fn_admin() is regularly calling
IFDI_UPDATE_ADMIN_STATUS() was copied from that function.
Reviewed by: erj, kbowling
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D54096
gstat: Set errno = 0 before strtoul
The strtoul function sets errno on error, but does not clear it on
success; when using strtoul and checking errno (as one should) for
ERANGE / EINVAL afterwards, it's important to zero errno first.
While here, remove a dead store.
Reviewed by: phk
Fixes: 4fe8c1b67be0 ("Add error and range checking ... ")
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D59270
inetd: only declare and use the mapped-address netconfig under INET6
In a WITHOUT_INET6 build the only assignment to netid2 is compiled out and
the non-INET6 arm returns early, so netid2 is unconditionally NULL and the
rpcb_set() call guarded by it is dead code. clang does not prove it dead
and reports nbuf2 as uninitialized where it is passed as a const pointer,
No functional change.
MFC after: 1 week
Reported by: clang (-Wuninitialized-const-pointer)
Suggested by: dim
Approved by: ngie (co-mentor)
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D59277
aq(4): arm PHY thermal shutdown only where a sensor exists
aq_fw2x_thermal_arm() reached for a copper PHY register that the fibre
parts do not implement, so arming failed on every init and printed a
warning for a capability the hardware cannot have. Return ENOTSUP when
the firmware does not advertise a temperature sensor, matching
aq_fw2x_get_temp(), and warn only for a genuine failure.
Signed-off-by: Nick Price <nprice at FreeBSD.org>
Accepted-by: adrian
Approved-by: adrian
(cherry picked from commit 6dbf809bafe1421fbf3cdd952748b15437b7c72a)
aq(4): probe the D100 device ID
The D100 device ID was defined and handled by aq_hw_capabilities(), but
had no entry in aq_vendor_info_array[], so the driver never probed it and
the card was left unattached. Add the missing entry; the table lists the
fibre variant last within each group, so it follows D109 rather than
sorting numerically.
Signed-off-by: Nick Price <nprice at FreeBSD.org>
Accepted-by: adrian
Approved-by: adrian
(cherry picked from commit 1a78f5ae3917b770bd958010dae86574b15d97ff)
aq(4): observability controls and sysctl/header hygiene
Fold the driver's observability and infrastructure work.
Make aq_device.h self-contained: it declares struct aq_dev in terms of
iflib, bitstring, socket, and ethernet types but included none of the
headers that define them, compiling only because every includer happened
to pull those first. Include what it uses. No functional change.
Make the debug controls per-instance. The debug and debug_categories
sysctls were registered per device but pointed at file-scope globals, so
writing dev.aq.1.debug also changed dev.aq.0.debug and a card could not
be traced in isolation. Move the level and category mask into struct
aq_dev, reach them through the aq_dev back-pointer in struct aq_hw (wired
up in attach_pre before the first firmware trace and guarded against a
NULL deref), emit through device_printf() so each line carries its unit,
and seed initial values from per-unit device hints so attach can be
traced.
[29 lines not shown]
aq(4): report link transitions and previously silent failures
A link flap left nothing in the log to work from. Both the link up and
link down messages were gated on bootverbose while the message for a
speed change that keeps carrier was not, so a default kernel was silent
about a flap yet loud about a downshift -- the inverse of what an
operator wants. The generic message from if_link_state_change() carries
no speed, so gating the driver's own left the negotiated rate
unrecorded. Report both transitions unconditionally.
Say more than the rate. aq_hw_get_link_state() already negotiates flow
control and throws it away, and Atlantic 2 reports duplex and EEE in the
same link status word the rate comes from; decode them through a new
get_link_info firmware op and name all of it on the up transition. EEE
matters for a flap: low power idle transitions are a common source of
marginal link trouble on multi-gigabit copper, and whether it was active
is otherwise invisible.
Give the down transition a cause. The PHY global fault code was only
[74 lines not shown]
aq(4): mailbox, flow-control and firmware error-handling fixes
Fold the whole-driver-review correctness and hardening fixes for the
firmware and hardware layers.
Advance the firmware-mailbox address per word in aq_hw_fw_downld_dwords():
on B1 silicon each loop iteration waits for the mailbox address register
to differ from the expected address, but it was set once and never moved,
so after the first word every wait returned immediately and read stale
data. Advance it four bytes per word. B0 is unaffected (it polls the
busy bit). The same function also left err set to ETIMEDOUT after
successfully force-recovering the RAM CPU semaphore; the transfer loop is
guarded by "--cnt && !err", so it ran zero iterations and returned a
timeout with an untouched buffer, making the recovery path dead code.
aq_hw_get_mac_permanent() ignored the get_mac_addr() error and then
examined a buffer the firmware op never wrote on failure. A fresh softc
is zero, so the "invalid address" test fired, a random locally
administered MAC was substituted, and err was overwritten with 0 -- a
[48 lines not shown]